VirtualBox

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

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

crOpenGL: add GL_ARB_pixel_buffer_object support

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.4 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 "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}
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