Why is everything red?

Started by fictiveLaark, May 04, 2010, 05:01:53

Previous topic - Next topic

fictiveLaark

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);
    }



wondersonic

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
S.

Fool Running

Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

fictiveLaark

That seems to have been it.  Would this mean that my JDK is up to date but JRE old or something?