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_mem.h"
|
---|
9 |
|
---|
10 | /* XXX duplicated in pack_context.c */
|
---|
11 | #define DISPLAY_NAME_LEN 256
|
---|
12 |
|
---|
13 | #define READ_BYTES( dest, offset, len ) \
|
---|
14 | crMemcpy( dest, (cr_unpackData + (offset)), len )
|
---|
15 |
|
---|
16 | void crUnpackExtendCreateContext( void )
|
---|
17 | {
|
---|
18 | char dpyName[DISPLAY_NAME_LEN];
|
---|
19 | GLint visBits = READ_DATA( DISPLAY_NAME_LEN + 8, GLint );
|
---|
20 | GLint shareCtx = READ_DATA( DISPLAY_NAME_LEN + 12, GLint );
|
---|
21 | GLint retVal;
|
---|
22 |
|
---|
23 | READ_BYTES( dpyName, 8, DISPLAY_NAME_LEN );
|
---|
24 | dpyName[DISPLAY_NAME_LEN - 1] = 0; /* NULL-terminate, just in case */
|
---|
25 |
|
---|
26 | SET_RETURN_PTR( DISPLAY_NAME_LEN + 16 );
|
---|
27 | SET_WRITEBACK_PTR( DISPLAY_NAME_LEN + 24 );
|
---|
28 | retVal = cr_unpackDispatch.CreateContext( dpyName, visBits, shareCtx );
|
---|
29 | (void) retVal;
|
---|
30 | }
|
---|
31 |
|
---|
32 | void crUnpackExtendWindowCreate(void)
|
---|
33 | {
|
---|
34 | char dpyName[DISPLAY_NAME_LEN];
|
---|
35 | GLint visBits = READ_DATA( DISPLAY_NAME_LEN + 8, GLint );
|
---|
36 | GLint retVal;
|
---|
37 |
|
---|
38 | READ_BYTES( dpyName, 8, DISPLAY_NAME_LEN );
|
---|
39 | dpyName[DISPLAY_NAME_LEN - 1] = 0; /* NULL-terminate, just in case */
|
---|
40 |
|
---|
41 | SET_RETURN_PTR( DISPLAY_NAME_LEN + 12 );
|
---|
42 | SET_WRITEBACK_PTR( DISPLAY_NAME_LEN + 20 );
|
---|
43 | retVal = cr_unpackDispatch.WindowCreate( dpyName, visBits );
|
---|
44 | (void) retVal;
|
---|
45 | }
|
---|
46 |
|
---|