From 81aa678ce8f4a1f7c75b928ba2b107908959d50d Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 21 Nov 2008 05:26:52 +0900 Subject: glut: MinGW portability fixes. Still, it doesn't run as well as the glut binaries... --- src/glut/glx/SConscript | 89 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 src/glut/glx/SConscript (limited to 'src/glut/glx/SConscript') diff --git a/src/glut/glx/SConscript b/src/glut/glx/SConscript new file mode 100644 index 0000000000..99b3bb7df6 --- /dev/null +++ b/src/glut/glx/SConscript @@ -0,0 +1,89 @@ +Import('*') + +env = env.Clone() + +if env['platform'] != 'windows': + Return() + +target = 'glut32' + +env.Replace(CPPDEFINES = [ + 'BUILD_GLUT32', + 'GLUT_BUILDING_LIB', + 'MESA', + '_DLL', + 'NDEBUG', + 'GLUT_NO_WARNING_DISABLE', +]) + +env.AppendUnique(CPPPATH = [ + '#/include', +]) + +env.PrependUnique(LIBS = [ + 'winmm', + 'gdi32', + 'user32', + 'opengl32', + 'glu32', +]) + +sources = [ + 'glut_bitmap.c', + 'glut_bwidth.c', + 'glut_cindex.c', + 'glut_cmap.c', + 'glut_cursor.c', + 'glut_dials.c', + 'glut_dstr.c', + 'glut_event.c', + 'glut_ext.c', + 'glut_fcb.c', + 'glut_fullscrn.c', + 'glut_gamemode.c', + 'glut_get.c', + 'glut_init.c', + 'glut_input.c', + 'glut_joy.c', + 'glut_key.c', + 'glut_keyctrl.c', + 'glut_keyup.c', + 'glut_mesa.c', + 'glut_modifier.c', + 'glut_overlay.c', + 'glut_shapes.c', + 'glut_space.c', + 'glut_stroke.c', + 'glut_swap.c', + 'glut_swidth.c', + 'glut_tablet.c', + 'glut_teapot.c', + 'glut_util.c', + 'glut_vidresize.c', + 'glut_warp.c', + 'glut_win.c', + 'glut_winmisc.c', + + 'win32_glx.c', + 'win32_menu.c', + 'win32_util.c', + 'win32_winproc.c', + 'win32_x11.c', + + 'glut_8x13.c', + 'glut_9x15.c', + 'glut_hel10.c', + 'glut_hel12.c', + 'glut_hel18.c', + 'glut_mroman.c', + 'glut_roman.c', + 'glut_tr10.c', + 'glut_tr24.c', + + 'glut.def', +] + +env.SharedLibrary( + target = target, + source = sources, +) -- cgit v1.2.3 From 70894676c24c3b1c2e7643501f13640d7e56301d Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 30 Dec 2008 17:22:24 +0000 Subject: glut: List new source file in sconscript. --- src/glut/glx/SConscript | 1 + 1 file changed, 1 insertion(+) (limited to 'src/glut/glx/SConscript') diff --git a/src/glut/glx/SConscript b/src/glut/glx/SConscript index 99b3bb7df6..464a371f85 100644 --- a/src/glut/glx/SConscript +++ b/src/glut/glx/SConscript @@ -51,6 +51,7 @@ sources = [ 'glut_mesa.c', 'glut_modifier.c', 'glut_overlay.c', + 'glut_ppm.c', 'glut_shapes.c', 'glut_space.c', 'glut_stroke.c', -- cgit v1.2.3 From 8c0d8d89fa216771f7f2a75a71519e035dd20d9f Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 6 Jan 2009 16:20:23 +0000 Subject: glut: Fix build. --- src/glut/glx/SConscript | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/glut/glx/SConscript') diff --git a/src/glut/glx/SConscript b/src/glut/glx/SConscript index 464a371f85..7685ec2588 100644 --- a/src/glut/glx/SConscript +++ b/src/glut/glx/SConscript @@ -11,7 +11,6 @@ env.Replace(CPPDEFINES = [ 'BUILD_GLUT32', 'GLUT_BUILDING_LIB', 'MESA', - '_DLL', 'NDEBUG', 'GLUT_NO_WARNING_DISABLE', ]) @@ -38,7 +37,7 @@ sources = [ 'glut_dstr.c', 'glut_event.c', 'glut_ext.c', - 'glut_fcb.c', + 'glut_fbc.c', 'glut_fullscrn.c', 'glut_gamemode.c', 'glut_get.c', -- cgit v1.2.3 From 5cad143e545775acacee294049345c6a3868c51d Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 8 Jan 2009 12:42:25 +0000 Subject: glut: Unlist file. Again.. --- src/glut/glx/SConscript | 1 - 1 file changed, 1 deletion(-) (limited to 'src/glut/glx/SConscript') diff --git a/src/glut/glx/SConscript b/src/glut/glx/SConscript index 7685ec2588..cb442ba027 100644 --- a/src/glut/glx/SConscript +++ b/src/glut/glx/SConscript @@ -37,7 +37,6 @@ sources = [ 'glut_dstr.c', 'glut_event.c', 'glut_ext.c', - 'glut_fbc.c', 'glut_fullscrn.c', 'glut_gamemode.c', 'glut_get.c', -- cgit v1.2.3 From 5b0807b72f16a4835e4b28aa8a66e9bcd867d383 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 10 Feb 2009 11:36:48 +0000 Subject: glut: Use the official WGL functions. Especially using wglGetPixelFormat instead of GetPixelFormat causes problems with opengl32.dll and drivers that not hack around this issue. --- src/glut/glx/SConscript | 1 - src/glut/glx/glutint.h | 38 ++++++++------------------------------ src/glut/glx/win32_glx.c | 2 +- 3 files changed, 9 insertions(+), 32 deletions(-) (limited to 'src/glut/glx/SConscript') diff --git a/src/glut/glx/SConscript b/src/glut/glx/SConscript index cb442ba027..938fec03df 100644 --- a/src/glut/glx/SConscript +++ b/src/glut/glx/SConscript @@ -10,7 +10,6 @@ target = 'glut32' env.Replace(CPPDEFINES = [ 'BUILD_GLUT32', 'GLUT_BUILDING_LIB', - 'MESA', 'NDEBUG', 'GLUT_NO_WARNING_DISABLE', ]) diff --git a/src/glut/glx/glutint.h b/src/glut/glx/glutint.h index fe4e038add..ba30af60f0 100644 --- a/src/glut/glx/glutint.h +++ b/src/glut/glx/glutint.h @@ -32,10 +32,6 @@ #include -#if defined(MESA) && defined(_WIN32) && !defined(__CYGWIN32__) -#include -#endif - #ifndef _WIN32 /* added by BrianP: */ #ifndef APIENTRY @@ -48,24 +44,6 @@ /* GLUT_BUILDING_LIB is used by to 1) not #pragma link with the GLUT library, and 2) avoid the Win32 atexit hack. */ -/* This must be done after is included. MESA is defined - if the is supplied by Brian Paul's Mesa library. */ -#if defined(MESA) && defined(_WIN32) -/* Mesa implements "wgl" versions of GDI entry points needed for - using OpenGL. Map these "wgl" versions to the GDI names via - macros. */ -#define ChoosePixelFormat wglChoosePixelFormat -#define DescribePixelFormat wglDescribePixelFormat -#define GetPixelFormat wglGetPixelFormat -#define SetPixelFormat wglSetPixelFormat -#define SwapBuffers wglSwapBuffers -#define GetCurrentContext wglGetCurrentContext -#define GetCurrentDC wglGetCurrentDC -#define MakeCurrent wglMakeCurrent -#define CreateContext wglCreateContext -#define DeleteContext wglDeleteContext -#endif /* MESA */ - #ifdef SUPPORT_FORTRAN #include #endif @@ -572,27 +550,27 @@ typedef struct { #ifdef _WIN32 #define MAKE_CURRENT_LAYER(window) \ { \ - HGLRC currentContext = GetCurrentContext(); \ - HDC currentDc = GetCurrentDC(); \ + HGLRC currentContext = wglGetCurrentContext(); \ + HDC currentDc = wglGetCurrentDC(); \ \ if (currentContext != window->renderCtx \ || currentDc != window->renderDc) { \ - MakeCurrent(window->renderDc, window->renderCtx); \ + wglMakeCurrent(window->renderDc, window->renderCtx); \ } \ } #define MAKE_CURRENT_WINDOW(window) \ { \ - HGLRC currentContext = GetCurrentContext(); \ - HDC currentDc = GetCurrentDC(); \ + HGLRC currentContext = wglGetCurrentContext(); \ + HDC currentDc = wglGetCurrentDC(); \ \ if (currentContext != window->ctx || currentDc != window->hdc) { \ - MakeCurrent(window->hdc, window->ctx); \ + wglMakeCurrent(window->hdc, window->ctx); \ } \ } #define MAKE_CURRENT_OVERLAY(overlay) \ - MakeCurrent(overlay->hdc, overlay->ctx) + wglMakeCurrent(overlay->hdc, overlay->ctx) #define UNMAKE_CURRENT() \ - MakeCurrent(NULL, NULL) + wglMakeCurrent(NULL, NULL) #define SWAP_BUFFERS_WINDOW(window) \ SwapBuffers(window->hdc) #define SWAP_BUFFERS_LAYER(window) \ diff --git a/src/glut/glx/win32_glx.c b/src/glut/glx/win32_glx.c index ecfff44b93..3522e606ec 100644 --- a/src/glut/glx/win32_glx.c +++ b/src/glut/glx/win32_glx.c @@ -22,7 +22,7 @@ glXCreateContext(Display * display, XVisualInfo * visinfo, routine. */ HGLRC context; - context = CreateContext(XHDC); + context = wglCreateContext(XHDC); #if 0 /* XXX GLUT doesn't support it now, so don't worry about display list -- cgit v1.2.3