1 /* $Id: opengl32.h,v 1.10 2004/02/06 17:22:55 royce Exp $
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: lib/opengl32/opengl32.h
6 * PURPOSE: OpenGL32 lib
7 * PROGRAMMER: Royce Mitchell III, Anich Gregor (blight)
12 #ifndef OPENGL32_PRIVATE_H
13 #define OPENGL32_PRIVATE_H
15 /* gl function list */
18 /* ICD index list/types */
23 # define DEBUG_OPENGL32
24 # define DEBUG_OPENGL32_BRKPTS /* enable breakpoints */
25 # define DEBUG_OPENGL32_ICD_EXPORTS /* dumps the list of (un)supported glXXX
26 functions when an ICD is loaded. */
30 #ifdef DEBUG_OPENGL32 /* FIXME: DPRINT wants DbgPrint - where is it? */
31 ULONG
DbgPrint(PCH Format
,...);
33 # define DBGPRINT( fmt, args... ) \
34 DPRINT( "OpenGL32.DLL: %s: "fmt"\n", __FUNCTION__, ##args )
36 # define DBGPRINT( ... ) do {} while (0)
39 #ifdef DEBUG_OPENGL32_BRKPTS
40 # if defined(__GNUC__)
41 # define DBGBREAK() __asm__( "int $3" );
42 # elif defined(_MSC_VER)
43 # define DBGBREAK() __asm { int 3 }
45 # error Unsupported compiler!
50 /* table indices for funcnames and function pointers */
54 #define X(func, ret, typeargs, args) GLIDX_##func,
60 /* function name table */
61 extern const char* OPENGL32_funcnames
[GLIDX_COUNT
];
64 /* Called by the driver to set the dispatch table */
65 typedef DWORD (CALLBACK
* SetContextCallBack
)( const ICDTable
* );
68 typedef struct tagGLDRIVERDATA
70 HMODULE handle
; /* DLL handle */
71 UINT refcount
; /* number of references to this ICD */
72 WCHAR driver_name
[256]; /* name of display driver */
74 WCHAR dll
[256]; /* Dll value from registry */
75 DWORD version
; /* Version value from registry */
76 DWORD driver_version
; /* DriverVersion value from registry */
77 DWORD flags
; /* Flags value from registry */
79 BOOL (*DrvCopyContext
)( HGLRC
, HGLRC
, UINT
);
80 HGLRC (*DrvCreateContext
)( HDC
);
81 HGLRC (*DrvCreateLayerContext
)( HDC
, int );
82 BOOL (*DrvDeleteContext
)( HGLRC
);
83 BOOL (*DrvDescribeLayerPlane
)( HDC
, int, int, UINT
, LPLAYERPLANEDESCRIPTOR
);
84 int (*DrvDescribePixelFormat
)( IN HDC
, IN
int, IN UINT
, OUT LPPIXELFORMATDESCRIPTOR
);
85 int (*DrvGetLayerPaletteEntries
)( HDC
, int, int, int, COLORREF
* );
86 FARPROC (*DrvGetProcAddress
)( LPCSTR lpProcName
);
87 void (*DrvReleaseContext
)();
88 BOOL (*DrvRealizeLayerPalette
)( HDC
, int, BOOL
);
89 int (*DrvSetContext
)( HDC hdc
, HGLRC hglrc
, SetContextCallBack callback
);
90 int (*DrvSetLayerPaletteEntries
)( HDC
, int, int, int, CONST COLORREF
* );
91 BOOL (*DrvSetPixelFormat
)( IN HDC
, IN
int, IN CONST PIXELFORMATDESCRIPTOR
* );
92 BOOL (*DrvShareLists
)( HGLRC
, HGLRC
);
93 BOOL (*DrvSwapBuffers
)( HDC
);
94 BOOL (*DrvSwapLayerBuffers
)( HDC
, UINT
);
95 BOOL (*DrvValidateVersion
)( DWORD
);
97 struct tagGLDRIVERDATA
*next
; /* next ICD -- linked list */
100 /* Out private OpenGL context (saved in TLS) */
101 typedef struct tagGLRC
103 GLDRIVERDATA
*icd
; /* driver used for this context */
104 INT iFormat
; /* current pixel format index - ? */
105 HDC hdc
; /* DC handle */
106 BOOL is_current
; /* wether this context is current for some DC */
107 DWORD thread_id
; /* thread holding this context */
109 HGLRC hglrc
; /* GLRC from DrvCreateContext */
111 struct tagGLRC
*next
; /* linked list */
115 typedef struct tagGLPROCESSDATA
117 GLDRIVERDATA
*driver_list
; /* list of loaded drivers */
118 HANDLE driver_mutex
; /* mutex to protect driver list */
119 GLRC
*glrc_list
; /* list of GL rendering contexts */
120 HANDLE glrc_mutex
; /* mutex to protect glrc list */
124 typedef struct tagGLTHREADDATA
126 GLRC
*glrc
; /* current GL rendering context */
129 extern DWORD OPENGL32_tls
;
130 extern GLPROCESSDATA OPENGL32_processdata
;
131 #define OPENGL32_threaddata ((GLTHREADDATA *)TlsGetValue( OPENGL32_tls ))
133 /* function prototypes */
134 GLDRIVERDATA
*OPENGL32_LoadICDForHDC( HDC hdc
);
135 GLDRIVERDATA
*OPENGL32_LoadICD( LPCWSTR driver
);
136 BOOL
OPENGL32_UnloadICD( GLDRIVERDATA
*icd
);
137 DWORD
OPENGL32_RegEnumDrivers( DWORD idx
, LPWSTR name
, LPDWORD cName
);
138 DWORD
OPENGL32_RegGetDriverInfo( LPCWSTR driver
, GLDRIVERDATA
*icd
);
140 /* empty gl functions from gl.c */
141 int STDCALL
glEmptyFunc0();
142 int STDCALL
glEmptyFunc4( long );
143 int STDCALL
glEmptyFunc8( long, long );
144 int STDCALL
glEmptyFunc12( long, long, long );
145 int STDCALL
glEmptyFunc16( long, long, long, long );
146 int STDCALL
glEmptyFunc20( long, long, long, long, long );
147 int STDCALL
glEmptyFunc24( long, long, long, long, long, long );
148 int STDCALL
glEmptyFunc28( long, long, long, long, long, long, long );
149 int STDCALL
glEmptyFunc32( long, long, long, long, long, long, long, long );
150 int STDCALL
glEmptyFunc36( long, long, long, long, long, long, long, long,
152 int STDCALL
glEmptyFunc40( long, long, long, long, long, long, long, long,
154 int STDCALL
glEmptyFunc44( long, long, long, long, long, long, long, long,
156 int STDCALL
glEmptyFunc48( long, long, long, long, long, long, long, long,
157 long, long, long, long );
158 int STDCALL
glEmptyFunc52( long, long, long, long, long, long, long, long,
159 long, long, long, long, long );
160 int STDCALL
glEmptyFunc56( long, long, long, long, long, long, long, long,
161 long, long, long, long, long, long );
163 #endif//OPENGL32_PRIVATE_H