VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_readpixels.c@ 27091

最後變更 在這個檔案從27091是 27091,由 vboxsync 提交於 15 年 前

crOpenGL: add GL_ARB_pixel_buffer_object support

  • 屬性 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 "unpacker.h"
8#include "cr_pixeldata.h"
9#include "cr_mem.h"
10
11void crUnpackReadPixels( void )
12{
13 GLint x = READ_DATA( 0, GLint );
14 GLint y = READ_DATA( 4, GLint );
15 GLsizei width = READ_DATA( 8, GLsizei );
16 GLsizei height = READ_DATA( 12, GLsizei );
17 GLenum format = READ_DATA( 16, GLenum );
18 GLenum type = READ_DATA( 20, GLenum );
19 GLint stride = READ_DATA( 24, GLint );
20 GLint alignment = READ_DATA( 28, GLint );
21 GLint skipRows = READ_DATA( 32, GLint );
22 GLint skipPixels = READ_DATA( 36, GLint );
23 GLint bytes_per_row = READ_DATA( 40, GLint );
24 GLint rowLength = READ_DATA( 44, GLint );
25 GLvoid *pixels;
26
27 /* point <pixels> at the 8-byte network pointer */
28 pixels = DATA_POINTER( 48, GLvoid );
29
30 (void) stride;
31 (void) bytes_per_row;
32 (void) alignment;
33 (void) skipRows;
34 (void) skipPixels;
35 (void) rowLength;
36
37 /* we always pack densely on the server side! */
38 cr_unpackDispatch.PixelStorei( GL_PACK_ROW_LENGTH, 0 );
39 cr_unpackDispatch.PixelStorei( GL_PACK_SKIP_PIXELS, 0 );
40 cr_unpackDispatch.PixelStorei( GL_PACK_SKIP_ROWS, 0 );
41 cr_unpackDispatch.PixelStorei( GL_PACK_ALIGNMENT, 1 );
42
43 cr_unpackDispatch.ReadPixels( x, y, width, height, format, type, pixels);
44
45 INCR_DATA_PTR(48+sizeof(CRNetworkPointer));
46}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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