Can someone help me?

Started by Hungry Joe, March 24, 2004, 19:56:25

Previous topic - Next topic

Hungry Joe

My screen is all black. I think there ought to be a red triangle in it. And maybe a white square.

http://82.35.9.23/game.rar anyone got any ideas?

cfmdobbie

Got a zip file, or post some source code?

At a guess, make sure you're calling Window.paint() at the end of each frame to flush all drawing and swap the buffers.
ellomynameis Charlie Dobbie.

Hungry Joe

that link should let you download all my source.

cfmdobbie

But as a rar - I don't do rars!  Got a zip?  Or a tarball?  Or just a text file?
ellomynameis Charlie Dobbie.

Hungry Joe



what the heck is going on now?? This should be a plain white triangle strip displaying a quad. Heres my GL ini

private void init_gl() {
      GL.glShadeModel(GL.GL_SMOOTH); // Enable Smooth Shading
      GL.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Black Background
      GL.glClearDepth(1.0); // Depth Buffer Setup
      GL.glEnable(GL.GL_DEPTH_TEST); // Enables Depth Testing
      GL.glDepthFunc(GL.GL_LEQUAL); // The Type Of Depth Testing To Do
      GL.glMatrixMode(GL.GL_PROJECTION); // Select The Projection Matrix
      GL.glLoadIdentity(); // Reset The Projection Matrix
      // Calculate The Aspect Ratio Of The Window
      GLU.gluPerspective(45.0f, (float) Display.getWidth()
            / (float) Display.getHeight(), 0.1f, 100.0f);
      GL.glMatrixMode(GL.GL_MODELVIEW); // Select The Modelview Matrix
      // Really Nice Perspective Calculations
      GL.glHint(GL.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST);
      //sync to monitor
      Window.setVSyncEnabled(true);
   }

Hungry Joe

wow othis is the third time ive fixed something tonight without any help! I changed the method used for the depthbuffer to GEQUAL instead of LEQUAL

princec

Normally you'd be using glClearDepth(0.0f).

Cas :)

Hungry Joe

weird. today I had to change it back to LEQUAL to get rid of the artifacting.

Thanks for the tip princec,I just copied that out of a NeHe example in sourceforge and would never have spotted it.