Help! Urgent Bug! Shading issue with slick util.

Started by GenomeGame, May 17, 2013, 22:47:07

Previous topic - Next topic

GenomeGame

Hello members of the LWJGL forum,

I am new to workng with LWJGL, and i seem to be having a bit of an issue with lwjgl 2.9.0 and slick-util: I bind a texture with click-util, and draw it on a quad with openGL. However, when i go to draw a quad without entering the texcoord2d functions, which should, to my knowledge, not call upon a texture, by colored quad gets displayed darkened, as if there were a half-opaque black quad on top of it. Here is my code for rendering a simple gui (ignore the wierd setup, just look at the GL11.something code):

NOTE: I think i have to do something to "unbind" the texture, but I don't know if there is a command like that.

package gui;

import org.lwjgl.opengl.*;

import core.Genome;

public class GUIMainMenu extends GUI {
   
   int counter;
   
   public GUIMainMenu(int arg0, int arg1, int arg2, int arg3) {
      
      super(arg0, arg1, arg2, arg3);
      
   }
   
   public void tick() throws Exception {
      
      if (counter < 1000) {
         
         counter ++;
         
      }
      
      GL11.glColor3d(0, 0, 1);
      
      GL11.glBegin(GL11.GL_QUADS);
      
      GL11.glVertex2f(0, 0);
      
      GL11.glVertex2f(w, 0);
      
      GL11.glVertex2f(w, h);
      
      GL11.glVertex2f(0, h);
      
      GL11.glEnd();
      
      if (Genome.instance.tick.ticks % 10 <= 5) {
         
         GL11.glColor3d(1, 1, 1);
         
         GL11.glBegin(GL11.GL_QUADS);
         
         GL11.glVertex2f(0, h * 7 / 8);
         
         GL11.glVertex2f(w / 16, h * 7 / 8);
         
         GL11.glVertex2f(w / 16, h * 29 / 32);
         
         GL11.glVertex2f(0, h * 29 / 32);
         
         GL11.glEnd();
         
      }
      
      if (counter >= 20) {
         
         GL11.glColor3d(1, 1, 1);
         
         Genome.instance.screen.textureMap.loadTexture("initializing.png");
         
         GL11.glBegin(GL11.GL_QUADS);
         
         GL11.glTexCoord2f(0, 1);
         
         GL11.glVertex2f(0, h * 3 / 4);
         
         GL11.glTexCoord2f(1, 1);
         
         GL11.glVertex2f(w * 1 / 2, h * 3 / 4);
         
         GL11.glTexCoord2f(1, 0);
         
         GL11.glVertex2f(w * 1 / 2, h * 7 / 8);
         
         GL11.glTexCoord2f(0, 0);
         
         GL11.glVertex2f(0, h * 7 / 8);
         
         GL11.glEnd();
         
      }
      
   }
   
}

All help is appreciated!

Fool Running

I'm not sure how this is an "Urgent Bug!" :P

I would normally just say "Google is your friend", but I'm feeling unusually helpful today:
GL11.glDisable(GL11.GL_TEXTURE_2D);
and
GL11.glEnable(GL11.GL_TEXTURE_2D);


EDIT: Realized you double-posted and someone already answered somewhere else. :-\
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D