aboutsummaryrefslogtreecommitdiffstats
path: root/make/stub_includes/win32
diff options
context:
space:
mode:
authordjp <[email protected]>2003-06-08 19:27:01 +0000
committerdjp <[email protected]>2003-06-08 19:27:01 +0000
commitd49fd968963909f181423eae46c613189468fac3 (patch)
treeb231329e6b65fd54aa24b3bcc0a3ecc623daec61 /make/stub_includes/win32
parent9c8fb046dee5d832bea3f36dcbd43285054f49a0 (diff)
Initial revision
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@3 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'make/stub_includes/win32')
-rw-r--r--make/stub_includes/win32/cg.c26
-rw-r--r--make/stub_includes/win32/gl-impl.c22
-rw-r--r--make/stub_includes/win32/gl.c9
-rw-r--r--make/stub_includes/win32/glu-impl.c3
-rw-r--r--make/stub_includes/win32/glu.c2
-rw-r--r--make/stub_includes/win32/jni.h78
-rw-r--r--make/stub_includes/win32/jni_md.h10
-rw-r--r--make/stub_includes/win32/window-system.c2
-rw-r--r--make/stub_includes/win32/windows.h37
-rw-r--r--make/stub_includes/win32/wingdi.h151
10 files changed, 340 insertions, 0 deletions
diff --git a/make/stub_includes/win32/cg.c b/make/stub_includes/win32/cg.c
new file mode 100644
index 000000000..98c824285
--- /dev/null
+++ b/make/stub_includes/win32/cg.c
@@ -0,0 +1,26 @@
+// Define __gl_h_ so that GL/gl.h doesn't get bound as part of CgGL.java
+// because cgGL.h tries to include it
+#define __gl_h_
+
+// Define some types so that cgGL.h has the types it expected to get by
+// including GL/gl.h (which we disabled above)
+typedef unsigned int GLenum;
+typedef unsigned char GLboolean;
+typedef unsigned int GLbitfield;
+typedef void GLvoid;
+typedef signed char GLbyte; /* 1-byte signed */
+typedef short GLshort; /* 2-byte signed */
+typedef int GLint; /* 4-byte signed */
+typedef unsigned char GLubyte; /* 1-byte unsigned */
+typedef unsigned short GLushort; /* 2-byte unsigned */
+typedef unsigned int GLuint; /* 4-byte unsigned */
+typedef int GLsizei; /* 4-byte signed */
+typedef float GLfloat; /* single precision float */
+typedef float GLclampf; /* single precision float in [0,1] */
+typedef double GLdouble; /* double precision float */
+typedef double GLclampd; /* double precision float in [0,1] */
+
+#define CGDLL_API
+#include <CG/cgGL.h>
+
+
diff --git a/make/stub_includes/win32/gl-impl.c b/make/stub_includes/win32/gl-impl.c
new file mode 100644
index 000000000..d5dbf11ce
--- /dev/null
+++ b/make/stub_includes/win32/gl-impl.c
@@ -0,0 +1,22 @@
+#include <windows.h>
+#define GLAPI
+
+// Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in
+// "glext.h" are parsed.
+#define GL_GLEXT_PROTOTYPES
+
+#include <GL/gl.h>
+
+// Define WGL_GLEXT_PROTOTYPES so that the OpenGL WGL extension prototypes in
+// "wglext.h" are parsed.
+#define WGL_WGLEXT_PROTOTYPES
+#define SKIP_WGL_HANDLE_DEFINITIONS
+
+#include <GL/wglext.h>
+
+// Generate unimplemented stubs for glX extensions
+#define GLX_GLXEXT_PROTOTYPES
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <GL/glxext.h>
+
diff --git a/make/stub_includes/win32/gl.c b/make/stub_includes/win32/gl.c
new file mode 100644
index 000000000..76b7a3220
--- /dev/null
+++ b/make/stub_includes/win32/gl.c
@@ -0,0 +1,9 @@
+#include <windows.h>
+#define GLAPI
+
+// Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in
+// "glext.h" are parsed.
+#define GL_GLEXT_PROTOTYPES
+
+#include <GL/gl.h>
+
diff --git a/make/stub_includes/win32/glu-impl.c b/make/stub_includes/win32/glu-impl.c
new file mode 100644
index 000000000..2328639d8
--- /dev/null
+++ b/make/stub_includes/win32/glu-impl.c
@@ -0,0 +1,3 @@
+#include <GL/glu.h>
+
+
diff --git a/make/stub_includes/win32/glu.c b/make/stub_includes/win32/glu.c
new file mode 100644
index 000000000..91020e365
--- /dev/null
+++ b/make/stub_includes/win32/glu.c
@@ -0,0 +1,2 @@
+#include <GL/glu.h>
+
diff --git a/make/stub_includes/win32/jni.h b/make/stub_includes/win32/jni.h
new file mode 100644
index 000000000..be01d0187
--- /dev/null
+++ b/make/stub_includes/win32/jni.h
@@ -0,0 +1,78 @@
+/* Stub header for JNI which provides needed declarations without more
+ complicated and unnecessary constructs */
+
+/*
+ * JNI Types
+ */
+
+#include "jni_md.h"
+
+typedef unsigned char jboolean;
+typedef unsigned short jchar;
+typedef short jshort;
+typedef float jfloat;
+typedef double jdouble;
+
+typedef jint jsize;
+
+struct _jobject;
+
+typedef struct _jobject *jobject;
+typedef jobject jclass;
+typedef jobject jthrowable;
+typedef jobject jstring;
+typedef jobject jarray;
+typedef jarray jbooleanArray;
+typedef jarray jbyteArray;
+typedef jarray jcharArray;
+typedef jarray jshortArray;
+typedef jarray jintArray;
+typedef jarray jlongArray;
+typedef jarray jfloatArray;
+typedef jarray jdoubleArray;
+typedef jarray jobjectArray;
+typedef jobject jweak;
+
+typedef union jvalue {
+ jboolean z;
+ jbyte b;
+ jchar c;
+ jshort s;
+ jint i;
+ jlong j;
+ jfloat f;
+ jdouble d;
+ jobject l;
+} jvalue;
+
+struct _jfieldID;
+typedef struct _jfieldID *jfieldID;
+
+struct _jmethodID;
+typedef struct _jmethodID *jmethodID;
+
+/*
+ * jboolean constants
+ */
+
+#define JNI_FALSE 0
+#define JNI_TRUE 1
+
+/*
+ * possible return values for JNI functions.
+ */
+
+#define JNI_OK 0 /* success */
+#define JNI_ERR (-1) /* unknown error */
+#define JNI_EDETACHED (-2) /* thread detached from the VM */
+#define JNI_EVERSION (-3) /* JNI version error */
+#define JNI_ENOMEM (-4) /* not enough memory */
+#define JNI_EEXIST (-5) /* VM already created */
+#define JNI_EINVAL (-6) /* invalid arguments */
+
+/*
+ * used in ReleaseScalarArrayElements
+ */
+
+#define JNI_COMMIT 1
+#define JNI_ABORT 2
diff --git a/make/stub_includes/win32/jni_md.h b/make/stub_includes/win32/jni_md.h
new file mode 100644
index 000000000..c2ccd0d45
--- /dev/null
+++ b/make/stub_includes/win32/jni_md.h
@@ -0,0 +1,10 @@
+#define _JNI_IMPORT_OR_EXPORT_
+#define JNIEXPORT
+#define JNIIMPORT
+#define JNICALL
+
+typedef long jint;
+typedef __int64 jlong;
+typedef signed char jbyte;
+
+typedef long JNIEnv;
diff --git a/make/stub_includes/win32/window-system.c b/make/stub_includes/win32/window-system.c
new file mode 100644
index 000000000..c5c5d37b9
--- /dev/null
+++ b/make/stub_includes/win32/window-system.c
@@ -0,0 +1,2 @@
+#include <windows.h>
+#include <wingdi.h>
diff --git a/make/stub_includes/win32/windows.h b/make/stub_includes/win32/windows.h
new file mode 100644
index 000000000..24b9df4fa
--- /dev/null
+++ b/make/stub_includes/win32/windows.h
@@ -0,0 +1,37 @@
+/* Windows #defines and typedefs required for processing of extracts
+ from WINGDI.H and jawt_md.h */
+
+#define FAR
+#define WINBASEAPI
+#define WINGDIAPI
+#define WINAPI
+#define APIENTRY
+#define CONST const
+#define VOID void
+typedef int BOOL;
+typedef unsigned char BYTE;
+typedef unsigned long DWORD;
+typedef int INT;
+typedef int INT32;
+typedef __int64 INT64;
+typedef float FLOAT;
+typedef struct _handle* HANDLE;
+typedef HANDLE HBITMAP;
+typedef HANDLE HDC;
+typedef HANDLE HGDIOBJ;
+typedef HANDLE HGLRC;
+typedef HANDLE HPALETTE;
+typedef HANDLE HWND;
+typedef long LONG;
+typedef const char* LPCSTR;
+typedef void* LPVOID;
+typedef struct _proc* PROC;
+typedef unsigned int* PUINT;
+typedef unsigned int UINT;
+typedef unsigned short USHORT;
+typedef unsigned short WORD;
+
+/* Necessary handle typedefs for parsing wglext.h */
+
+typedef HANDLE HPBUFFERARB;
+typedef HANDLE HPBUFFEREXT;
diff --git a/make/stub_includes/win32/wingdi.h b/make/stub_includes/win32/wingdi.h
new file mode 100644
index 000000000..5365a8990
--- /dev/null
+++ b/make/stub_includes/win32/wingdi.h
@@ -0,0 +1,151 @@
+/*
+ * Essential wgl and supporting routines and data structures extracted
+ * from WINGDI.H.
+ *
+ * Copyright (c) 1985-1997, Microsoft Corp. All rights reserved.
+ *
+ */
+
+typedef struct tagRGBQUAD {
+ BYTE rgbBlue;
+ BYTE rgbGreen;
+ BYTE rgbRed;
+ BYTE rgbReserved;
+} RGBQUAD;
+typedef RGBQUAD FAR* 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, FAR *LPBITMAPINFOHEADER, *PBITMAPINFOHEADER;
+
+typedef struct tagBITMAPINFO {
+ BITMAPINFOHEADER bmiHeader;
+ RGBQUAD bmiColors[1];
+} BITMAPINFO, FAR *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 */
+
+/* Pixel format descriptor */
+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, FAR *LPPIXELFORMATDESCRIPTOR;
+
+/* pixel types */
+#define PFD_TYPE_RGBA 0
+#define PFD_TYPE_COLORINDEX 1
+
+/* layer types */
+#define PFD_MAIN_PLANE 0
+#define PFD_OVERLAY_PLANE 1
+#define PFD_UNDERLAY_PLANE (-1)
+
+/* PIXELFORMATDESCRIPTOR flags */
+#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
+
+/* PIXELFORMATDESCRIPTOR flags for use in ChoosePixelFormat only */
+#define PFD_DEPTH_DONTCARE 0x20000000
+#define PFD_DOUBLEBUFFER_DONTCARE 0x40000000
+#define PFD_STEREO_DONTCARE 0x80000000
+
+/* OpenGL error codes (from winerror.h) */
+/* FIXME: these should have a trailing "L" but apparently PCPP doesn't handle that syntax */
+#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
+
+// Windows routines
+WINBASEAPI DWORD WINAPI GetLastError(VOID);
+
+// 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 wglCopyContext(HGLRC, HGLRC, UINT);
+WINGDIAPI HGLRC WINAPI wglCreateContext(HDC);
+WINGDIAPI BOOL WINAPI wglDeleteContext(HGLRC);
+WINGDIAPI HGLRC WINAPI wglGetCurrentContext(VOID);
+WINGDIAPI HDC WINAPI wglGetCurrentDC(VOID);
+WINGDIAPI BOOL WINAPI wglMakeCurrent(HDC, HGLRC);
+WINGDIAPI BOOL WINAPI wglShareLists(HGLRC, HGLRC);
+WINGDIAPI BOOL WINAPI SwapBuffers(HDC);
+WINGDIAPI PROC WINAPI wglGetProcAddress(LPCSTR);
+
+/* --- 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);
+WINGDIAPI BOOL WINAPI DeleteDC(HDC);
+WINGDIAPI BOOL WINAPI DeleteObject(HGDIOBJ);
+WINGDIAPI HGDIOBJ WINAPI SelectObject(HDC, HGDIOBJ);
+