Bugzilla – Attachment 817 Details for
Bug 1305
GLCanvas failed to initialize GL3(bc), GL4(bc) in SWING JFrame. GLJPanel succeed.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
Source code to reproduce problem
MainFrame.java (text/plain), 2.31 KB, created by
nickreserved
on 2019-05-04 21:01:47 CEST
(
hide
)
Description:
Source code to reproduce problem
Filename:
MIME Type:
Creator:
nickreserved
Created:
2019-05-04 21:01:47 CEST
Size:
2.31 KB
patch
obsolete
>package editor; > >import com.jogamp.common.GlueGenVersion; >import com.jogamp.opengl.GLAutoDrawable; >import com.jogamp.opengl.GLCapabilities; >import com.jogamp.opengl.GLEventListener; >import com.jogamp.opengl.GLProfile; >import com.jogamp.opengl.JoglVersion; >import com.jogamp.opengl.awt.GLCanvas; >import java.awt.Dimension; >import javax.swing.JFrame; > >public final class MainFrame extends JFrame { > public MainFrame() { > super("Level Editor"); > setSize(1000, 700); > LevelRenderer canvas = new LevelRenderer(); > canvas.setMinimumSize(new Dimension(600, 200)); > getContentPane().add(canvas); > setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); > System.out.println("JFrame Constructor Checkpoint"); > } > > public static void main(String[] args) { > GlueGenVersion.main(args); > JoglVersion.main(args); > StringBuilder sb = new StringBuilder(100000); > System.out.println(JoglVersion.getAllAvailableCapabilitiesInfo(null, sb)); > new MainFrame().setVisible(true); > System.out.println("main() Exit Checkpoint"); > } > > > > > /** Level OpenGL renderer. */ > final static private class LevelRenderer extends GLCanvas implements GLEventListener { > public LevelRenderer() { this(defaultCapabilities(defaultProfile())); } > @SuppressWarnings("LeakingThisInConstructor") > public LevelRenderer(GLCapabilities caps) { > super(caps); > addGLEventListener(this); > System.out.println("GLCanvas Constructor Exit Checkpoint"); > } > > static public GLProfile defaultProfile() { > return GLProfile.get(GLProfile.GL_PROFILE_LIST_MAX_PROGSHADER_CORE[0]); > } > static public GLCapabilities defaultCapabilities(GLProfile profile) { > System.out.println("GL Profile: " + profile.getName()); > GLCapabilities caps = new GLCapabilities(profile); > caps.setDepthBits(32); > caps.setStencilBits(0); > return caps; > } > > @Override public void dispose(GLAutoDrawable glad) { > System.out.println("GLCanvas:dispose() Checkpoint"); > } > @Override public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) { > System.out.println("GLCanvas:reshape() Checkpoint"); > } > @Override public void init(GLAutoDrawable glad) { > System.out.println("GLCanvas:init() Checkpoint"); > } > @Override public void display(GLAutoDrawable glad) { > System.out.println("GLCanvas:display() Checkpoint"); > } > } > >}
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 1305
:
785
| 817 |
818