ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

opengl32.h
Go to the documentation of this file.
00001 /*
00002  * COPYRIGHT:            See COPYING in the top level directory
00003  * PROJECT:              ReactOS kernel
00004  * FILE:                 lib/opengl32/opengl32.h
00005  * PURPOSE:              OpenGL32 lib
00006  * PROGRAMMER:           Royce Mitchell III, Anich Gregor (blight)
00007  * UPDATE HISTORY:
00008  *                       Feb 1, 2004: Created
00009  */
00010 
00011 #ifndef OPENGL32_PRIVATE_H
00012 #define OPENGL32_PRIVATE_H
00013 
00014 #define snwprintf _snwprintf
00015 
00016 #ifdef __cplusplus
00017 extern "C" {
00018 #endif /* __cplusplus */
00019 
00020 #define NDEBUG
00021 
00022 #ifndef PFD_GENERIC_ACCELERATED
00023 # define PFD_GENERIC_ACCELERATED 0x00001000
00024 #endif
00025 
00026 #define OPENGL_DRIVERS_SUBKEY L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\OpenGLDrivers"
00027 #define OPENGL_DRIVERS_SUBKEY2 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\OpenGLDrivers\\"
00028 
00029 #include <stdio.h>
00030 #include <stdlib.h>
00031 #include <string.h>
00032 
00033 #define WIN32_LEAN_AND_MEAN
00034 #define WIN32_NO_STATUS
00035 #include <windows.h>
00036 #include <winreg.h>
00037 
00038 #define NTOS_MODE_USER
00039 #include <winddi.h>
00040 #include <ndk/pstypes.h>
00041 
00042 #include <GL/gl.h>
00043 #include <GL/glu.h>
00044 
00045 /* gl function list */
00046 #include "glfuncs.h"
00047 
00048 /* ICD index list/types */
00049 #include "icdtable.h"
00050 
00051 /* debug flags */
00052 #if !defined(NDEBUG)
00053 # define DEBUG_OPENGL32
00054 /* enable breakpoints */
00055 /*# define DEBUG_OPENGL32_BRKPTS*/
00056 /* dumps the list of (un)supported glXXX functions when an ICD is loaded. */
00057 # define DEBUG_OPENGL32_ICD_EXPORTS
00058 /* prints much information about whats going on */
00059 # define DEBUG_OPENGL32_TRACE
00060 #endif /* !NDEBUG */
00061 
00062 /* debug macros */
00063 # ifdef DEBUG_OPENGL32
00064 #  include <debug.h>
00065 #  define DBGPRINT( fmt, args... ) \
00066           DPRINT( "OpenGL32.DLL: %s: "fmt"\n", __FUNCTION__, ##args )
00067 # endif
00068 
00069 #ifndef DBGPRINT
00070 # define DBGPRINT( ... ) do {} while (0)
00071 #endif
00072 
00073 #ifdef DEBUG_OPENGL32_BRKPTS
00074 # if defined(__GNUC__)
00075 #  define DBGBREAK() __asm__( "int $3" );
00076 # elif defined(_MSC_VER)
00077 #  define DBGBREAK() __asm { int 3 }
00078 # else
00079 #  error Unsupported compiler!
00080 # endif
00081 #else
00082 # define DBGBREAK() do {} while (0)
00083 #endif
00084 
00085 #ifdef DEBUG_OPENGL32_TRACE
00086 # define DBGTRACE( args... ) DBGPRINT( args )
00087 #else
00088 # define DBGTRACE( ... ) do {} while (0)
00089 #endif
00090 
00091 /* function/data attributes */
00092 #define EXPORT __declspec(dllexport)
00093 #ifdef _MSC_VER
00094 #  define NAKED __declspec(naked)
00095 #  define SHARED
00096 #  ifndef WINAPI
00097 #    define WINAPI __stdcall
00098 #  endif /* WINAPI */
00099 #else /* GCC */
00100 #  define NAKED __attribute__((naked))
00101 #  define SHARED __attribute__((section("shared"), shared))
00102 #endif
00103 
00104 #ifdef APIENTRY
00105 #undef APIENTRY
00106 #endif /* APIENTRY */
00107 #define APIENTRY __stdcall
00108 
00109 /* Called by the driver to set the dispatch table */
00110 typedef DWORD (WINAPI *SetContextCallBack)( const ICDTable * );
00111 
00112 /* OpenGL ICD data */
00113 typedef struct tagGLDRIVERDATA
00114 {
00115     HMODULE handle;                 
00116     UINT    refcount;               
00117     WCHAR   driver_name[256];       
00119     WCHAR   dll[256];               
00120     DWORD   version;                
00121     DWORD   driver_version;         
00122     DWORD   flags;                  
00124     BOOL      (WINAPI *DrvCopyContext)( HGLRC, HGLRC, UINT );
00125     HGLRC     (WINAPI *DrvCreateContext)( HDC );
00126     HGLRC     (WINAPI *DrvCreateLayerContext)( HDC, int );
00127     BOOL      (WINAPI *DrvDeleteContext)( HGLRC );
00128     BOOL      (WINAPI *DrvDescribeLayerPlane)( HDC, int, int, UINT, LPLAYERPLANEDESCRIPTOR );
00129     int       (WINAPI *DrvDescribePixelFormat)( IN HDC, IN int, IN UINT, OUT LPPIXELFORMATDESCRIPTOR );
00130     int       (WINAPI *DrvGetLayerPaletteEntries)( HDC, int, int, int, COLORREF * );
00131     PROC      (WINAPI *DrvGetProcAddress)( LPCSTR lpProcName );
00132     void      (WINAPI *DrvReleaseContext)( HGLRC hglrc ); /* maybe returns BOOL? */
00133     BOOL      (WINAPI *DrvRealizeLayerPalette)( HDC, int, BOOL );
00134     PICDTable (WINAPI *DrvSetContext)( HDC hdc, HGLRC hglrc, SetContextCallBack callback );
00135     int       (WINAPI *DrvSetLayerPaletteEntries)( HDC, int, int, int, CONST COLORREF * );
00136     BOOL      (WINAPI *DrvSetPixelFormat)( IN HDC, IN int, const PIXELFORMATDESCRIPTOR * );
00137     BOOL      (WINAPI *DrvShareLists)( HGLRC, HGLRC );
00138     BOOL      (WINAPI *DrvSwapBuffers)( HDC );
00139     BOOL      (WINAPI *DrvSwapLayerBuffers)( HDC, UINT );
00140     BOOL      (WINAPI *DrvValidateVersion)( DWORD );
00141 
00142     struct tagGLDRIVERDATA *next;   /* next ICD -- linked list */
00143 } GLDRIVERDATA;
00144 
00145 /* Our private OpenGL context (stored in TLS) */
00146 typedef struct tagGLRC
00147 {
00148     GLDRIVERDATA *icd;  
00149     HDC     hdc;        
00150     BOOL    is_current; 
00151     DWORD   thread_id;  
00153     HGLRC   hglrc;      
00155     struct tagGLRC *next; /* linked list */
00156 } GLRC;
00157 
00158 /* OpenGL private device context data */
00159 typedef struct tagGLDCDATA
00160 {
00161     HDC hdc;           
00162     GLDRIVERDATA *icd; 
00163     int pixel_format;  
00165     struct tagGLDCDATA *next; /* linked list */
00166 } GLDCDATA;
00167 
00168 
00169 /* Process data */
00170 typedef struct tagGLPROCESSDATA
00171 {
00172     GLDRIVERDATA *driver_list;  
00173     HANDLE        driver_mutex; 
00174     GLRC         *glrc_list;    
00175     HANDLE        glrc_mutex;   
00176     GLDCDATA     *dcdata_list;  
00177     HANDLE        dcdata_mutex; 
00178 } GLPROCESSDATA;
00179 
00180 /* TLS data */
00181 typedef struct tagGLTHREADDATA
00182 {
00183     GLRC   *glrc;      
00184 } GLTHREADDATA;
00185 
00186 extern DWORD OPENGL32_tls;
00187 extern GLPROCESSDATA OPENGL32_processdata;
00188 #define OPENGL32_threaddata ((GLTHREADDATA *)TlsGetValue( OPENGL32_tls ))
00189 
00190 /* function prototypes */
00191 GLDRIVERDATA *OPENGL32_LoadICD( LPCWSTR driver );
00192 BOOL OPENGL32_UnloadICD( GLDRIVERDATA *icd );
00193 BOOL APIENTRY rosglMakeCurrent( HDC hdc, HGLRC hglrc );
00194 BOOL APIENTRY IntUseFontBitmapsA( HDC hDC, DWORD first, DWORD count, DWORD listBase );
00195 BOOL APIENTRY IntUseFontBitmapsW( HDC hDC, DWORD first, DWORD count, DWORD listBase );
00196 BOOL APIENTRY IntUseFontOutlinesA( HDC hDC, DWORD first, DWORD count, DWORD listBase,
00197                                   FLOAT chordalDeviation, FLOAT extrusion, INT format,
00198                                   GLYPHMETRICSFLOAT *glyphMetricsFloatArray );
00199 BOOL APIENTRY IntUseFontOutlinesW( HDC hDC, DWORD first, DWORD count, DWORD listBase,
00200                                   FLOAT chordalDeviation, FLOAT extrusion, INT format,
00201                                   GLYPHMETRICSFLOAT *glyphMetricsFloatArray );
00202 
00203 /* empty gl functions from gl.c */
00204 int WINAPI glEmptyFunc0( void );
00205 int WINAPI glEmptyFunc4( long );
00206 int WINAPI glEmptyFunc8( long, long );
00207 int WINAPI glEmptyFunc12( long, long, long );
00208 int WINAPI glEmptyFunc16( long, long, long, long );
00209 int WINAPI glEmptyFunc20( long, long, long, long, long );
00210 int WINAPI glEmptyFunc24( long, long, long, long, long, long );
00211 int WINAPI glEmptyFunc28( long, long, long, long, long, long, long );
00212 int WINAPI glEmptyFunc32( long, long, long, long, long, long, long, long );
00213 int WINAPI glEmptyFunc36( long, long, long, long, long, long, long, long,
00214                            long );
00215 int WINAPI glEmptyFunc40( long, long, long, long, long, long, long, long,
00216                            long, long );
00217 int WINAPI glEmptyFunc44( long, long, long, long, long, long, long, long,
00218                            long, long, long );
00219 int WINAPI glEmptyFunc48( long, long, long, long, long, long, long, long,
00220                            long, long, long, long );
00221 int WINAPI glEmptyFunc52( long, long, long, long, long, long, long, long,
00222                            long, long, long, long, long );
00223 int WINAPI glEmptyFunc56( long, long, long, long, long, long, long, long,
00224                            long, long, long, long, long, long );
00225 
00226 #ifdef OPENGL32_GL_FUNC_PROTOTYPES
00227 
00228 #define X(func,ret,typeargs,args,icdidx,tebidx,stack) ret WINAPI func typeargs;
00229 GLFUNCS_MACRO
00230 #undef X
00231 
00232 #endif /* OPENGL32_GL_FUNC_PROTOTYPES */
00233 
00234 #ifdef __cplusplus
00235 }; /* extern "C" */
00236 #endif /* __cplusplus */
00237 
00238 #endif /* OPENGL32_PRIVATE_H */
00239 
00240 /* EOF */

Generated on Sun May 27 2012 04:25:51 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.