VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/packer/pack_pixelmap.c@ 27073

Last change on this file since 27073 was 27073, checked in by vboxsync, 15 years ago

crOpenGL: tabs to spaces

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7#include "packer.h"
8#include "cr_mem.h"
9
10static unsigned char * __gl_HandlePixelMapData(GLenum map, GLsizei mapsize, int size_of_value, const GLvoid *values)
11{
12 int packet_length =
13 sizeof( map ) +
14 sizeof( mapsize ) +
15 mapsize*size_of_value;
16 unsigned char *data_ptr = (unsigned char *) crPackAlloc( packet_length );
17
18 WRITE_DATA( 0, GLenum, map );
19 WRITE_DATA( 4, GLsizei, mapsize );
20 crMemcpy( data_ptr + 8, values, mapsize*size_of_value );
21 return data_ptr;
22}
23
24void PACK_APIENTRY crPackPixelMapfv(GLenum map, GLsizei mapsize,
25 const GLfloat *values)
26{
27 unsigned char *data_ptr = __gl_HandlePixelMapData( map, mapsize, sizeof( *values ), values );
28
29 crHugePacket( CR_PIXELMAPFV_OPCODE, data_ptr );
30 crPackFree( data_ptr );
31}
32
33void PACK_APIENTRY crPackPixelMapuiv(GLenum map, GLsizei mapsize,
34 const GLuint *values)
35{
36 unsigned char *data_ptr = __gl_HandlePixelMapData( map, mapsize, sizeof( *values ), values );
37
38 crHugePacket( CR_PIXELMAPUIV_OPCODE, data_ptr );
39 crPackFree( data_ptr );
40}
41
42void PACK_APIENTRY crPackPixelMapusv(GLenum map, GLsizei mapsize,
43 const GLushort *values)
44{
45 unsigned char *data_ptr = __gl_HandlePixelMapData( map, mapsize, sizeof( *values ), values );
46
47 crHugePacket( CR_PIXELMAPUSV_OPCODE, data_ptr );
48 crPackFree( data_ptr );
49}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette