Bugzilla – Attachment 769 Details for
Bug 1282
"'gl_FragColor' : undeclared identifier" thrown during fragment shader compilation with GL2ES2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
Source file
MyProgram.java (text/plain), 1.75 KB, created by
webermax2004
on 2016-01-10 14:04:49 CET
(
hide
)
Description:
Source file
Filename:
MIME Type:
Creator:
webermax2004
Created:
2016-01-10 14:04:49 CET
Size:
1.75 KB
patch
obsolete
>import java.awt.*; >import java.awt.event.*; >import com.jogamp.opengl.awt.GLCanvas; >import com.jogamp.opengl.GLProfile; >import com.jogamp.opengl.GLCapabilities; >import com.jogamp.opengl.GLAutoDrawable; >import com.jogamp.opengl.GLEventListener; >import com.jogamp.opengl.util.glsl.ShaderCode; >import com.jogamp.opengl.GL2ES2; >import com.jogamp.opengl.util.glsl.ShaderProgram; > >public class MyProgram { > public MyProgram () { > Frame f = new Frame ("Test frame"); > f.addWindowListener (new MyWindowAdapter ()); > GLProfile glProfile = GLProfile.get (GLProfile.GL2ES2); > GLCapabilities glCapabilities = new GLCapabilities (glProfile); > GLCanvas glCanvas = new GLCanvas (glCapabilities); > glCanvas.addGLEventListener (new MyGLEventListener ()); > f.add (glCanvas); > f.setSize (300, 300); > f.setVisible (true); > } > > public class MyWindowAdapter extends WindowAdapter { > public void windowClosing (WindowEvent e) { > System.exit (0); > } > } > > public class MyGLEventListener implements GLEventListener { > public void display (GLAutoDrawable drawable) { > System.out.println ("display ()"); > GL2ES2 gl = drawable.getGL ().getGL2ES2(); > ShaderCode fs; > String[][] fsCode = {{"void main (void) { gl_FragColor = vec4 (1.0, 0.0, 0.0, 1.0); }"}}; // Quand on utilise GL2ES2 => 'gl_FragColor' : undeclared identifier > fs = new ShaderCode (GL2ES2.GL_FRAGMENT_SHADER, 1, fsCode); > fs.compile (gl, System.out); > } > public void dispose (GLAutoDrawable drawable) { > System.out.println ("dispose ()"); > } > public void init (GLAutoDrawable drawable) { > System.out.println ("init ()"); > } > public void reshape (GLAutoDrawable drawable, int x, int y, int width, int height) { > System.out.println ("reshape ()"); > } > } >}
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 1282
: 769