Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (576)
games submitted by our members
Games in WIP (497)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / JOGL Development / Re: JOGL and GLSL on: 2004-08-31 07:43:40
Hm, I never ran into that sort of problem before. Since I found an immediate workaround I also threw away the old code-version (didn't even checked it into CVS :-)
What I can say is that there was no crash nor even an exception when running into the String[]. The program kept going with fixed-function-behavior and terminated correct without any further errors when exited by hand later.
I'll keep the problem in mind and will see if it will show up anywhere else in the project.

By the way: As we speak of shader-programming, are there any plans to alter JOGL soon to match the new Cg-Tookit v1.3? I know it's only Beta but it works nice and stable for me at the moment using profiles vp40 and fp40 and the parameter-sharing and texture-binding-control is a valuable add-on. Tell me if you need help. I would be interested in working on it since I want to use the features ;-)

Greetz...


...Hoschi_S
2  Java Game APIs & Engines / JOGL Development / Re: JOGL and GLSL on: 2004-08-25 07:59:57
Ok, I found the problem. A stupid mistake, as always :-(
By porting from c/c++ one should think not only about different behavior using pointers but also about different behavior with Strings being not null-terminated.
Thus the calls to

glShaderSourceARB

have to be made differently: Passing a "NULL" for the last parameter and a 1 for the numStrings-Parameter is valid if the strings are null-terminated c-strings in an array terminated by an empty string. That is not the case with java, so changing the old call

1  
2  
            int[] emptyIntArray = null;
            gl.glShaderSourceARB(this.vertexShaderHandle, 1, shaderSource.getVertexShader(), emptyIntArray);


to:

1  
2  
3  
4  
5  
            String[] vertexShader = shaderSource.getVertexShader();
            int[] vertexLength = new int[vertexShader.length];
            for (int v = 0; v < vertexLength.length; v++)
                  vertexLength[v] = vertexShader[v].length();
            gl.glShaderSourceARB(this.vertexShaderHandle, vertexShader.length, vertexShader, vertexLength);

solved the problem. The shaders are now compiled (Of course the same had to be done to the fragmentShader call...).  Grin

If I am successfull in the further work on the project I might set up a tutorial about the use og GLSL and JOGL. Let's see how it turns out.

cheers...


...Hoschi_S
3  Java Game APIs & Engines / JOGL Development / Re: JOGL and GLSL on: 2004-08-25 07:32:56
Thanks for your answer but that's surely not the problem. I posted only parts from a bigger project. I have a baseclass that organizes most things needed and calls some overridable functions. Then I derive that class and have with little more than twenty lines a complete new JOGL-App. I added a boolean-switch USE_GLSL in the baseclass and a

if (USE_GLSL) initGLSL(glDrawable);

in the init()-Method invoked through the GLEventListener.
I also have a little scene with activated Lighting and two Lightsources in this special case to see an effect from the perPixel-Lighting from the Shaders. The system works fine, the scene is drawn but the Shaders won't work which is somewhat clear when they don't compile. I just don't have any idea why they don't compile. Am I doing something wrong with the String-Array containing the shader-codes? I just ported c-code for that part and haven't found any GLSL-examples using JOGL up 'till now...
4  Java Game APIs & Engines / JOGL Development / JOGL and GLSL on: 2004-08-24 15:23:12
Hi everybody!

I have worked quite a while with JOGL and Cg now and I now tried to look into OpenGL Shading Laguage. I found a few tutorials, wrote some shaders using a shader-designer-software and started porting some C-code to Java/JOGL to have the shaders running there.
Now after doing all this I get nothing at all. I implemented an output for the InfoLog and get the following output:

1  
2  
3  
4  
5  
6  
7  
8  
Vertex info
-----------
(0) : error C3001: no program defined
1 lines, 1 errors.
Fragment info
-------------
(0) : error C3001: no program defined
1 lines, 1 errors.


If I try and compile the shaders with the cgc-compiler and the option "-oglsl" everythings works fine. I get no errors.

The shaders are:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
      public String[] getVertexShader() {

            String[] result = new String[8];
            result[0] = new String("varying vec3 v;");
            result[1] = new String("varying vec3 n;");
            result[2] = new String("void main() {");
            result[3] = new String("v = vec3(gl_ModelViewMatrix * gl_Vertex);");
            result[4] = new String("n = normalize(gl_NormalMatrix * gl_Normal);");
            result[5] = new String("gl_TexCoord[0] = gl_MultiTexCoord0;");
            result[6] = new String("gl_TexCoord[1] = gl_MultiTexCoord0;");
            result[7] = new String("gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }");
            return result;

      }

      public String[] getFragmentShader() {

            String[] result = new String[14];
            result[0] = new String("varying vec3 v;");
            result[1] = new String("varying vec3 n;");
            result[2] = new String("uniform sampler2D TextureUnit0;");
            result[3] = new String("void main() {");
            result[4] = new String("vec4 ambient, diffuse, specular;");
            result[5] = new String("for (int l = 0; l < gl_MaxLights; l++) {");
            result[6] = new String("vec3 l = normalize(gl_LightSource[l].position.xyz - v);");
            result[7] = new String("vec3 e = normalize(-v);");
            result[8] = new String("vec3 r = normalize(-reflect(l, n));");
            result[9] = new String("ambient += gl_FrontLightProduct[l].ambient * gl_FrontMaterial.ambient;");
            result[10] = new String("diffuse += gl_FrontLightProduct[l].diffuse * max(dot(n, l), 0.0);");
            result[11] = new String("specular += gl_FrontLightProduct[l].specular * pow(max(dot(r, e), 0.0), gl_FrontMaterial.shininess); }");
            result[12] = new String("gl_FragColor = ambient + diffuse;");
            result[13] = new String("gl_FragColor += specular; }");
            return result;

      }


The code to initi GLSL and load the programs looks like this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
      protected void initGLSL(GLDrawable glDraw) {

            GL gl = glDraw.getGL();

            this.vertexShaderHandle = gl.glCreateShaderObjectARB(GL.GL_VERTEX_SHADER_ARB);
            this.fragmentShaderHandle = gl.glCreateShaderObjectARB(GL.GL_FRAGMENT_SHADER_ARB);

            FirstGLSLshader shaderSource = new FirstGLSLshader();

            int[] emptyIntArray = null;
            gl.glShaderSourceARB(this.vertexShaderHandle, 1, shaderSource.getVertexShader(), emptyIntArray);
            gl.glShaderSourceARB(this.fragmentShaderHandle, 1, shaderSource.getFragmentShader(), emptyIntArray);

            gl.glCompileShaderARB(this.vertexShaderHandle);
            int[] resultVertex = new int[1];
            gl.glGetObjectParameterivARB(this.vertexShaderHandle, GL.GL_OBJECT_COMPILE_STATUS_ARB, resultVertex);
            this.printInfoLog(glDraw, this.vertexShaderHandle);

            gl.glCompileShaderARB(this.fragmentShaderHandle);
            int[] resultFragment = new int[1];
            gl.glGetObjectParameterivARB(this.fragmentShaderHandle, GL.GL_OBJECT_COMPILE_STATUS_ARB, resultFragment);
            this.printInfoLog(glDraw, this.fragmentShaderHandle);

            if (resultVertex[0] == 0 || resultFragment[0] == 0) {

                  if (VERBOSE) System.err.println("Unable to initialize OGSL");
                  System.exit(-1);

            }

            this.OGSLProgram = gl.glCreateProgramObjectARB();
            gl.glAttachObjectARB(this.OGSLProgram, this.vertexShaderHandle);
            gl.glAttachObjectARB(this.OGSLProgram, this.fragmentShaderHandle);

            gl.glLinkProgramARB(this.OGSLProgram);
            int[] programLinked = new int[1];
            gl.glGetObjectParameterivARB(this.fragmentShaderHandle, GL.GL_OBJECT_COMPILE_STATUS_ARB, programLinked);
            this.printInfoLog(glDraw, this.OGSLProgram);

            if (programLinked[0] == 0) {

                  if (VERBOSE) System.err.println("Unable to link Program");
                  System.exit(-1);

            }

            gl.glUseProgramObjectARB(this.OGSLProgram);

            this.checkGLErrors(glDraw);

      }


I'm not quite sure where the problem is. Is there a need to specify the entry-point-function-names? I though that wouldn't be necessary if they are both "main".
The cgc-compiler I used for testing the code is from the new Cg-Toolkit 1.3 Beta 2. Hardware is a nVidia Quadro FX 3400 with drivers 65.62 (Dell Performance-Driver).

Anybody got an idea? Any help is appreciated.

Greetz...


...Hoschi_S
5  Java Game APIs & Engines / JOGL Development / Error freeing GLcontext on: 2004-02-25 09:16:14
Hi all!
I am writing a 3D-Building-Client as an Applet based on XML-formatted world-files together with two co-workers. So far I am getting quite good results.
We implemented Hotspot-functionality by using JavaScript in the HTML-page containing the Applet and it opens up nicely new websites by collision with those hotpots (e.g. doors).
Now we wanted to add another type of hotspot for level-change inside the building. It works so far but after the loading of the new world-file is finished I get a "Error freeing GLcontext"-message. I tried things like putting an animator.stop() and animator.start() as first and last line into the load-routine and stuff like that. Nothing helped. I'm getting quite desperate by now since I cannot figure out what the problem exactly is.
I am not trying to free the context by myself. I don't even break up the normal display-routine, since it just calls a draw-function inside the world-object. I made the world-object static and just copied the data from the new one into the old one so that the object never became invalid, added a switch to not render while loading and things like that. Now I don't come up whith any new ideas.
Can anyone help me at least that far as to tell me what exactly is the cause for such an error? Really any help is appreciated!

Greetz...


...Hoschi
6  Java Game APIs & Engines / JOGL Development / Re: Any good documentation on VertexArrays in jogl on: 2004-01-21 13:13:04
Thanks for the quick response. Of course you are right. But fixing this minor problem sadly enough does not fix the overall problem. I still get the errorMessage.
Any further suggestions?

Greetz...


...Hoschi
7  Java Game APIs & Engines / JOGL Development / Any good documentation on VertexArrays in jogl? on: 2004-01-21 06:11:20
Hi all!
I was trying a bit on creating a 4D-Viewer but soon got problems with lack of framerate. Since it was a raw version I decided to implement Arrays for the untextured Objects (About 150.000 vertices, completly in triangles) normals and vertices.
I collected all the necessary data in four Arrays, the normalValues and vertexValues-Arrays of type float[] and the normalIndices and vertexIndices-Arrays of type int[]. Now I tried binding the float-arrays using something like this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
gl.glEnableClientState(GL.GL_NORMAL_ARRAY);
gl.glEnableClientState(GL.GL_VERTEX_ARRAY);

FloatBuffer normalBuffer = BufferUtils.newFloatBuffer(normalArray.length);
normalBuffer.put(normalArray);
FloatBuffer vertexBuffer = BufferUtils.newFloatBuffer(vertexArray.length);
vertexBuffer.put(vertexArray);

gl.glNormalPointer(3, GL.GL_FLOAT, normalBuffer);
gl.glVertexPointer(3, GL.GL_FLOAT, 0, vertexBuffer);


When I run this I get an

net.java.games.jogl.GLException: Error freeing OpenGL context

I'm not quite sure about this so I was wondering if there is a good demonstrational solution out there I could use for a better understanding what needs to done on java where one cannot simply use some pointer-arithmetics for buffer-playing...
Any suggestions welcome!

Greetz...


...Hoschi
8  Java Game APIs & Engines / JOGL Development / Re: Use of Stencil Buffer on: 2003-10-21 17:18:09
Sorry for the late reply. The Xith-source-code helped a little and that together with some Red-book-reading and trial-and-error helped me in the end. I have it now. Thanks for the tip, Yun!

Greetz...


...Hoschi_S
9  Java Game APIs & Engines / JOGL Development / Use of Stencil Buffer on: 2003-10-16 15:45:57
Hi everyone!
I'm having some trouble with the use of stencil-buffer.
My problem is that we aquaired an autostereoscopic Display and I wanted to test, if future applications written in jogl will be able to supprt the needed nesting of the renderings. To better explain: These Displays have some prisms on them that split a picture so that you can watch scenes in "true 3D" on them without any glasses or stuff like that. The Display we have is working with "vertical Interlace" which means that the information of the left-eye-picture is in every odd column while the right-eye-picture is in the even columns of the picture. The idea is to set up a stencil buffer filled with alternating columns of 1's and 0's. Then I could render the left-eye-picture using the stencil-Buffer-mode "equal" and after that turning the stencil-buffer-mode to "notequal" and render the right-eye-picture. I do have an example of that written in C++ but it uses pointer-arithmetics to calculate the stencil-buffer.. Sad
Anyone has some experience with that topic? Any help is appreciated.

Thanks in advance...


...Hoschi_S
10  Java Game APIs & Engines / JOGL Development / Re: unexpected GL_INVALID_OPERATION on: 2003-09-24 12:56:01
Oh, there you go! That was (one) of the problems. I had to rearrange the drawing-code a bit and now after throwing out the calls to glGetError() it works fine. Thanks a lot!


...Hoschi
11  Java Game APIs & Engines / JOGL Development / Re: unexpected GL_INVALID_OPERATION on: 2003-09-23 08:13:59
Ok, you're right. I should have done so in the first place...
Here you go. It is a little weird for it is a subset of a project but it works and produces the result I posted...:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
143  
144  
145  
146  
147  
148  
149  
150  
151  
152  
153  
154  
155  
156  
157  
158  
159  
160  
161  
162  
163  
164  
165  
166  
167  
168  
169  
170  
171  
172  
173  
174  
175  
176  
177  
178  
179  
180  
181  
182  
183  
184  
185  
186  
187  
188  
189  
190  
191  
192  
193  
194  
195  
196  
197  
198  
199  
200  
201  
202  
203  
204  
205  
206  
207  
208  
209  
210  
211  
212  
213  
214  
215  
216  
217  
218  
219  
220  
221  
222  
223  
224  
225  
226  
227  
228  
229  
230  
231  
232  
233  
234  
235  
236  
import java.awt.*;
import java.awt.event.*;
import net.java.games.jogl.*;

public class JoglProblem {

      static Animator animator = null;

      static class Renderer implements GLEventListener, KeyListener {

            static class Wall {

                  private float[] point0 = {0.0f, 0.0f, 0.0f};
                  private float[] point1 = {0.0f, 0.0f, 0.0f};
                  private float[] point2 = {0.0f, 0.0f, 0.0f};
                  private float[] point3 = {0.0f, 0.0f, 0.0f};

                  public Wall (float[] point0, float[] point1, float[] point2, float[] point3) {

                        this.point0 = point0;
                        this.point1 = point1;
                        this.point2 = point2;
                        this.point3 = point3;

                  }

                  public void draw (GL gl) {

                        gl.glVertex3f(point0[0], point0[1], point0[2]);
                        gl.glVertex3f(point1[0], point1[1], point1[2]);
                        gl.glVertex3f(point2[0], point2[1], point2[2]);
                        gl.glVertex3f(point3[0], point3[1], point3[2]);

                  }

            }

            private float      xpos = 0.0f;
            private float      zpos = 0.0f;
            private int heading = 180;
            private Frame frame;
            private Wall[] room = new Wall[16];
            private boolean debug = true;

            public Renderer (Frame f) {

                  float[] point0 = {-4.0f, -1.0f, 4.0f};
                  float[] point1 = {-4.0f, 1.0f, 4.0f};
                  float[] point2 = {-2.0f, -1.0f, 4.0f};
                  float[] point3 = {-2.0f, 1.0f, 4.0f};
                  float[] point4 = {-2.0f, -1.0f, 6.0f};
                  float[] point5 = {-2.0f, 1.0f, 6.0f};
                  float[] point6 = {-3.0f, -1.0f, 6.0f};
                  float[] point7 = {-3.0f, 1.0f, 6.0f};
                  float[] point8 = {-3.0f, -1.0f, 8.0f};
                  float[] point9 = {-3.0f, 1.0f, 8.0f};
                  float[] point10 = {-2.0f, -1.0f, 8.0f};
                  float[] point11 = {-2.0f, 1.0f, 8.0f};
                  float[] point12 = {-2.0f, -1.0f, 10.0f};
                  float[] point13 = {-2.0f, 1.0f, 10.0f};
                  float[] point14 = {0.0f, -1.0f, 10.0f};
                  float[] point15 = {0.0f, 1.0f, 10.0f};
                  float[] point16 = {2.0f, -1.0f, 10.0f};
                  float[] point17 = {2.0f, 1.0f, 10.0f};
                  float[] point18 = {2.0f, -1.0f, 8.0f};
                  float[] point19 = {2.0f, 1.0f, 8.0f};
                  float[] point20 = {3.0f, -1.0f, 8.0f};
                  float[] point21 = {3.0f, 1.0f, 8.0f};
                  float[] point22 = {3.0f, -1.0f, 6.0f};
                  float[] point23 = {3.0f, 1.0f, 6.0f};
                  float[] point24 = {2.0f, -1.0f, 6.0f};
                  float[] point25 = {2.0f, 1.0f, 6.0f};
                  float[] point26 = {2.0f, -1.0f, 4.0f};
                  float[] point27 = {2.0f, 1.0f, 4.0f};
                  float[] point28 = {4.0f, -1.0f, 4.0f};
                  float[] point29 = {4.0f, 1.0f, 4.0f};
                  float[] point30 = {-4.0f, -1.0f, 0.0f};
                  float[] point31 = {-4.0f, 1.0f, 0.0f};
                  float[] point32 = {4.0f, -1.0f, 0.0f};
                  float[] point33 = {4.0f, 1.0f, 0.0f};

                  frame = f;

                  room[0] = new Wall(point0, point1, point3, point2);
                  room[1] = new Wall(point2, point3, point5, point4);
                  room[2] = new Wall(point4, point5, point7, point6);
                  room[3] = new Wall(point6, point7, point9, point8);
                  room[4] = new Wall(point8, point9, point11, point10);
                  room[5] = new Wall(point10, point11, point13, point12);
                  room[6] = new Wall(point12, point13, point15, point14);
                  room[7] = new Wall(point14, point15, point17, point16);
                  room[8] = new Wall(point16, point17, point19, point18);
                  room[9] = new Wall(point18, point19, point21, point20);
                  room[10] = new Wall(point20, point21, point23, point22);
                  room[11] = new Wall(point22, point23, point25, point24);
                  room[12] = new Wall(point24, point25, point27, point26);
                  room[13] = new Wall(point26, point27, point29, point28);
                  room[14] = new Wall(point28, point29, point33, point32);
                  room[15] = new Wall(point30, point31, point1, point0);

            }

            public void display(GLDrawable gLDrawable) {

                  final GL gl = gLDrawable.getGL();
                  gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
                  gl.glLoadIdentity();
                  gl.glRotatef((float)heading, 0.0f, 1.0f, 0.0f);
                  gl.glTranslatef(xpos, 0.0f, -zpos);
                  if (debug) System.out.println("Scene setup with " + gLDrawable.getGLU().gluErrorString(gl.glGetError()));
                  draw(gLDrawable);
                  if (debug) System.out.println("Scene drawn with " + gLDrawable.getGLU().gluErrorString(gl.glGetError()));

            }

            private void draw (GLDrawable gLDrawable) {

                  final GL gl = gLDrawable.getGL();
                  gl.glBegin(GL.GL_QUADS);
                  gl.glColor3f(0.0f, 0.0f, 1.0f);
                  for (int i = 0; i < room.length; i++) {

                        room[i].draw(gl);

                  }
                  if (debug) System.out.println("Before glEnd() with " + gLDrawable.getGLU().gluErrorString(gl.glGetError()));
                  gl.glEnd();
                  if (debug) System.out.println("glEnd() with " + gLDrawable.getGLU().gluErrorString(gl.glGetError()));

            }

            public void init(GLDrawable gLDrawable) {

                  final GL gl = gLDrawable.getGL();
                  gl.glShadeModel(GL.GL_SMOOTH);
                  gl.glClearColor(1.0f, 1.0f, 1.0f, 0.5f);
                  gl.glClearDepth(1.0f);
                  gl.glEnable(GL.GL_DEPTH_TEST);
                  gl.glDepthFunc(GL.GL_LEQUAL);
                  gl.glHint(GL.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST);
                  gl.glDisable(GL.GL_CULL_FACE);
                  if (debug) System.out.println("Init finished with " + gLDrawable.getGLU().gluErrorString(gl.glGetError()));

            }

            public void reshape(GLDrawable gLDrawable, int x, int y, int width, int height) {

                  final GL gl = gLDrawable.getGL();
                  final GLU glu = gLDrawable.getGLU();
                  if (height <= 0)
                        height = 1;
                  final float h = (float)width / (float)height;
                  gl.glViewport(0, 0, width, height);
                  gl.glMatrixMode(GL.GL_PROJECTION);
                  gl.glLoadIdentity();
                  glu.gluPerspective(45.0f, h, 1.0, 20.0);
                  gl.glMatrixMode(GL.GL_MODELVIEW);
                  gl.glLoadIdentity();
                  if (debug) System.out.println("Reshape finished with " + gLDrawable.getGLU().gluErrorString(gl.glGetError()));

            }

            public void keyPressed(KeyEvent e) {

                  if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {

                        animator.stop();
                        System.exit(0);

                  }
                  if (e.getKeyCode() == KeyEvent.VK_RIGHT) {

                        heading ++;
                        if (heading >= 181)
                              heading = -179;

                  }
                  if (e.getKeyCode() == KeyEvent.VK_LEFT) {

                        heading--;
                        if (heading <= -181)
                              heading = 179;

                  }
                  if (e.getKeyCode() == KeyEvent.VK_DOWN) {

                        float xdifference = ((float) (Math.sin(((double)heading / 180.0) * Math.PI) * 0.05f));; // Move On The X-Plane Based On Player Direction
                       float zdifference = ((float) (Math.cos(((double)heading / 180.0) * Math.PI) * 0.05f)); // Move On The Z-Plane Based On Player Direction
                       xpos += xdifference;
                        zpos += zdifference;

                  }
                  if (e.getKeyCode() == KeyEvent.VK_UP) {

                        float xdifference = ((float) (Math.sin(((double)heading / 180.0) * Math.PI) * 0.05f)); // Move On The X-Plane Based On Player Direction
                       float zdifference = ((float) (Math.cos(((double)heading / 180.0) * Math.PI) * 0.05f)); // Move On The Z-Plane Based On Player Direction
                       xpos -= xdifference;
                        zpos -= zdifference;

                  }

            }

            public void keyTyped(KeyEvent e) {}
            public void keyReleased(KeyEvent e) {}

            public void displayChanged(GLDrawable gLDrawable, boolean modeChanged, boolean deviceChanged) {}

      }

      public static void main(String[] args) {

            Frame frame = new Frame("Jogl Problem");
            GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());
            Renderer renderer = new Renderer(frame);
            canvas.addGLEventListener(renderer);
            canvas.addKeyListener(renderer);
            frame.add(canvas);
            frame.setSize(640, 480);
            animator = new Animator(canvas);
            frame.addWindowListener(new WindowAdapter() {

                  public void windowClosing(WindowEvent e) {

                        animator.stop();
                        System.exit(0);

                  }

            });
            frame.show();
            animator.start();

      }

}


Greetz...


...Hoschi
12  Java Game APIs & Engines / JOGL Development / Re: unexpected GL_INVALID_OPERATION on: 2003-09-22 08:28:51
Sorry to tell you bad news but I experience the same problem but I'm running the newest version of jogl from september. I have a little testclass where there's nothing but glVertex3f() between glBegin() and glEnd().
So there must be something else to think about...

Greetz...


...Hoschi
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (12 views)
2014-04-15 18:08:23

BurntPizza (11 views)
2014-04-15 03:46:01

UprightPath (24 views)
2014-04-14 17:39:50

UprightPath (10 views)
2014-04-14 17:35:47

Porlus (27 views)
2014-04-14 15:48:38

tom_mai78101 (49 views)
2014-04-10 04:04:31

BurntPizza (108 views)
2014-04-08 23:06:04

tom_mai78101 (208 views)
2014-04-05 13:34:39

trollwarrior1 (176 views)
2014-04-04 12:06:45

CJLetsGame (182 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!