add some cleanup to lights example

This commit is contained in:
aap
2021-03-03 02:15:38 +01:00
parent 0921a2b003
commit d13bd898fe
5 changed files with 73 additions and 1 deletions

View File

@ -71,6 +71,25 @@ CameraCreate(int32 width, int32 height, bool32 z)
return cam;
}
void
CameraDestroy(rw::Camera *cam)
{
if(cam->frameBuffer){
cam->frameBuffer->destroy();
cam->frameBuffer = nil;
}
if(cam->zBuffer){
cam->zBuffer->destroy();
cam->zBuffer = nil;
}
rw::Frame *frame = cam->getFrame();
if(frame){
cam->setFrame(nil);
frame->destroy();
}
cam->destroy();
}
void
CameraSize(Camera *cam, Rect *r)
{