Bugzilla – Attachment 239 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]
File needed to make the OneTriangleAWT example work.
OneTriangle.java (text/plain), 1.03 KB, created by
François Coupal
on 2011-03-07 16:34:33 CET
(
hide
)
Description:
File needed to make the OneTriangleAWT example work.
Filename:
MIME Type:
Creator:
François Coupal
Created:
2011-03-07 16:34:33 CET
Size:
1.03 KB
patch
obsolete
>import javax.media.opengl.GL; >import javax.media.opengl.GL2; >import javax.media.opengl.glu.GLU; > >public class OneTriangle { > protected static void setup( GL2 gl2, int width, int height ) { > gl2.glMatrixMode( GL2.GL_PROJECTION ); > gl2.glLoadIdentity(); > > // coordinate system origin at lower left with width and height same as the window > GLU glu = new GLU(); > glu.gluOrtho2D( 0.0f, width, 0.0f, height ); > > gl2.glMatrixMode( GL2.GL_MODELVIEW ); > gl2.glLoadIdentity(); > > gl2.glViewport( 0, 0, width, height ); > } > > protected static void render( GL2 gl2, int width, int height ) { > gl2.glClear( GL.GL_COLOR_BUFFER_BIT ); > > // draw a triangle filling the window > gl2.glLoadIdentity(); > gl2.glBegin( GL.GL_TRIANGLES ); > gl2.glColor3f( 1, 0, 0 ); > gl2.glVertex2f( 0, 0 ); > gl2.glColor3f( 0, 1, 0 ); > gl2.glVertex2f( width, 0 ); > gl2.glColor3f( 0, 0, 1 ); > gl2.glVertex2f( width / 2, height ); > gl2.glEnd(); > } >}
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