From 74adb7cc4ba59369964b562e3c84988f63025296 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Tue, 19 Jul 2005 01:53:36 +0000 Subject: Added workaround for problem loading JAWT library on X11 platforms before the AWT toolkit had been loaded. Added check for jogl.gljpanel.nosw system property to diagnose problems with pbuffer support. Fixed bootstrapping problem with GLX where its function pointer table needed to be initialized before the first OpenGL context was created in the case where a pbuffer was the first thing created. Moved helper functions for resetting proc address table and dynamic function lookup to GLDrawableFactoryImpl from GLContextImpl. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JSR-231@331 232f8b59-042b-4e1e-8c03-345bb8c30851 --- .../games/jogl/impl/windows/WindowsGLContext.java | 18 ------------------ .../jogl/impl/windows/WindowsGLDrawableFactory.java | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 18 deletions(-) (limited to 'src/net/java/games/jogl/impl/windows') diff --git a/src/net/java/games/jogl/impl/windows/WindowsGLContext.java b/src/net/java/games/jogl/impl/windows/WindowsGLContext.java index 1c0365571..532483c68 100644 --- a/src/net/java/games/jogl/impl/windows/WindowsGLContext.java +++ b/src/net/java/games/jogl/impl/windows/WindowsGLContext.java @@ -40,7 +40,6 @@ package net.java.games.jogl.impl.windows; import java.util.*; -import net.java.games.gluegen.runtime.*; // for PROCADDRESS_VAR_PREFIX import net.java.games.jogl.*; import net.java.games.jogl.impl.*; @@ -54,8 +53,6 @@ public class WindowsGLContext extends GLContextImpl { // Table that holds the addresses of the native C-language entry points for // OpenGL functions. private GLProcAddressTable glProcAddressTable; - // Handle to GLU32.dll - private long hglu32; static { functionNameMap = new HashMap(); @@ -184,21 +181,6 @@ public class WindowsGLContext extends GLContextImpl { } } - protected long dynamicLookupFunction(String glFuncName) { - long res = WGL.wglGetProcAddress(glFuncName); - if (res == 0) { - // GLU routines aren't known to the OpenGL function lookup - if (hglu32 == 0) { - hglu32 = WGL.LoadLibraryA("GLU32"); - if (hglu32 == 0) { - throw new GLException("Error loading GLU32.DLL"); - } - } - res = WGL.GetProcAddress(hglu32, glFuncName); - } - return res; - } - public boolean isCreated() { return (hglrc != 0); } diff --git a/src/net/java/games/jogl/impl/windows/WindowsGLDrawableFactory.java b/src/net/java/games/jogl/impl/windows/WindowsGLDrawableFactory.java index ebaf80394..b29bcf157 100755 --- a/src/net/java/games/jogl/impl/windows/WindowsGLDrawableFactory.java +++ b/src/net/java/games/jogl/impl/windows/WindowsGLDrawableFactory.java @@ -57,6 +57,10 @@ public class WindowsGLDrawableFactory extends GLDrawableFactoryImpl { private static final boolean DEBUG = Debug.debug("WindowsGLDrawableFactory"); private static final boolean VERBOSE = Debug.verbose(); + // Handle to GLU32.dll + // FIXME: this should go away once we delete support for the C GLU library + private long hglu32; + static { NativeLibLoader.load(); @@ -213,6 +217,21 @@ public class WindowsGLDrawableFactory extends GLDrawableFactoryImpl { return (GLPbuffer) returnList.get(0); } + public long dynamicLookupFunction(String glFuncName) { + long res = WGL.wglGetProcAddress(glFuncName); + if (res == 0) { + // GLU routines aren't known to the OpenGL function lookup + if (hglu32 == 0) { + hglu32 = WGL.LoadLibraryA("GLU32"); + if (hglu32 == 0) { + throw new GLException("Error loading GLU32.DLL"); + } + } + res = WGL.GetProcAddress(hglu32, glFuncName); + } + return res; + } + static String wglGetLastError() { int err = WGL.GetLastError(); String detail = null; -- cgit v1.2.3