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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:49:21+00:00 2026-06-13T04:49:21+00:00

Here is my code that setups texture coords to draw symmetrical quads: GLfloat defaultTexCoords[]

  • 0

Here is my code that setups texture coords to draw symmetrical quads:

GLfloat defaultTexCoords[] = {
    0.0f, 0.0f, // 0 (0,0)
    1.0f, 0.0f, // 1 (1,0)
    1.0f, 1.0f, // 2 (1,1)
    0.0f, 1.0f  // 3 (0,1)
};

// VERTEX ARRAY
GLfloat mainVertexArray[] = {
    0.0f,              0.0f,              // 0 1
    0.0f /* size_x */, 0.0f,              // 2 3
    0.0f /* size_x */, 0.0f /* size_y */, // 4 5
    0.0f,              0.0f /* size_y */  // 6 7
};

// VERTEX & TEXTURE INDEXES
GLushort defaultIndices[] = { 0, 1, 3, 2 };

glEnable( GL_TEXTURE_2D );
glEnableClientState( GL_TEXTURE_COORD_ARRAY );
glBindTexture( GL_TEXTURE_2D, m_texId );
glTexCoordPointer( 2, GL_FLOAT, 0, defaultTexCoords );

// Here the cells size_x, size_y, etc. in VERTEX ARRAY
// are overwritten with dimensions of quad to draw
// ... some mainVertexArray[...] = ...

glEnableClientState( GL_VERTEX_ARRAY );
glVertexPointer(2, GL_FLOAT, 0, mainVertexArray);
glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_SHORT, indices);

The problem is that in the drawed quad, the one, single line at top is basically copied from bottom of the texture. It is clearly visible that brightness of the y=0 line changes the same as the bottom (copied) line.

What can be the problem?

  • 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-13T04:49:23+00:00Added an answer on June 13, 2026 at 4:49 am

    Switch your wrap mode to GL_CLAMP_TO_EDGE.

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

Sidebar

Related Questions

I cannot get this to work, here is code that I found in another
Here is my Code that I'm trying to run on Mac OS X: import
Here is the code that doesn't work: Enemy.strength = srand((unsigned)time(NULL)) % 10; Enemy.strength is
Here is my code that adds a line to the grid by pressing the
Here is the code that cause me problem since few hours: TabItem newTab =
Here's my code that is not working: print To: ; my $to=<>; chomp $to;
Here is my code that fails: bool Table::win(const Card &card) { for (int i
Here is the code that I have for my cell of my UITableView: forKeys:[NSArray
I have some code here that uses bitsets to store many 1 bit values
I've got some code here that works great on IPv4 machines, but on our

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.