Can't Switch Between 2D and 3D

Started by AGP, September 25, 2025, 06:58:30 AM

Previous topic - Next topic

AGP

Since I can't use AWTGLCanvas, I'm forced to try to switch to OpenGL rendering like in the following code block. Also, I can't initialize the FrameBuffer without creating the non-AWT frame (and I can't seem to hide it, either). I think that this qualifies as a bug.

                     if (currentScene instanceof Scene3d && lastScene instanceof Scene2d) {//SWITCH FROM 2D to 3D
                         frame.setVisible(false);
                         try{org.lwjgl.opengl.Display.setFullscreen(true);//CRASHING
                         org.lwjgl.opengl.Display.makeCurrent();}catch(Exception e) {}
                         keyMapper = new KeyMapper();
                     }

EgonOlsen

I'm not sure what you are trying to achieve. Do you want to switch between a 2D UI and a 3D render or simply between to renders, one software and one hardware?

I tried the latter with the fps example included in the distribution. For me, it worked fine unless I tried to use Java 2D in fullscreen. With that enabled, I ended up with the desktop being rendered 640*480.

I have no influence on how Java 2D and/or LWJGL are handling things, I'm afraid. Have you tried to disable Java 2D's OpenGL/D3D pipeline?