diff options
author | Kenneth Russel <[email protected]> | 2006-02-10 20:06:04 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2006-02-10 20:06:04 +0000 |
commit | 4b14f14cbb84c3d60d3fb501d78873c574eec6bd (patch) | |
tree | 2bac953157778f18e0eff06c4c01fe08e55d9076 /src/classes/com/sun/opengl/impl/windows | |
parent | c6ed1767abe191648219a403828ecf32ad5ad25e (diff) |
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
Diffstat (limited to 'src/classes/com/sun/opengl/impl/windows')
-rw-r--r-- | src/classes/com/sun/opengl/impl/windows/WindowsGLDrawableFactory.java | 17 |
1 files changed, 11 insertions, 6 deletions
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; } |