summaryrefslogtreecommitdiffstats
path: root/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_context.c
blob: bc58dce385b40f6ae859ad51278b332c4d167da4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* Copyright (c) 2001, Stanford University
 * All rights reserved
 *
 * See the file LICENSE.txt for information on redistributing this software.
 */

#include "unpacker.h"
#include "cr_mem.h"

/* XXX duplicated in pack_context.c */
#define DISPLAY_NAME_LEN 256

#define READ_BYTES( dest, offset, len ) \
    crMemcpy( dest, (cr_unpackData + (offset)), len )

void crUnpackExtendCreateContext( void )
{
	char dpyName[DISPLAY_NAME_LEN];
	GLint visBits = READ_DATA( DISPLAY_NAME_LEN + 8, GLint );
	GLint shareCtx = READ_DATA( DISPLAY_NAME_LEN + 12, GLint );
	GLint retVal;

	READ_BYTES( dpyName, 8, DISPLAY_NAME_LEN );
	dpyName[DISPLAY_NAME_LEN - 1] = 0; /* NULL-terminate, just in case */

	SET_RETURN_PTR( DISPLAY_NAME_LEN + 16 );
	SET_WRITEBACK_PTR( DISPLAY_NAME_LEN + 24 );
	retVal = cr_unpackDispatch.CreateContext( dpyName, visBits, shareCtx );
	(void) retVal;
}

void crUnpackExtendWindowCreate(void)
{
	char dpyName[DISPLAY_NAME_LEN];
	GLint visBits = READ_DATA( DISPLAY_NAME_LEN + 8, GLint );
	GLint retVal;

	READ_BYTES( dpyName, 8, DISPLAY_NAME_LEN );
	dpyName[DISPLAY_NAME_LEN - 1] = 0; /* NULL-terminate, just in case */

	SET_RETURN_PTR( DISPLAY_NAME_LEN + 12 );
	SET_WRITEBACK_PTR( DISPLAY_NAME_LEN + 20 );
	retVal = cr_unpackDispatch.WindowCreate( dpyName, visBits );
	(void) retVal;
}