1 /****************************************************************************
3 * Mesa 3-D graphics library
4 * Direct3D Driver Interface
6 * ========================================================================
8 * Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
10 * Permission is hereby granted, free of charge, to any person obtaining a
11 * copy of this software and associated documentation files (the "Software"),
12 * to deal in the Software without restriction, including without limitation
13 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 * and/or sell copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following conditions:
17 * The above copyright notice and this permission notice shall be included
18 * in all copies or substantial portions of the Software.
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
24 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
25 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28 * ======================================================================
31 * Environment: Windows 9x (Win32)
33 * Description: OpenGL window functions (wgl*).
35 ****************************************************************************/
40 // Disable compiler complaints about DLL linkage
41 #pragma warning (disable:4273)
43 // Macros to control compilation
45 #define WIN32_LEAN_AND_MEAN
50 #include "dglcontext.h"
51 #include "dglglobals.h"
52 #include "dglmacros.h"
56 /*---------------------- Macros and type definitions ----------------------*/
64 /* XXX why is this here?
65 * It should probaby be somewhere in src/mesa/drivers/windows/
67 #if defined(_WIN32) && !defined(_WINGDI_) && !defined(_WINGDI_H) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(BUILD_FOR_SNAP)
68 # define WGL_FONT_LINES 0
69 # define WGL_FONT_POLYGONS 1
70 #ifndef _GNU_H_WINDOWS32_FUNCTIONS
72 # define wglUseFontBitmaps wglUseFontBitmapsW
73 # define wglUseFontOutlines wglUseFontOutlinesW
75 # define wglUseFontBitmaps wglUseFontBitmapsA
76 # define wglUseFontOutlines wglUseFontOutlinesA
77 # endif /* !UNICODE */
78 #endif /* _GNU_H_WINDOWS32_FUNCTIONS */
79 typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR
, *PLAYERPLANEDESCRIPTOR
, *LPLAYERPLANEDESCRIPTOR
;
80 typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT
, *PGLYPHMETRICSFLOAT
, *LPGLYPHMETRICSFLOAT
;
81 typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR
, *PPIXELFORMATDESCRIPTOR
, *LPPIXELFORMATDESCRIPTOR
;
82 #if !defined(GLX_USE_MESA)
83 #include <GL/mesa_wgl.h>
86 #endif /* !__MINGW32__ */
88 /*------------------------- Function Prototypes ---------------------------*/
95 int APIENTRY
DGL_ChoosePixelFormat(HDC a
, CONST PIXELFORMATDESCRIPTOR
*ppfd
);
96 BOOL APIENTRY
DGL_CopyContext(HGLRC a
, HGLRC b
, UINT c
);
97 HGLRC APIENTRY
DGL_CreateContext(HDC a
);
98 HGLRC APIENTRY
DGL_CreateLayerContext(HDC a
, int b
);
99 BOOL APIENTRY
DGL_DeleteContext(HGLRC a
);
100 BOOL APIENTRY
DGL_DescribeLayerPlane(HDC a
, int b
, int c
, UINT d
, LPLAYERPLANEDESCRIPTOR e
);
101 int APIENTRY
DGL_DescribePixelFormat(HDC a
, int b
, UINT c
, LPPIXELFORMATDESCRIPTOR d
);
102 HGLRC APIENTRY
DGL_GetCurrentContext(void);
103 HDC APIENTRY
DGL_GetCurrentDC(void);
104 PROC APIENTRY
DGL_GetDefaultProcAddress(LPCSTR a
);
105 int APIENTRY
DGL_GetLayerPaletteEntries(HDC a
, int b
, int c
, int d
, COLORREF
*e
);
106 int APIENTRY
DGL_GetPixelFormat(HDC a
);
107 PROC APIENTRY
DGL_GetProcAddress(LPCSTR a
);
108 BOOL APIENTRY
DGL_MakeCurrent(HDC a
, HGLRC b
);
109 BOOL APIENTRY
DGL_RealizeLayerPalette(HDC a
, int b
, BOOL c
);
110 int APIENTRY
DGL_SetLayerPaletteEntries(HDC a
, int b
, int c
, int d
, CONST COLORREF
*e
);
111 BOOL APIENTRY
DGL_SetPixelFormat(HDC a
, int b
, CONST PIXELFORMATDESCRIPTOR
*c
);
112 BOOL APIENTRY
DGL_ShareLists(HGLRC a
, HGLRC b
);
113 BOOL APIENTRY
DGL_SwapBuffers(HDC a
);
114 BOOL APIENTRY
DGL_SwapLayerBuffers(HDC a
, UINT b
);
115 BOOL APIENTRY
DGL_UseFontBitmapsA(HDC a
, DWORD b
, DWORD c
, DWORD d
);
116 BOOL APIENTRY
DGL_UseFontBitmapsW(HDC a
, DWORD b
, DWORD c
, DWORD d
);
117 BOOL APIENTRY
DGL_UseFontOutlinesA(HDC a
, DWORD b
, DWORD c
, DWORD d
, FLOAT e
, FLOAT f
, int g
, LPGLYPHMETRICSFLOAT h
);
118 BOOL APIENTRY
DGL_UseFontOutlinesW(HDC a
, DWORD b
, DWORD c
, DWORD d
, FLOAT e
, FLOAT f
, int g
, LPGLYPHMETRICSFLOAT h
);
119 #endif //_USE_GLD3_WGL
121 BOOL
dglWglResizeBuffers(struct gl_context
*ctx
, BOOL bDefaultDriver
);