aboutsummaryrefslogtreecommitdiffstats
path: root/make/stub_includes/win32/wingdi.h
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-01-09 03:51:35 +0100
committerSven Gothel <[email protected]>2012-01-09 03:51:35 +0100
commitc49d29784986b1945343b9a90b5e0c9f3d95d937 (patch)
tree96f7b12b4e230555b199235a7981ff82e3203f37 /make/stub_includes/win32/wingdi.h
parent9e61d4529143ff3f6de15ce55f8e8747f67a86c9 (diff)
Dispatch the '5' GDI/WGL functions and allow using their 'wgl' variants. GDI is the default.
The following 5 GDI functions have their 'wgl' counterparts which 'shall' being used in case the OpenGL DLL is being loaded dynamically. (So reads the documentation & FAQ). This seems to be required only in case the std. opengl32.dll is not being used. This use case is called GDI/ICD. If using a non std. OpenGL DLL, is called MCD. We dynamically load the OpenGL DLL and fetch the address pointer. Since we generally use the std. opengl32.dll, our use of the GDI callbacks seems to be legal. However, to test using the 'wgl' method WGLUtil is introduced. You can test using the 'wgl' variants by defining the property: 'jogl.windows.useWGLVersionOf5WGLGDIFuncSet'. In case you have troubles, ie crashes within pixelformat setup etc, it might be interesting if this may impact your behavior. - ChoosePixelFormat(long, PIXELFORMATDESCRIPTOR) - DescribePixelFormat(long, int, int, PIXELFORMATDESCRIPTOR) - GetPixelFormat(long) - SetPixelFormat(long, int, PIXELFORMATDESCRIPTOR) - SwapBuffers(long)
Diffstat (limited to 'make/stub_includes/win32/wingdi.h')
-rw-r--r--make/stub_includes/win32/wingdi.h165
1 files changed, 6 insertions, 159 deletions
diff --git a/make/stub_includes/win32/wingdi.h b/make/stub_includes/win32/wingdi.h
index b02512cfd..2d3e33275 100644
--- a/make/stub_includes/win32/wingdi.h
+++ b/make/stub_includes/win32/wingdi.h
@@ -6,177 +6,24 @@
* This file has no copyright assigned and is placed in the Public Domain.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*
- * Editions / Removals and a split (wingdi.h -> wingdi.h + winwgl.h) were made by the JogAmp Community, 2010
+ * Editions / Removals and a split (wingdi.h -> wingdi.h + wingdi_types.h + winwgl.h) were made by the JogAmp Community, 2010, 2012
*/
-#ifndef WGL_GDI_VERSION_1_X
+#include "wingdi_types.h"
-typedef struct tagRGBQUAD {
- BYTE rgbBlue;
- BYTE rgbGreen;
- BYTE rgbRed;
- BYTE rgbReserved;
-} RGBQUAD;
-
-typedef RGBQUAD *LPRGBQUAD;
-
-typedef struct tagBITMAPINFOHEADER {
- DWORD biSize;
- LONG biWidth;
- LONG biHeight;
- WORD biPlanes;
- WORD biBitCount;
- DWORD biCompression;
- DWORD biSizeImage;
- LONG biXPelsPerMeter;
- LONG biYPelsPerMeter;
- DWORD biClrUsed;
- DWORD biClrImportant;
-} BITMAPINFOHEADER,*LPBITMAPINFOHEADER,*PBITMAPINFOHEADER;
-
-typedef struct tagBITMAPINFO {
- BITMAPINFOHEADER bmiHeader;
- RGBQUAD bmiColors[1];
-} BITMAPINFO,*LPBITMAPINFO,*PBITMAPINFO;
-
-/* constants for the biCompression field */
-#define BI_RGB 0
-#define BI_RLE8 1
-#define BI_RLE4 2
-#define BI_BITFIELDS 3
-
-/* DIB color table identifiers */
-
-#define DIB_RGB_COLORS 0 /* color table in RGBs */
-#define DIB_PAL_COLORS 1 /* color table in palette indices */
-
-typedef struct tagPIXELFORMATDESCRIPTOR {
- WORD nSize;
- WORD nVersion;
- DWORD dwFlags;
- BYTE iPixelType;
- BYTE cColorBits;
- BYTE cRedBits;
- BYTE cRedShift;
- BYTE cGreenBits;
- BYTE cGreenShift;
- BYTE cBlueBits;
- BYTE cBlueShift;
- BYTE cAlphaBits;
- BYTE cAlphaShift;
- BYTE cAccumBits;
- BYTE cAccumRedBits;
- BYTE cAccumGreenBits;
- BYTE cAccumBlueBits;
- BYTE cAccumAlphaBits;
- BYTE cDepthBits;
- BYTE cStencilBits;
- BYTE cAuxBuffers;
- BYTE iLayerType;
- BYTE bReserved;
- DWORD dwLayerMask;
- DWORD dwVisibleMask;
- DWORD dwDamageMask;
-} PIXELFORMATDESCRIPTOR,*PPIXELFORMATDESCRIPTOR,*LPPIXELFORMATDESCRIPTOR;
-
-#define PFD_TYPE_RGBA 0
-#define PFD_TYPE_COLORINDEX 1
-
-#define PFD_MAIN_PLANE 0
-#define PFD_OVERLAY_PLANE 1
-#define PFD_UNDERLAY_PLANE (-1)
-
-#define PFD_DOUBLEBUFFER 0x00000001
-#define PFD_STEREO 0x00000002
-#define PFD_DRAW_TO_WINDOW 0x00000004
-#define PFD_DRAW_TO_BITMAP 0x00000008
-#define PFD_SUPPORT_GDI 0x00000010
-#define PFD_SUPPORT_OPENGL 0x00000020
-#define PFD_GENERIC_FORMAT 0x00000040
-#define PFD_NEED_PALETTE 0x00000080
-#define PFD_NEED_SYSTEM_PALETTE 0x00000100
-#define PFD_SWAP_EXCHANGE 0x00000200
-#define PFD_SWAP_COPY 0x00000400
-#define PFD_SWAP_LAYER_BUFFERS 0x00000800
-#define PFD_GENERIC_ACCELERATED 0x00001000
-#define PFD_SUPPORT_DIRECTDRAW 0x00002000
-
-#define PFD_DEPTH_DONTCARE 0x20000000
-#define PFD_DOUBLEBUFFER_DONTCARE 0x40000000
-#define PFD_STEREO_DONTCARE 0x80000000
-
-/* error codes (from winerror.h) */
-/* FIXME: these should have a trailing "L" but apparently PCPP doesn't handle that syntax */
-#define ERROR_SUCCESS 0
-#define ERROR_INVALID_PIXEL_FORMAT 2000
-#define ERROR_NO_SYSTEM_RESOURCES 1450
-#define ERROR_INVALID_DATA 13
-#define ERROR_PROC_NOT_FOUND 127
-#define ERROR_INVALID_WINDOW_HANDLE 1400
-
-/*
- * ShowWindow() Commands
- */
-#define SW_HIDE 0
-#define SW_SHOWNORMAL 1
-#define SW_NORMAL 1
-#define SW_SHOWMINIMIZED 2
-#define SW_SHOWMAXIMIZED 3
-#define SW_MAXIMIZE 3
-#define SW_SHOWNOACTIVATE 4
-#define SW_SHOW 5
-#define SW_MINIMIZE 6
-#define SW_SHOWMINNOACTIVE 7
-#define SW_SHOWNA 8
-#define SW_RESTORE 9
-#define SW_SHOWDEFAULT 10
-#define SW_FORCEMINIMIZE 11
-#define SW_MAX 11
-
-/**
- * GetObjectType() Command
- */
-#define OBJ_PEN 1
-#define OBJ_BRUSH 2
-#define OBJ_DC 3
-#define OBJ_METADC 4
-#define OBJ_PAL 5
-#define OBJ_FONT 6
-#define OBJ_BITMAP 7
-#define OBJ_REGION 8
-#define OBJ_METAFILE 9
-#define OBJ_MEMDC 10
-#define OBJ_EXTPEN 11
-#define OBJ_ENHMETADC 12
-#define OBJ_ENHMETAFILE 13
-#define OBJ_COLORSPACE 14
-
-#endif /* WGL_GDI_VERSION_1_X */
-
-#ifndef WGL_GDI_VERSION_1_X
-#define WGL_GDI_VERSION_1_X
+#ifndef GDI_VERSION_1_X
+#define GDI_VERSION_1_X
// Windows routines
WINBASEAPI DWORD WINAPI GetLastError(VOID);
-// OpenGL-related routines
+// GDI / ICD OpenGL-related routines
WINGDIAPI int WINAPI ChoosePixelFormat(HDC, CONST PIXELFORMATDESCRIPTOR *);
WINGDIAPI int WINAPI DescribePixelFormat(HDC, int, UINT, LPPIXELFORMATDESCRIPTOR);
WINGDIAPI int WINAPI GetPixelFormat(HDC);
WINGDIAPI BOOL WINAPI SetPixelFormat(HDC, int, CONST PIXELFORMATDESCRIPTOR *);
WINGDIAPI BOOL WINAPI SwapBuffers(HDC);
-/* --- FIXME: need to handle these entry points!
-WINGDIAPI HGLRC WINAPI wglCreateLayerContext(HDC, int);
-WINGDIAPI BOOL WINAPI wglUseFontBitmapsA(HDC, DWORD, DWORD, DWORD);
-WINGDIAPI BOOL WINAPI wglUseFontBitmapsW(HDC, DWORD, DWORD, DWORD);
-#ifdef UNICODE
-#define wglUseFontBitmaps wglUseFontBitmapsW
-#else
-#define wglUseFontBitmaps wglUseFontBitmapsA
-#endif // !UNICODE
-*/
-
// Routines related to bitmap creation for off-screen rendering
WINGDIAPI HDC WINAPI CreateCompatibleDC(HDC);
WINGDIAPI HBITMAP WINAPI CreateDIBSection(HDC, CONST BITMAPINFO *, UINT, VOID **, HANDLE, DWORD);
@@ -207,5 +54,5 @@ WINUSERAPI BOOL WINAPI SetProcessAffinityMask(HANDLE hProcess,DWORD_PTR dwProces
WINGDIAPI BOOL WINAPI GetDeviceGammaRamp(HDC,LPVOID);
WINGDIAPI BOOL WINAPI SetDeviceGammaRamp(HDC,LPVOID);
-#endif /* WGL_GDI_VERSION_1_X */
+#endif /* GDI_VERSION_1_X */