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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:49:18+00:00 2026-06-11T08:49:18+00:00

I have a simple OpenGL program using SDL on Linux that just attempts to

  • 0

I have a simple OpenGL program using SDL on Linux that just attempts to load and print the OpenGL version.

cout << "GL_VERSION  : " << glGetString(GL_VERSION) << endl;

When I run the program it just hangs, with the output as below… it basically appears to be “waiting” for the OpenGL library to respond:

GL_VERSION  : 

It is linked against the Nvidia Ubuntu OpenGL libraries (nvidia-current-dev pkg). I do have Mesa installed on system also, but as you can see from ‘lsof’ it appears Nvidia is being used.

sdl-hack 29491 x  mem    REG               8,18 34639056 4212198 /usr/lib/nvidia-current/libnvidia-glcore.so.295.40
sdl-hack 29491 x  mem    REG               8,18    11728 4212207 /usr/lib/nvidia-current/tls/libnvidia-tls.so.295.40
sdl-hack 29491 x  mem    REG               8,18  1054832 4212209 /usr/lib/nvidia-current/libGL.so.295.40

Please note that I did have to install ‘libglu1-mesa-dev’ to provide glu.h as this is not part of the Nvidia dev pkg.

Not really sure how to debug this one, can someone point me in the right direction?

  • 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-11T08:49:19+00:00Added an answer on June 11, 2026 at 8:49 am

    I solved this. I had followed the code at the link below to get an initial working version:

    http://www.sdltutorials.com/sdl-opengl-tutorial-basics

    The article notes a number of set attribute calls:

    SDL_GL_SetAttribute(SDL_GL_RED_SIZE,        8);
    SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE,      8);
    SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE,       8);
    SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE,      8);
    
    SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE,      16);
    SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE,        32);
    
    SDL_GL_SetAttribute(SDL_GL_ACCUM_RED_SIZE,    8);
    SDL_GL_SetAttribute(SDL_GL_ACCUM_GREEN_SIZE,    8);
    SDL_GL_SetAttribute(SDL_GL_ACCUM_BLUE_SIZE,    8);
    SDL_GL_SetAttribute(SDL_GL_ACCUM_ALPHA_SIZE,    8);
    
    SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS,  1);
    SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES,  2);
    

    These were after the SDL_Init but before SDL_SetVideoMode calls. Removing them made the program work fine!

    The strange thing is, the issue only occurred on Linux with both Mesa and Nvidia GL libraries. Mac OSX was fine.

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

Sidebar

Related Questions

I have written a simple OpenGL program in C++ that displays a line joining
I have a simple OpenGL program and trying to draw an instanced array that
OK, I have made simple rectangular using OpenGL, and it looks pretty simple glNormal3f(0.0f,
Suppose I have 5 GLSL shaders that I successfully loaded in my opengl program.
I am using Tao framework and I have a simple opengl control. How can
I have some simple OpenGL ES code in C++ that I've run on a
I’m trying to compile a very simple Hello world OpenGL 3.3 program using FreeGLUT.
I am making my first program using Java3D. I have setup some transformGroups that
I am writing a simple program that uses perspective projection and I have a
I'm working on some cross-platform code using OpenGL and SDL, but have immediately run

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.