Changeset 21832 in vbox for trunk/src/VBox/HostServices/SharedOpenGL
- Timestamp:
- Jul 28, 2009 12:06:03 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_getteximage.c
r15532 r21832 14 14 void SERVER_DISPATCH_APIENTRY 15 15 crServerDispatchGetTexImage(GLenum target, GLint level, GLenum format, 16 16 GLenum type, GLvoid * pixels) 17 17 { 18 19 18 GLsizei width, height, depth, size; 19 GLvoid *buffer = NULL; 20 20 21 22 23 21 cr_server.head_spu->dispatch_table.GetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, &width); 22 cr_server.head_spu->dispatch_table.GetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, &height); 23 cr_server.head_spu->dispatch_table.GetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, &depth); 24 24 25 25 size = crTextureSize(format, type, width, height, depth); 26 26 27 if (size && (buffer = crAlloc(size))) { 28 /* Note, the other pixel PACK parameters (default values) should 29 * be OK at this point. 30 */ 31 cr_server.head_spu->dispatch_table.PixelStorei(GL_PACK_ALIGNMENT, 1); 32 cr_server.head_spu->dispatch_table.GetTexImage(target, level, format, 33 type, buffer); 34 crServerReturnValue( buffer, size ); 35 crFree(buffer); 36 } 37 else { 38 /* need to return _something_ to avoid blowing up */ 39 GLuint dummy = 0; 40 crServerReturnValue( (GLvoid *) &dummy, sizeof(dummy) ); 41 } 27 if (size && (buffer = crAlloc(size))) { 28 /* Note, the other pixel PACK parameters (default values) should 29 * be OK at this point. 30 */ 31 cr_server.head_spu->dispatch_table.PixelStorei(GL_PACK_ALIGNMENT, 1); 32 cr_server.head_spu->dispatch_table.GetTexImage(target, level, format, type, buffer); 33 crServerReturnValue( buffer, size ); 34 crFree(buffer); 35 } 36 else { 37 /* need to return _something_ to avoid blowing up */ 38 GLuint dummy = 0; 39 crServerReturnValue( (GLvoid *) &dummy, sizeof(dummy) ); 40 } 42 41 } 43 42 … … 47 46 void SERVER_DISPATCH_APIENTRY 48 47 crServerDispatchGetCompressedTexImageARB(GLenum target, GLint level, 49 48 GLvoid *img) 50 49 { 51 52 50 GLint size; 51 GLvoid *buffer=NULL; 53 52 54 53 cr_server.head_spu->dispatch_table.GetTexLevelParameteriv(target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &size); 55 54 56 if (size && (buffer = crAlloc(size))) { 57 /* XXX the pixel PACK parameter should be OK at this point */ 58 cr_server.head_spu->dispatch_table.GetCompressedTexImageARB(target, level, 59 buffer); 60 crServerReturnValue( buffer, size ); 61 crFree(buffer); 62 } 63 else { 64 /* need to return _something_ to avoid blowing up */ 65 GLuint dummy = 0; 66 crServerReturnValue( (GLvoid *) &dummy, sizeof(dummy) ); 67 } 55 if (size && (buffer = crAlloc(size))) { 56 /* XXX the pixel PACK parameter should be OK at this point */ 57 cr_server.head_spu->dispatch_table.GetCompressedTexImageARB(target, level, buffer); 58 crServerReturnValue( buffer, size ); 59 crFree(buffer); 60 } 61 else { 62 /* need to return _something_ to avoid blowing up */ 63 GLuint dummy = 0; 64 crServerReturnValue( (GLvoid *) &dummy, sizeof(dummy) ); 65 } 68 66 } 69 67
Note:
See TracChangeset
for help on using the changeset viewer.