mirror of
https://github.com/thes3m/XNI
synced 2024-12-26 13:26:06 +01:00
Fixed buffers that didn't clean up after themselves.
git-svn-id: http://xni.googlecode.com/svn/XNI@123 ac433895-eea3-a490-d80a-17149a75e588
This commit is contained in:
parent
0b5b46e937
commit
9c8ed11ac6
@ -22,7 +22,8 @@
|
|||||||
|
|
||||||
- (uint) createBuffer;
|
- (uint) createBuffer;
|
||||||
- (void) setData:(void*)data toIndexBuffer:(IndexBuffer*)buffer;
|
- (void) setData:(void*)data toIndexBuffer:(IndexBuffer*)buffer;
|
||||||
- (void) setData:(void*)data toVertexBuffer:(VertexBuffer*)buffer;
|
- (void) setData:(void*)data toVertexBuffer:(VertexBuffer*)buffer;
|
||||||
|
- (void) releaseBuffer:(uint)bufferId;
|
||||||
|
|
||||||
// Profile specific
|
// Profile specific
|
||||||
- (EAGLContext*) createContext;
|
- (EAGLContext*) createContext;
|
||||||
|
@ -408,6 +408,9 @@
|
|||||||
glBindBuffer(resourceType, 0);
|
glBindBuffer(resourceType, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)releaseBuffer:(uint)bufferId {
|
||||||
|
glDeleteBuffers(1, &bufferId);
|
||||||
|
}
|
||||||
|
|
||||||
// Profile specific
|
// Profile specific
|
||||||
|
|
||||||
|
@ -39,5 +39,11 @@
|
|||||||
[graphicsDevice setData:data.array toIndexBuffer:self];
|
[graphicsDevice setData:data.array toIndexBuffer:self];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)dealloc
|
||||||
|
{
|
||||||
|
[graphicsDevice releaseBuffer:bufferID];
|
||||||
|
[super dealloc];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
{
|
{
|
||||||
|
[graphicsDevice releaseBuffer:bufferID];
|
||||||
[vertexDeclaration release];
|
[vertexDeclaration release];
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user