From 4b14f14cbb84c3d60d3fb501d78873c574eec6bd Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Fri, 10 Feb 2006 20:06:04 +0000 Subject: Made loading of GLU library lazier, partially in the hope that this may address problems on certain Linux distributions where for some reason we're falling back to software rendering with Mesa git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@595 232f8b59-042b-4e1e-8c03-345bb8c30851 --- .../opengl/impl/windows/WindowsGLDrawableFactory.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/classes/com/sun/opengl/impl/windows/WindowsGLDrawableFactory.java') diff --git a/src/classes/com/sun/opengl/impl/windows/WindowsGLDrawableFactory.java b/src/classes/com/sun/opengl/impl/windows/WindowsGLDrawableFactory.java index eab068bb4..94fd0eb1e 100644 --- a/src/classes/com/sun/opengl/impl/windows/WindowsGLDrawableFactory.java +++ b/src/classes/com/sun/opengl/impl/windows/WindowsGLDrawableFactory.java @@ -173,17 +173,22 @@ public class WindowsGLDrawableFactory extends GLDrawableFactoryImpl { return new WindowsExternalGLDrawable(); } + public void loadGLULibrary() { + if (hglu32 == 0) { + hglu32 = WGL.LoadLibraryA("GLU32"); + if (hglu32 == 0) { + throw new GLException("Error loading GLU32.DLL"); + } + } + } + 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"); - } + if (hglu32 != 0) { + res = WGL.GetProcAddress(hglu32, glFuncName); } - res = WGL.GetProcAddress(hglu32, glFuncName); } return res; } -- cgit v1.2.3