VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/include/cr_unpack.h@ 36843

Last change on this file since 36843 was 15532, checked in by vboxsync, 16 years ago

crOpenGL: export to OSE

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.0 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#ifndef CR_UNPACK_H
8#define CR_UNPACK_H
9
10#include "cr_compiler.h"
11#include "cr_spu.h"
12#include "cr_protocol.h"
13#include "cr_mem.h"
14
15#include <iprt/types.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21extern SPUDispatchTable cr_unpackDispatch;
22/*extern DLLDATA(const unsigned char *) cr_unpackData;*/
23extern DECLEXPORT(const unsigned char *) cr_unpackData;
24
25DECLEXPORT(void) crUnpackSetReturnPointer( CRNetworkPointer *ptr );
26DECLEXPORT(void) crUnpackSetWritebackPointer( CRNetworkPointer *ptr );
27DECLEXPORT(void) crUnpack( const void *data, const void *opcodes, unsigned int num_opcodes, SPUDispatchTable *table );
28DECLEXPORT(void) crUnpackPush(void);
29DECLEXPORT(void) crUnpackPop(void);
30
31extern CRNetworkPointer * return_ptr;
32extern CRNetworkPointer * writeback_ptr;
33
34#if defined(LINUX) || defined(WINDOWS)
35#define CR_UNALIGNED_ACCESS_OKAY
36#else
37#undef CR_UNALIGNED_ACCESS_OKAY
38#endif
39DECLEXPORT(double) crReadUnalignedDouble( const void *buffer );
40
41#define READ_DATA( offset, type ) \
42 *( (const type *) (cr_unpackData + (offset)))
43
44#ifdef CR_UNALIGNED_ACCESS_OKAY
45#define READ_DOUBLE( offset ) \
46 READ_DATA( offset, GLdouble )
47#else
48#define READ_DOUBLE( offset ) \
49 crReadUnalignedDouble( cr_unpackData + (offset) )
50#endif
51
52#define READ_NETWORK_POINTER( offset ) \
53 ( cr_unpackData + (offset) )
54
55/* XXX make this const */
56#define DATA_POINTER( offset, type ) \
57 ( (type *) (cr_unpackData + (offset)) )
58
59#define INCR_DATA_PTR( delta ) \
60 cr_unpackData += (delta)
61
62#define INCR_DATA_PTR_NO_ARGS() \
63 INCR_DATA_PTR( 4 )
64
65#define INCR_VAR_PTR() \
66 INCR_DATA_PTR( *((int *) cr_unpackData ) )
67
68#define SET_RETURN_PTR( offset ) \
69 crMemcpy( return_ptr, cr_unpackData + (offset), sizeof( *return_ptr ) );
70
71#define SET_WRITEBACK_PTR( offset ) \
72 crMemcpy( writeback_ptr, cr_unpackData + (offset), sizeof( *writeback_ptr ) );
73
74#ifdef __cplusplus
75}
76#endif
77
78#endif /* CR_UNPACK_H */
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