Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7531903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:17:55+00:00 2026-05-30T05:17:55+00:00

texture is not loading properly it has lines and it is backwards. what is

  • 0

texture is not loading properly it has lines and it is backwards. what is wrong.
EDIT: I chopped some irrelevant code off so some things may look weird.

package package01;


import java.io.IOException;
import org.lwjgl.opengl.GL11;
import org.newdawn.slick.opengl.Texture;
import org.newdawn.slick.opengl.TextureLoader;
import org.newdawn.slick.util.ResourceLoader;


public class Graph {

    ...

public void initGraph(){

    ... 


        Texture strbutton,defbutton,vitbutton,intbutton,dexbutton,agibutton;
        try {
            strbutton = TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("/res/grphbuttons/strbutton.png"));
            GL11.glEnable(GL11.GL_TEXTURE_2D);
            strbutton.bind();
        GL11.glBegin(GL11.GL_QUADS);
            GL11.glTexCoord2f(0,0);
            GL11.glVertex2f(70,120);
            GL11.glTexCoord2f(0,1);
            GL11.glVertex2f(70,120+strbutton.getImageHeight());
            GL11.glTexCoord2f(1,1);
            GL11.glVertex2f(70+strbutton.getImageWidth(),120+strbutton.getImageHeight());
            GL11.glTexCoord2f(1,0);
            GL11.glVertex2f(70+strbutton.getImageWidth(),120);

        GL11.glEnd();
            GL11.glDisable(GL11.GL_TEXTURE_2D);
        } catch (IOException e) {
            e.printStackTrace();
        }

    ...

    }
}

This is the main class

package package01;

import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.GL11;

public class DisplayScreen {
CharCreateScreen ccs = new CharCreateScreen();


void start(){
    initGL(1000,562);

    while(!Display.isCloseRequested()){
        ccs.openccscreen();
        Display.update();


    }
    Display.destroy();
}
void initGL(int width, int height){
    try {
        Display.setDisplayMode(new DisplayMode(1000,562));
        Display.create();
        Display.setVSyncEnabled(true);
    } catch(LWJGLException e) {
        e.printStackTrace();
        System.exit(0); 
    }

    GL11.glClearColor(0.9f, 0.9f, 1.0f, 0.0f);


    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glLoadIdentity();
    GL11.glOrtho(-500, 500, -281, 281, -1, 1);
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
}


public static void main(String[] args){

    DisplayScreen ds = new DisplayScreen();
    ds.start();

}
}

I keep encountering problems with loading the texture to slick, what’s the problem this time? Can’t I just load the image and put it on the screen without having this weird applying to textures? I’m only using slick to be able to upload a few images to use as buttons is there an easier way.

Here is what comes out. https://i.stack.imgur.com/onto1.png The button is labeled ‘STR’ or at least it should be. And what are those lines on the top and right?!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:17:56+00:00Added an answer on May 30, 2026 at 5:17 am

    Try change it to

    GL11.glTexCoord2f(0,0);
    GL11.glTexCoord2f(1,0);
    GL11.glTexCoord2f(1,1);
    GL11.glTexCoord2f(0,1);
    

    From

    GL11.glTexCoord2f(0,0);
    GL11.glTexCoord2f(0,1);
    GL11.glTexCoord2f(1,1);
    GL11.glTexCoord2f(1,0);
    

    Didn’t have a good look at your code though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

ok so i can load a mesh perfectly but loading its texture is not
I'm stuck at not being able to map texture to a square in openGLES.
I have a templated class called PooledResource . It handles loading things like textures
I'm loading an image onto a texture map with GLGE (sorta like webGl). However
I have a problem with the D3DX11CreateShaderResourceViewFromMemory helper function. I read some texture from
I have seen many code samples for loading textures for OpenGL , many of
I am displaying a texture that I want to manipulate without out affecting the
I want to texture a sphere with a cube map. So far my research
I'm interested in texture streaming in DirectX but google seems unhelpful. Maybe I just
If I have a texture, is it then possible to generate a normal-map for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.