LWJGL Forum

Programming => OpenGL => Topic started by: fictiveLaark on May 04, 2010, 05:01:53

Title: Why is everything red?
Post by: fictiveLaark on May 04, 2010, 05:01:53
Right now all my textures seem to have a red color blended into them.  What's more, this happens when I run my game from Netbeans and run the jar in the command prompt, but not when I double click my jar.  I guess the program is still therefore distributable but it's weird, and kind of annoying since I'm typically running the game from my IDE.

I'm running lwjgl 2.2.2(2.4.2 gave me a Exception in thread "main" java.lang.NoSuchMethodError: Method org.lwjgl.openal.AL10.alEnable(I)V is not declared as native error), Windows 7 64-bit, and this is the code my program uses to draw textures.

public static void drawTexture(int texture, Rectangle destination, Rectangle source, Effects effects) {
       float left = source.getX();
       float right = source.getX() + source.getWidth();
       float top = source.getY() + source.getHeight();
       float bottom = source.getY();

       if(effects.isFlipHorizontal()){
           float temp = left;
           left = right;
           right = temp;
       }

       //GL11.glColor4f(effects.color.x, effects.color.y, effects.color.z, effects.color.w);
       GL11.glColor3f(1, 1, 1);
       GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture);

       GL11.glEnable(GL11.GL_TEXTURE_2D);
       GL11.glBegin(GL11.GL_QUADS);
           GL11.glTexCoord2f(left, top);
           GL11.glVertex2f(destination.getX(), destination.getY());
           GL11.glTexCoord2f(right, top);
           GL11.glVertex2f(destination.getX() + destination.getWidth(), destination.getY());
           GL11.glTexCoord2f(right, bottom);
           GL11.glVertex2f(destination.getX() + destination.getWidth(), destination.getY() + destination.getHeight());
           GL11.glTexCoord2f(left, bottom);
           GL11.glVertex2f(destination.getX(), destination.getY() + destination.getHeight());
       GL11.glEnd();
       GL11.glDisable(GL11.GL_TEXTURE_2D);
   }


Title: Re: Why is everything red?
Post by: wondersonic on May 06, 2010, 10:27:33
Hello,
Quote from: wondersonic on May 06, 2010, 10:25:27See this thread, it may be linked to PNG pictures loading since JDK 1.6.0_18.

WS
Title: Re: Why is everything red?
Post by: Fool Running on May 06, 2010, 12:17:10
I think wondersonic meant this link: http://lwjgl.org/forum/index.php/topic,3332.0.html
Title: Re: Why is everything red?
Post by: fictiveLaark on May 07, 2010, 07:38:33
That seems to have been it.  Would this mean that my JDK is up to date but JRE old or something?