Changeset 33457 in vbox for trunk/src/VBox/GuestHost/OpenGL/packer/pack_lists.c
- Timestamp:
- Oct 26, 2010 11:12:30 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/packer/pack_lists.c
r15532 r33457 11 11 static int __gl_CallListsNumBytes( GLenum type ) 12 12 { 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 13 switch( type ) 14 { 15 case GL_BYTE: 16 case GL_UNSIGNED_BYTE: 17 case GL_2_BYTES: 18 return 1; 19 case GL_SHORT: 20 case GL_UNSIGNED_SHORT: 21 case GL_3_BYTES: 22 return 2; 23 case GL_INT: 24 case GL_UNSIGNED_INT: 25 case GL_FLOAT: 26 case GL_4_BYTES: 27 return 4; 28 default: 29 return -1; 30 } 31 31 } 32 32 33 33 void PACK_APIENTRY crPackCallLists(GLint n, GLenum type, 34 34 const GLvoid *lists ) 35 35 { 36 37 36 unsigned char *data_ptr; 37 int packet_length; 38 38 39 40 41 42 43 44 45 39 int num_bytes = __gl_CallListsNumBytes( type ) * n; 40 if (num_bytes < 0) 41 { 42 __PackError( __LINE__, __FILE__, GL_INVALID_ENUM, 43 "crPackCallLists(bad type)" ); 44 return; 45 } 46 46 47 48 49 50 47 packet_length = 48 sizeof( n ) + 49 sizeof( type ) + 50 num_bytes; 51 51 52 53 54 55 52 data_ptr = (unsigned char *) crPackAlloc( packet_length ); 53 WRITE_DATA( 0, GLint, n ); 54 WRITE_DATA( 4, GLenum, type ); 55 crMemcpy( data_ptr + 8, lists, num_bytes ); 56 56 57 57 crHugePacket( CR_CALLLISTS_OPCODE, data_ptr ); 58 58 crPackFree( data_ptr ); 59 59 } … … 63 63 void PACK_APIENTRY crPackNewList( GLuint list, GLenum mode ) 64 64 { 65 66 67 68 69 70 71 72 73 74 75 65 GET_PACKER_CONTEXT(pc); 66 unsigned char *data_ptr; 67 (void) pc; 68 GET_BUFFERED_POINTER( pc, 16 ); 69 WRITE_DATA( 0, GLint, 16 ); 70 WRITE_DATA( 4, GLenum, CR_NEWLIST_EXTEND_OPCODE ); 71 WRITE_DATA( 8, GLuint, list ); 72 WRITE_DATA( 12, GLenum, mode ); 73 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 74 pc->buffer.in_List = GL_TRUE; 75 pc->buffer.holds_List = GL_TRUE; 76 76 } 77 77 78 78 void PACK_APIENTRY crPackEndList( void ) 79 79 { 80 81 82 83 84 85 86 80 GET_PACKER_CONTEXT(pc); 81 unsigned char *data_ptr; 82 GET_BUFFERED_POINTER( pc, 8 ); 83 WRITE_DATA( 0, GLint, 8 ); 84 WRITE_DATA( 4, GLenum, CR_ENDLIST_EXTEND_OPCODE ); 85 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 86 pc->buffer.in_List = GL_FALSE; 87 87 }
Note:
See TracChangeset
for help on using the changeset viewer.