Changeset 44059 in vbox for trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_bufferobject.c
- Timestamp:
- Dec 7, 2012 10:34:42 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_bufferobject.c
r44052 r44059 30 30 } 31 31 32 void STATE_APIENTRY crStateGenBuffersARB(GLsizei n, GLuint *buffers) 33 { 34 CRContext *g = GetCurrentContext(); 35 crStateGenNames(g, g->shared->buffersTable, n, buffers); 36 } 37 32 38 GLboolean crStateIsBufferBound(GLenum target) 33 39 { … … 185 191 newObj = (CRBufferObject *) crHashtableSearch(g->shared->buffersTable, buffer); 186 192 if (!newObj) { 193 CRSTATE_CHECKERR(!crHashtableIsKeyUsed(g->shared->buffersTable, buffer), GL_INVALID_OPERATION, "name is not a buffer object"); 187 194 newObj = AllocBufferObject(buffer); 188 if (!newObj) { 189 crStateError(__LINE__, __FILE__, GL_OUT_OF_MEMORY, "glBindBuffer"); 195 CRSTATE_CHECKERR(!newObj, GL_OUT_OF_MEMORY, "glBindBuffer"); 196 #ifndef IN_GUEST 197 diff_api.GenBuffersARB(1, &newObj->hwid); 198 if (!newObj->hwid) 199 { 200 crWarning("GenBuffersARB failed!"); 201 crFree(newObj); 190 202 return; 191 203 } 204 #endif 192 205 crHashtableAdd( g->shared->buffersTable, buffer, newObj ); 193 206 } … … 334 347 } 335 348 336 337 void STATE_APIENTRY338 crStateGenBuffersARB(GLsizei n, GLuint * buffers)339 {340 CRContext *g = GetCurrentContext();341 CRBufferObjectState *b = &(g->bufferobject);342 GLint start;343 344 FLUSH();345 346 if (g->current.inBeginEnd) {347 crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION,348 "glGenBuffersARB called in Begin/End");349 return;350 }351 352 if (n < 0) {353 crStateError(__LINE__, __FILE__, GL_INVALID_VALUE,354 "glGenBuffersARB(n < 0)");355 return;356 }357 358 start = crHashtableAllocKeys(g->shared->buffersTable, n);359 if (start) {360 GLint i;361 for (i = 0; i < n; i++)362 buffers[i] = (GLuint) (start + i);363 }364 else {365 crStateError(__LINE__, __FILE__, GL_OUT_OF_MEMORY, "glGenBuffersARB");366 }367 }368 369 370 349 GLboolean STATE_APIENTRY 371 350 crStateIsBufferARB(GLuint buffer)
Note:
See TracChangeset
for help on using the changeset viewer.