aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin')
-rw-r--r--xorg-server/hw/xwin/glx/Makefile.am34
-rw-r--r--xorg-server/hw/xwin/glx/wgl_ext_api.c160
-rw-r--r--xorg-server/hw/xwin/glx/wgl_ext_api.h174
3 files changed, 174 insertions, 194 deletions
diff --git a/xorg-server/hw/xwin/glx/Makefile.am b/xorg-server/hw/xwin/glx/Makefile.am
index 94ebbb828..61463f635 100644
--- a/xorg-server/hw/xwin/glx/Makefile.am
+++ b/xorg-server/hw/xwin/glx/Makefile.am
@@ -25,36 +25,16 @@ AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \
-I$(top_srcdir) \
-I$(top_srcdir)/hw/xwin/
-glwrap.c: generated_gl_wrappers.c
-wgl_ext_api.c: generated_wgl_wrappers.c wglext.h
-wgl_ext_api.h: wglext.h
-indirect.c: wgl_ext_api.h
+if XWIN_GLX_WINDOWS
-SPEC_FILES = gl.spec gl.tm wglext.spec wgl.tm
+generated_gl_wrappers.c: gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.spec $(KHRONOS_SPEC_DIR)/gl.tm
+ $(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/gl.spec --typemap=$(KHRONOS_SPEC_DIR)/gl.tm --dispatch-header=$(top_srcdir)/glx/dispatch.h --staticwrappers >generated_gl_wrappers.c
-gl.spec:
- wget http://www.opengl.org/registry/api/gl.spec
-
-gl.tm:
- wget http://www.opengl.org/registry/api/gl.tm
-
-wglext.spec:
- wget http://www.opengl.org/registry/api/wglext.spec
-
-wgl.tm:
- wget http://www.opengl.org/registry/api/wgl.tm
-
-generated_gl_wrappers.c: gen_gl_wrappers.py gl.spec gl.tm
- $(srcdir)/gen_gl_wrappers.py --spec=`test -e gl.spec || echo $(srcdir)/`gl.spec --typemap=`test -e gl.tm || echo $(srcdir)/`gl.tm --dispatch-header=$(top_srcdir)/glx/dispatch.h --staticwrappers >generated_gl_wrappers.c
-
-generated_wgl_wrappers.c: gen_gl_wrappers.py wglext.spec wgl.tm
- $(srcdir)/gen_gl_wrappers.py --spec=`test -e wglext.spec || echo $(srcdir)/`wglext.spec --typemap=`test -e wgl.tm || echo $(srcdir)/`wgl.tm --prefix=wgl --preresolve >generated_wgl_wrappers.c
-
-wglext.h:
- wget http://www.opengl.org/registry/api/wglext.h
+generated_wgl_wrappers.c: gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/wglext.spec $(KHRONOS_SPEC_DIR)/wgl.tm
+ $(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/wglext.spec --typemap=$(KHRONOS_SPEC_DIR)/wgl.tm --prefix=wgl --preresolve >generated_wgl_wrappers.c
+endif
BUILT_SOURCES = generated_gl_wrappers.c generated_wgl_wrappers.c
CLEANFILES = $(BUILT_SOURCES)
-DISTCLEANFILES = $(SPEC_FILES) wglext.h
-EXTRA_DIST = gen_gl_wrappers.py $(SPEC_FILES) wglext.h
+EXTRA_DIST = gen_gl_wrappers.py
diff --git a/xorg-server/hw/xwin/glx/wgl_ext_api.c b/xorg-server/hw/xwin/glx/wgl_ext_api.c
index 984ce64a2..1d6abcc63 100644
--- a/xorg-server/hw/xwin/glx/wgl_ext_api.c
+++ b/xorg-server/hw/xwin/glx/wgl_ext_api.c
@@ -1,80 +1,80 @@
-/*
- * File: wgl_ext_api.c
- * Purpose: Wrapper functions for Win32 OpenGL wgl extension functions
- *
- * Authors: Jon TURNEY
- *
- * Copyright (c) Jon TURNEY 2009
- *
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifdef HAVE_XWIN_CONFIG_H
-#include <xwin-config.h>
-#endif
-
-#include <X11/Xwindows.h>
-#include <GL/gl.h>
-#include <GL/glext.h>
-#include <glx/glxserver.h>
-#include <glx/glxext.h>
-#include "wglext.h"
-#include <wgl_ext_api.h>
-#include "glwindows.h"
-
-#define RESOLVE_DECL(type) \
- static type type##proc = NULL;
-
-#ifdef _DEBUG
-#define PRERESOLVE(type, symbol) \
- type##proc = (type)wglGetProcAddress(symbol); \
- if (type##proc == NULL) \
- ErrorF("wglwrap: Can't resolve \"%s\"\n", symbol); \
- else \
- ErrorF("wglwrap: Resolved \"%s\"\n", symbol);
-#else
-#define PRERESOLVE(type, symbol) \
- type##proc = (type)wglGetProcAddress(symbol);
-#endif
-
-#define RESOLVE_RET(type, symbol, retval) \
- if (type##proc == NULL) { \
- __glXErrorCallBack(0); \
- return retval; \
- }
-
-#define RESOLVE(procname, symbol) RESOLVE_RET(procname, symbol,)
-
-#define RESOLVED_PROC(type) type##proc
-
-/*
- * Include generated cdecl wrappers for stdcall WGL functions
- *
- * There are extensions to the wgl*() API as well; again we call
- * these functions by using wglGetProcAddress() to get a pointer
- * to the function, and wrapping it for cdecl/stdcall conversion
- *
- * We arrange to resolve the functions up front, as they need a
- * context to work, as we like to use them to be able to select
- * a context. Again, this assumption fails badly on multimontor
- * systems...
- */
-
-#include "generated_wgl_wrappers.c"
+/*
+ * File: wgl_ext_api.c
+ * Purpose: Wrapper functions for Win32 OpenGL wgl extension functions
+ *
+ * Authors: Jon TURNEY
+ *
+ * Copyright (c) Jon TURNEY 2009
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+
+#include <X11/Xwindows.h>
+#include <GL/gl.h>
+#include <GL/glext.h>
+#include <glx/glxserver.h>
+#include <glx/glxext.h>
+#include "wglext.h"
+#include <wgl_ext_api.h>
+#include "glwindows.h"
+
+#define RESOLVE_DECL(type) \
+ static type type##proc = NULL;
+
+#ifdef _DEBUG
+#define PRERESOLVE(type, symbol) \
+ type##proc = (type)wglGetProcAddress(symbol); \
+ if (type##proc == NULL) \
+ ErrorF("wglwrap: Can't resolve \"%s\"\n", symbol); \
+ else \
+ ErrorF("wglwrap: Resolved \"%s\"\n", symbol);
+#else
+#define PRERESOLVE(type, symbol) \
+ type##proc = (type)wglGetProcAddress(symbol);
+#endif
+
+#define RESOLVE_RET(type, symbol, retval) \
+ if (type##proc == NULL) { \
+ __glXErrorCallBack(0); \
+ return retval; \
+ }
+
+#define RESOLVE(procname, symbol) RESOLVE_RET(procname, symbol,)
+
+#define RESOLVED_PROC(type) type##proc
+
+/*
+ * Include generated cdecl wrappers for stdcall WGL functions
+ *
+ * There are extensions to the wgl*() API as well; again we call
+ * these functions by using wglGetProcAddress() to get a pointer
+ * to the function, and wrapping it for cdecl/stdcall conversion
+ *
+ * We arrange to resolve the functions up front, as they need a
+ * context to work, as we like to use them to be able to select
+ * a context. Again, this assumption fails badly on multimontor
+ * systems...
+ */
+
+#include "generated_wgl_wrappers.c"
diff --git a/xorg-server/hw/xwin/glx/wgl_ext_api.h b/xorg-server/hw/xwin/glx/wgl_ext_api.h
index 3c46d1d30..0edc6e6ed 100644
--- a/xorg-server/hw/xwin/glx/wgl_ext_api.h
+++ b/xorg-server/hw/xwin/glx/wgl_ext_api.h
@@ -1,87 +1,87 @@
-/*
- * File: wgl_ext_api.h
- * Purpose: Wrapper functions for Win32 OpenGL wgl extension functions
- *
- * Authors: Jon TURNEY
- *
- * Copyright (c) Jon TURNEY 2009
- *
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef wgl_ext_api_h
-#define wgl_ext_api_h
-
-#include "wglext.h"
-
-void wglResolveExtensionProcs(void);
-
-/*
- Prototypes for wrapper functions we actually use
- XXX: should be automatically generated as well
-*/
-
-const char * __stdcall wglGetExtensionsStringARBWrapper(HDC hdc);
-BOOL __stdcall wglMakeContextCurrentARBWrapper(HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
-HDC __stdcall wglGetCurrentReadDCARBWrapper(VOID);
-
-BOOL __stdcall wglGetPixelFormatAttribivARBWrapper(HDC hdc,
- int iPixelFormat,
- int iLayerPlane,
- UINT nAttributes,
- const int *piAttributes,
- int *piValues);
-
-BOOL __stdcall wglGetPixelFormatAttribfvARBWrapper(HDC hdc,
- int iPixelFormat,
- int iLayerPlane,
- UINT nAttributes,
- const int *piAttributes,
- FLOAT *pfValues);
-
-BOOL __stdcall wglChoosePixelFormatARBWrapper(HDC hdc,
- const int *piAttribIList,
- const FLOAT *pfAttribFList,
- UINT nMaxFormats,
- int *piFormats,
- UINT *nNumFormats);
-
-HPBUFFERARB __stdcall wglCreatePbufferARBWrapper(HDC hDC,
- int iPixelFormat,
- int iWidth,
- int iHeight,
- const int *piAttribList);
-
-HDC __stdcall wglGetPbufferDCARBWrapper(HPBUFFERARB hPbuffer);
-
-int __stdcall wglReleasePbufferDCARBWrapper(HPBUFFERARB hPbuffer,
- HDC hDC);
-
-BOOL __stdcall wglDestroyPbufferARBWrapper(HPBUFFERARB hPbuffer);
-
-BOOL __stdcall wglQueryPbufferARBWrapper(HPBUFFERARB hPbuffer,
- int iAttribute,
- int *piValue);
-
-BOOL __stdcall wglSwapIntervalEXTWrapper(int interval);
-
-int __stdcall wglGetSwapIntervalEXTWrapper(void);
-
-#endif /* wgl_ext_api_h */
+/*
+ * File: wgl_ext_api.h
+ * Purpose: Wrapper functions for Win32 OpenGL wgl extension functions
+ *
+ * Authors: Jon TURNEY
+ *
+ * Copyright (c) Jon TURNEY 2009
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef wgl_ext_api_h
+#define wgl_ext_api_h
+
+#include "wglext.h"
+
+void wglResolveExtensionProcs(void);
+
+/*
+ Prototypes for wrapper functions we actually use
+ XXX: should be automatically generated as well
+*/
+
+const char * __stdcall wglGetExtensionsStringARBWrapper(HDC hdc);
+BOOL __stdcall wglMakeContextCurrentARBWrapper(HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+HDC __stdcall wglGetCurrentReadDCARBWrapper(VOID);
+
+BOOL __stdcall wglGetPixelFormatAttribivARBWrapper(HDC hdc,
+ int iPixelFormat,
+ int iLayerPlane,
+ UINT nAttributes,
+ const int *piAttributes,
+ int *piValues);
+
+BOOL __stdcall wglGetPixelFormatAttribfvARBWrapper(HDC hdc,
+ int iPixelFormat,
+ int iLayerPlane,
+ UINT nAttributes,
+ const int *piAttributes,
+ FLOAT *pfValues);
+
+BOOL __stdcall wglChoosePixelFormatARBWrapper(HDC hdc,
+ const int *piAttribIList,
+ const FLOAT *pfAttribFList,
+ UINT nMaxFormats,
+ int *piFormats,
+ UINT *nNumFormats);
+
+HPBUFFERARB __stdcall wglCreatePbufferARBWrapper(HDC hDC,
+ int iPixelFormat,
+ int iWidth,
+ int iHeight,
+ const int *piAttribList);
+
+HDC __stdcall wglGetPbufferDCARBWrapper(HPBUFFERARB hPbuffer);
+
+int __stdcall wglReleasePbufferDCARBWrapper(HPBUFFERARB hPbuffer,
+ HDC hDC);
+
+BOOL __stdcall wglDestroyPbufferARBWrapper(HPBUFFERARB hPbuffer);
+
+BOOL __stdcall wglQueryPbufferARBWrapper(HPBUFFERARB hPbuffer,
+ int iAttribute,
+ int *piValue);
+
+BOOL __stdcall wglSwapIntervalEXTWrapper(int interval);
+
+int __stdcall wglGetSwapIntervalEXTWrapper(void);
+
+#endif /* wgl_ext_api_h */