mirror of
https://github.com/aap/librw.git
synced 2025-12-20 01:19:51 +00:00
add some cleanup to lights example
This commit is contained in:
@@ -100,10 +100,33 @@ CreateSpotSoftLight(void)
|
||||
return light;
|
||||
}
|
||||
|
||||
void
|
||||
DestroyLight(rw::Light **light)
|
||||
{
|
||||
if(*light == nil)
|
||||
return;
|
||||
rw::World *world = (*light)->world;
|
||||
if(world)
|
||||
world->removeLight(*light);
|
||||
rw::Frame *frame = (*light)->getFrame();
|
||||
if(frame){
|
||||
(*light)->setFrame(nil);
|
||||
frame->destroy();
|
||||
}
|
||||
|
||||
(*light)->destroy();
|
||||
*light = nil;
|
||||
}
|
||||
|
||||
void
|
||||
LightsDestroy(void)
|
||||
{
|
||||
// TODO
|
||||
DestroyLight(&SpotSoftLight);
|
||||
DestroyLight(&SpotLight);
|
||||
DestroyLight(&PointLight);
|
||||
DestroyLight(&DirectLight);
|
||||
DestroyLight(&AmbientLight);
|
||||
DestroyLight(&BaseAmbientLight);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user