Hello,
does anyone know how to get the glGetString(

)
function to work. When I am rendering a scene I can use it in the display method and System.out.println it to the console window in Eclipse. The problem I am having is that I would like to get all that information without actually showing a GLCanvas. I tried creating a GLCanvas and just calling getGL() but the string method only returned null. Then I created a GLEventListener to get the info. Added the GLEventListener to my GLCanvas and called glCanvas.display(), but my GLEventListener isn't getting called. Anyone have any thoughts. following is my code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
import net.java.games.jogl.*;
public class CsConfigurationTesting { public static void main(String args[]) { System.out.println("A"); GLCapabilities cap = new GLCapabilities(); System.out.println("B"); GLCanvas c = GLDrawableFactory.getFactory().createGLCanvas(cap); c.setSize(200,200); System.out.println("C"); CsListener l = new CsListener(); c.addGLEventListener(l); c.display(); System.out.println("Vendor : " + l.strVendor); System.out.println("Renderer : " + l.strRenderer); } }
class CsListener implements GLEventListener {
public String strVendor; public String strRenderer;
public void init(GLDrawable drawable) { }
public void display(GLDrawable drawable) { GL gl = drawable.getGL(); System.out.println("HERE!!!!!!"); this.strVendor = gl.glGetString(GL.GL_VENDOR); this.strRenderer = gl.glGetString(GL.GL_RENDERER); }
public void reshape(GLDrawable arg0, int arg1, int arg2, int arg3, int arg4) { }
public void displayChanged(GLDrawable arg0, boolean arg1, boolean arg2) { } }
|
thanks,
Steve