2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: lib/opengl32/opengl32.h
5 * PURPOSE: OpenGL32 lib
6 * PROGRAMMER: Royce Mitchell III, Anich Gregor (blight)
11 #ifndef OPENGL32_PRIVATE_H
12 #define OPENGL32_PRIVATE_H
14 #define snwprintf _snwprintf
18 #endif /* __cplusplus */
22 #ifndef PFD_GENERIC_ACCELERATED
23 # define PFD_GENERIC_ACCELERATED 0x00001000
26 #define OPENGL_DRIVERS_SUBKEY L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\OpenGLDrivers"
27 #define OPENGL_DRIVERS_SUBKEY2 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\OpenGLDrivers\\"
33 #define WIN32_NO_STATUS
41 #define NTOS_MODE_USER
42 #include <ndk/pstypes.h>
47 /* gl function list */
50 /* ICD index list/types */
55 # define DEBUG_OPENGL32
56 /* enable breakpoints */
57 /*# define DEBUG_OPENGL32_BRKPTS*/
58 /* dumps the list of (un)supported glXXX functions when an ICD is loaded. */
59 # define DEBUG_OPENGL32_ICD_EXPORTS
60 /* prints much information about whats going on */
61 # define DEBUG_OPENGL32_TRACE
65 # ifdef DEBUG_OPENGL32
67 # define DBGPRINT( fmt, args... ) \
68 DPRINT( "OpenGL32.DLL: %s: "fmt"\n", __FUNCTION__, ##args )
72 # define DBGPRINT( ... ) do {} while (0)
75 #ifdef DEBUG_OPENGL32_BRKPTS
76 # if defined(__GNUC__)
77 # define DBGBREAK() __asm__( "int $3" );
78 # elif defined(_MSC_VER)
79 # define DBGBREAK() __asm { int 3 }
81 # error Unsupported compiler!
84 # define DBGBREAK() do {} while (0)
87 #ifdef DEBUG_OPENGL32_TRACE
88 # define DBGTRACE( args... ) DBGPRINT( args )
90 # define DBGTRACE( ... ) do {} while (0)
93 /* function/data attributes */
94 #define EXPORT __declspec(dllexport)
96 # define NAKED __declspec(naked)
99 # define WINAPI __stdcall
102 # define NAKED __attribute__((naked))
103 # define SHARED __attribute__((section("shared"), shared))
108 #endif /* APIENTRY */
109 #define APIENTRY __stdcall
111 /* Called by the driver to set the dispatch table */
112 typedef DWORD (WINAPI
*SetContextCallBack
)( const ICDTable
* );
114 /* OpenGL ICD data */
115 typedef struct tagGLDRIVERDATA
117 HMODULE handle
; /*!< DLL handle */
118 UINT refcount
; /*!< Number of references to this ICD */
119 WCHAR driver_name
[256]; /*!< Name of ICD driver */
121 WCHAR dll
[256]; /*!< Dll filename from registry */
122 DWORD version
; /*!< Version value from registry */
123 DWORD driver_version
; /*!< DriverVersion value from registry */
124 DWORD flags
; /*!< Flags value from registry */
126 BOOL (WINAPI
*DrvCopyContext
)( HGLRC
, HGLRC
, UINT
);
127 HGLRC (WINAPI
*DrvCreateContext
)( HDC
);
128 HGLRC (WINAPI
*DrvCreateLayerContext
)( HDC
, int );
129 BOOL (WINAPI
*DrvDeleteContext
)( HGLRC
);
130 BOOL (WINAPI
*DrvDescribeLayerPlane
)( HDC
, int, int, UINT
, LPLAYERPLANEDESCRIPTOR
);
131 int (WINAPI
*DrvDescribePixelFormat
)( IN HDC
, IN
int, IN UINT
, OUT LPPIXELFORMATDESCRIPTOR
);
132 int (WINAPI
*DrvGetLayerPaletteEntries
)( HDC
, int, int, int, COLORREF
* );
133 PROC (WINAPI
*DrvGetProcAddress
)( LPCSTR lpProcName
);
134 void (WINAPI
*DrvReleaseContext
)( HGLRC hglrc
); /* maybe returns BOOL? */
135 BOOL (WINAPI
*DrvRealizeLayerPalette
)( HDC
, int, BOOL
);
136 PICDTable (WINAPI
*DrvSetContext
)( HDC hdc
, HGLRC hglrc
, SetContextCallBack callback
);
137 int (WINAPI
*DrvSetLayerPaletteEntries
)( HDC
, int, int, int, CONST COLORREF
* );
138 BOOL (WINAPI
*DrvSetPixelFormat
)( IN HDC
, IN
int, const PIXELFORMATDESCRIPTOR
* );
139 BOOL (WINAPI
*DrvShareLists
)( HGLRC
, HGLRC
);
140 BOOL (WINAPI
*DrvSwapBuffers
)( HDC
);
141 BOOL (WINAPI
*DrvSwapLayerBuffers
)( HDC
, UINT
);
142 BOOL (WINAPI
*DrvValidateVersion
)( DWORD
);
144 struct tagGLDRIVERDATA
*next
; /* next ICD -- linked list */
147 /* Our private OpenGL context (stored in TLS) */
148 typedef struct tagGLRC
150 GLDRIVERDATA
*icd
; /*!< driver used for this context */
151 HDC hdc
; /*!< DC handle */
152 BOOL is_current
; /*!< Wether this context is current for some DC */
153 DWORD thread_id
; /*!< Thread holding this context */
155 HGLRC hglrc
; /*!< GLRC from DrvCreateContext (ICD internal) */
157 struct tagGLRC
*next
; /* linked list */
160 /* OpenGL private device context data */
161 typedef struct tagGLDCDATA
163 HANDLE handle
; /*!< Handle for which this data is (HWND for device, HDC for memory context) */
164 GLDRIVERDATA
*icd
; /*!< Driver used for this DC */
165 int pixel_format
; /*!< Selected pixel format */
167 struct tagGLDCDATA
*next
; /* linked list */
172 typedef struct tagGLPROCESSDATA
174 GLDRIVERDATA
*driver_list
; /*!< List of loaded drivers */
175 HANDLE driver_mutex
; /*!< Mutex to protect driver list */
176 GLRC
*glrc_list
; /*!< List of GL rendering contexts */
177 HANDLE glrc_mutex
; /*!< Mutex to protect glrc list */
178 GLDCDATA
*dcdata_list
; /*!< List of GL private DC data */
179 HANDLE dcdata_mutex
; /*!< Mutex to protect glrc list */
182 extern GLPROCESSDATA OPENGL32_processdata
;
184 /* function prototypes */
185 GLDRIVERDATA
*OPENGL32_LoadICD( LPCWSTR driver
);
186 BOOL
OPENGL32_UnloadICD( GLDRIVERDATA
*icd
);
187 BOOL APIENTRY
rosglMakeCurrent( HDC hdc
, HGLRC hglrc
);
188 BOOL APIENTRY
IntUseFontBitmapsA( HDC hDC
, DWORD first
, DWORD count
, DWORD listBase
);
189 BOOL APIENTRY
IntUseFontBitmapsW( HDC hDC
, DWORD first
, DWORD count
, DWORD listBase
);
190 BOOL APIENTRY
IntUseFontOutlinesA( HDC hDC
, DWORD first
, DWORD count
, DWORD listBase
,
191 FLOAT chordalDeviation
, FLOAT extrusion
, INT format
,
192 GLYPHMETRICSFLOAT
*glyphMetricsFloatArray
);
193 BOOL APIENTRY
IntUseFontOutlinesW( HDC hDC
, DWORD first
, DWORD count
, DWORD listBase
,
194 FLOAT chordalDeviation
, FLOAT extrusion
, INT format
,
195 GLYPHMETRICSFLOAT
*glyphMetricsFloatArray
);
197 /* empty gl functions from gl.c */
198 int WINAPI
glEmptyFunc0( void );
199 int WINAPI
glEmptyFunc4( long );
200 int WINAPI
glEmptyFunc8( long, long );
201 int WINAPI
glEmptyFunc12( long, long, long );
202 int WINAPI
glEmptyFunc16( long, long, long, long );
203 int WINAPI
glEmptyFunc20( long, long, long, long, long );
204 int WINAPI
glEmptyFunc24( long, long, long, long, long, long );
205 int WINAPI
glEmptyFunc28( long, long, long, long, long, long, long );
206 int WINAPI
glEmptyFunc32( long, long, long, long, long, long, long, long );
207 int WINAPI
glEmptyFunc36( long, long, long, long, long, long, long, long,
209 int WINAPI
glEmptyFunc40( long, long, long, long, long, long, long, long,
211 int WINAPI
glEmptyFunc44( long, long, long, long, long, long, long, long,
213 int WINAPI
glEmptyFunc48( long, long, long, long, long, long, long, long,
214 long, long, long, long );
215 int WINAPI
glEmptyFunc52( long, long, long, long, long, long, long, long,
216 long, long, long, long, long );
217 int WINAPI
glEmptyFunc56( long, long, long, long, long, long, long, long,
218 long, long, long, long, long, long );
220 #ifdef OPENGL32_GL_FUNC_PROTOTYPES
222 #define X(func,ret,typeargs,args,icdidx,tebidx,stack) ret WINAPI func typeargs;
226 #endif /* OPENGL32_GL_FUNC_PROTOTYPES */
230 #endif /* __cplusplus */
232 #endif /* OPENGL32_PRIVATE_H */