VirtualBox

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

最後變更 在這個檔案從18171是 15532,由 vboxsync 提交於 16 年 前

crOpenGL: export to OSE

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 1.4 KB
 
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}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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