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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:53:41+00:00 2026-05-26T14:53:41+00:00

I have been running into issues with OpenGL rendering on different computers: Works: Intel

  • 0

I have been running into issues with OpenGL rendering on different computers:

Works:
Intel HD3000 / Sandy bridge:
ATI 6950
ATI 6970m
ATI 5670m
Quadro FX 2000

Does not work:
Nvidia mobility 9600 gt
Quadro FX 1800

when the line of code “renderLines()” is called, nothing appears on the screen for the graphics cards that “does not work”. Without “renderLines()”, everything works as expected on all the graphics cards I have tested.

“renderSprites()” is very similar to renderLines(), the only difference is that it is rendering quads to screen and not lines.

void GraphicsEngineOGL3::update()
{
    this->renderSprites();
    this->renderLines(); // this is the offending line of code
    SDL_GL_SwapBuffers();
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    checkError();
}

void GraphicsEngineOGL3::renderLines()
{
    if(lineBuffer_.empty()) // note: lineBuffer is a std::Vector<Vertex>
        return;

    glEnableClientState(GL_VERTEX_ARRAY);           // DEPRECATED in OGL 3.1
    glEnableClientState(GL_COLOR_ARRAY);

    // Note: glVertexPointer is deprecated, change to glVertexAttribPointer
    glVertexPointer(3, GL_FLOAT, sizeof(Vertex), &(lineBuffer_[0].x));  // DEPRECATED in OGL 3.1
    glColorPointer(4, GL_BYTE, sizeof(Vertex), &(lineBuffer_[0].r));

    glBindBuffer( GL_ARRAY_BUFFER, VBOs_[activeVBO_]);
    glBufferData( GL_ARRAY_BUFFER, lineBuffer_.size() * sizeof(Vertex), &(lineBuffer_[0]), GL_STREAM_DRAW);
    glDrawArrays( GL_LINES, 0, lineBuffer_.size()); // where 4 is the number of vertices in the quad
    glBindBuffer( GL_ARRAY_BUFFER, 0); // Binding the buffer object with 0 switchs off VBO operation. 

    glDisableClientState(GL_VERTEX_ARRAY);
    glDisableClientState(GL_COLOR_ARRAY);

    lineBuffer_.clear();
    checkError();
}
  • 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-26T14:53:42+00:00Added an answer on May 26, 2026 at 2:53 pm

    At the moment you first set the vertex arrays to source their data from a RAM array (_lineBuffer) and then you bind a VBO and copy _lineBuffer‘s data into it. This will probably not do what you want, anyway (though it’s hard to say what you want to do there).

    Always keep in mind, that the gl...Pointer calls source their data from the currently bound GL_ARRAY_BUFFER, or from CPU RAM if none (0) is bound (glDrawArrays doesn’t care about the currently bound VBO). So in your case the glBindBuffer call simply has no effect, your arrays source their data from the CPU array _lineBuffer and not from the VBO. If you want them to use the VBO, you have to bind the buffer before the gl...Pointer calls, but in this case make sure the address is actually only a byte offset into the buffer and not a real RAM address:

    glBindBuffer( GL_ARRAY_BUFFER, VBOs_[activeVBO_]);
    glBufferData( GL_ARRAY_BUFFER, lineBuffer_.size() * sizeof(Vertex), &(lineBuffer_[0]), GL_STREAM_DRAW);
    
    glVertexPointer(3, GL_FLOAT, sizeof(Vertex), (const char*)0+offsetof(Vertex,x));  //use the current VBO
    glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Vertex), (const char*)0+offsetof(Vertex,r));
    
    glBindBuffer( GL_ARRAY_BUFFER, 0);    //can already be unbound
    
    glDrawArrays( GL_LINES, 0, lineBuffer_.size());
    

    Note that I used GL_UNSIGNED_BYTE for the color data, which is more natural for colors than a signed type. With GL_BYTE it might even be, that your colors get transformed to [-1,1] instead of [0,1] which is then clamped (and not linearly transformed) to [0,1].

    But if you really want the arrays to source their data from _lineBuffer and not from the VBO (which I doubt), then the buffer function calls are unneccessary anyway and you can just omit them.

    Note that your code, though very strange and surely wrong, should nevertheless work. So I don’t know if this really was the problem of the question, but it definitely was a problem. But at most, I would supect the use of GL_BYTE instead of GL_UNSIGNED_BYTE to confuse your colors or be implemented strangely in some drivers, as it is not a very usual path.

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

Sidebar

Related Questions

Ok, so I have been running into some threading issues with OpenGL on Windows.
I have been running into some issues with animating multiple CALayers at the same
So I have been running into all kinds of interesting problems in VisualStudio 2008
I have been trying to learn Erlang and have been running into some problems
I have been running Apache HTTPD in 64bit mode by stripping out the 32bit
I have been running SQL Server 2005 Express Management Studio (SSMSE), and I now
I have been running Visual Studio 2008 Team Edition for some time now and
I have been running drush scripts (for Drupal ) with Cygwin on my relatively
So I have been running the numbers for Azure and RackSpace Cloud Servers and
I have been porting oracle selects, and I have been running across a lot

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.