if(oglMesh)
{
OGLSystem oglSystem = displaySystem.driverData;
+ GLCapabilities caps = glCaps;
SETCAPS(oglSystem.capabilities);
+
if(!mesh.flags.vertices)
{
oglMesh.vertices.free();
delete oglMesh;
mesh.data = null;
}
+ SETCAPS(caps);
}
}
void UnlockMesh(DisplaySystem displaySystem, Mesh mesh, MeshFeatures flags)
{
OGLSystem oglSystem = displaySystem.driverData;
+ GLCapabilities caps = glCaps;
SETCAPS(oglSystem.capabilities);
+
if(glCaps_vertexBuffer)
{
OGLMesh oglMesh = mesh.data;
if(flags.lightVectors)
oglMesh.lightVectors.allocate(mesh.nVertices * sizeof(ColorRGB), mesh.lightVectors, staticDraw);
}
+ SETCAPS(caps);
}
bool LockMesh(DisplaySystem displaySystem, Mesh mesh, MeshFeatures flags)
void FreeIndices(DisplaySystem displaySystem, OGLIndices oglIndices)
{
OGLSystem oglSystem = displaySystem.driverData;
+ GLCapabilities caps = glCaps;
SETCAPS(oglSystem.capabilities);
+
if(oglIndices)
{
oglIndices.buffer.free();
delete oglIndices.indices;
delete oglIndices;
}
+ SETCAPS(caps);
}
void * AllocateIndices(DisplaySystem displaySystem, int nIndices, bool indices32bit)
void UnlockIndices(DisplaySystem displaySystem, OGLIndices oglIndices, bool indices32bit, int nIndices)
{
OGLSystem oglSystem = displaySystem.driverData;
+ GLCapabilities caps = glCaps;
SETCAPS(oglSystem.capabilities);
+
if(glCaps_vertexBuffer)
{
if(!glCaps_intAndDouble && indices32bit)
nIndices * (indices32bit ? sizeof(uint32) : sizeof(uint16)),
oglIndices.indices, staticDraw);
}
+ SETCAPS(caps);
}
uint16 * LockIndices(DisplaySystem displaySystem, OGLIndices oglIndices)