Bugzilla – Attachment 238 Details for
Bug 460
NPE using the GLCanvas.getFactory() method with minimal setup.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
JUnit test case for recreating the NPE.
testJOGL2.java (text/plain), 1.69 KB, created by
François Coupal
on 2011-03-07 16:33:51 CET
(
hide
)
Description:
JUnit test case for recreating the NPE.
Filename:
MIME Type:
Creator:
François Coupal
Created:
2011-03-07 16:33:51 CET
Size:
1.69 KB
patch
obsolete
>import java.util.Collections; >import java.util.SortedSet; >import java.util.TreeSet; > >import javax.media.nativewindow.AbstractGraphicsDevice; >import javax.media.opengl.DefaultGLCapabilitiesChooser; >import javax.media.opengl.GL; >import javax.media.opengl.GL2; >import javax.media.opengl.GLCapabilities; >import javax.media.opengl.GLCapabilitiesChooser; >import javax.media.opengl.GLCapabilitiesImmutable; >import javax.media.opengl.GLContext; >import javax.media.opengl.GLDrawableFactory; >import javax.media.opengl.GLPbuffer; >import javax.media.opengl.GLProfile; >import javax.media.opengl.awt.GLCanvas; > >import org.junit.Test; > >public class testJOGL2 { > > public static void main(String[] args) { > testJOGL2 instance = new testJOGL2(); > instance.testJogl2ExtensionCheck(); > } > > @Test > public void testJogl2ExtensionCheck() { > GLProfile.initSingleton(false); >// GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2)); > GLCapabilities caps = new GLCapabilities(GLProfile.getDefault()); > GLCanvas glc = new GLCanvas(caps); > GLDrawableFactory usine = glc.getFactory(); > GLCapabilitiesImmutable glci = glc.getChosenGLCapabilities(); > GLCapabilitiesChooser glcc = new DefaultGLCapabilitiesChooser(); > AbstractGraphicsDevice agd = usine.getDefaultDevice(); > > GLPbuffer pbuffer = usine.createGLPbuffer(agd, glci, glcc, 256, 256, null); > GLContext context = pbuffer.getContext(); > context.makeCurrent(); > GL2 gl = pbuffer.getContext().getGL().getGL2(); > > String extensions = gl.glGetString(GL.GL_EXTENSIONS); > String[] tabExtensions = extensions.split(" "); > SortedSet<String> setExtensions = new TreeSet<String>(); > Collections.addAll(setExtensions, tabExtensions); > System.out.println(setExtensions); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 460
: 238 |
239
|
240