Bugzilla – Attachment 16 Details for
Bug 58
GLCanvas draws over other components in MacOS X
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
Test program that demonstrates the issue. Run under MacOS X.
TestProgram.java (text/plain), 1.59 KB, created by
Sven Gothel
on 2004-01-17 22:30:00 CET
(
hide
)
Description:
Test program that demonstrates the issue. Run under MacOS X.
Filename:
MIME Type:
Creator:
Sven Gothel
Created:
2004-01-17 22:30:00 CET
Size:
1.59 KB
patch
obsolete
>import net.java.games.jogl.*; >import javax.swing.*; >import java.awt.*; > >public class TestProgram { > > private static class Renderer implements GLEventListener { > > public void display( GLDrawable drawable ) { > GL gl = drawable.getGL(); > gl.glClear(GL.GL_COLOR_BUFFER_BIT); > gl.glMatrixMode(GL.GL_MODELVIEW); > gl.glLoadIdentity(); > gl.glBegin( GL.GL_TRIANGLES ); > gl.glVertex2d(-1.0, -1.0 ); > gl.glVertex2d(1.0, -1.0); > gl.glVertex2d(0.0, 1.0); > gl.glEnd(); > gl.glFlush(); > } > > public void displayChanged(GLDrawable drawable, boolean modeChanged, > boolean deviceChanged) { } > > public void init(GLDrawable drawable) {} > > public void reshape( GLDrawable drawable, int x, int y, int w, int h){ > GL gl = drawable.getGL(); > gl.glMatrixMode(GL.GL_PROJECTION); > gl.glLoadIdentity(); > gl.glOrtho(-2.0, 2.0, -2.0, 2.0, -1, 1 ); > } > } > > public static void main( String[] args ) { > JFrame frame = new JFrame(); > JPanel mainPanel = new JPanel(); > mainPanel.setLayout( new BorderLayout() ); > Renderer rend = new Renderer(); > GLCanvas can = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); > can.addGLEventListener( rend ); > > mainPanel.add(can, BorderLayout.CENTER ); > JPanel buttonPanel = new JPanel(); > buttonPanel.add( new JButton("Button One") ); > buttonPanel.add( new JButton("Button Two") ); > mainPanel.add(buttonPanel, BorderLayout.SOUTH); > > frame.getContentPane().add(mainPanel); > frame.setSize( 400,400); > frame.show(); > } > >}
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 58
: 16