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 8368715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:27:05+00:00 2026-06-09T13:27:05+00:00

I’m using LWJGL for its OpenGL bindings and I’m trying to draw a quad

  • 0

I’m using LWJGL for its OpenGL bindings and I’m trying to draw a quad with a texture. I have done so successfully, but there is a strange side-effect and I’m unsure why it’s presenting itself.

The following code executes when first loading the texture (before the first render). I save the value of textureID for when I bind the texture/draw the quad. The following set-up code is taken from an SO answer found here.

int textureID = GL11.glGenTextures(); // Generate texture ID

GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureID); // Bind texture ID

// Setup wrap mode
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP);

// Setup texture scaling filtering
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);

// Send texel data to OpenGL
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA8, image.getWidth(), image.getHeight(), 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffer);

In the rendering loop, I draw the quad with the following code:

int texture = TextureLoader.loadTexture(TextureLoader.loadImage("/pc_run/run3.png"));

GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture);

GL11.glBegin(GL11.GL_QUADS);
{
    GL11.glTexCoord2f(0.0f, 0.0f);
    GL11.glVertex2f(-hw, -hh);

    GL11.glTexCoord2f(1.0f, 0.0f);
    GL11.glVertex2f(+hw, -hh);

    GL11.glTexCoord2f(1.0f, 1.0f);
    GL11.glVertex2f(+hw, +hh);

    GL11.glTexCoord2f(0.0f, 1.0f);
    GL11.glVertex2f(-hw, +hh);
}
GL11.glEnd();

So far, this works (and is also wrapped between glPushMatrix()/glPopMatrix() calls). However, whatever I have drawn to the GLContext so far is not displayed. Removing the call to GL11.glTexImage2D in the initialization code, the sprite is not displayed, but everything else (non-textured) is displayed correctly.

  • 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-06-09T13:27:06+00:00Added an answer on June 9, 2026 at 1:27 pm

    You need to disable texturing (glDisable(GL_TEXTURE_2D)) for objects that are not supposed to be textured.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I have thousands of HTML files to process using Groovy/Java and I need to
I am trying to loop through a bunch of documents I have to put
I'm trying to select an H1 element which is the second-child in its group
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but

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.