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

  • Home
  • SEARCH
  • 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 8979475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:51:23+00:00 2026-06-15T19:51:23+00:00

I am working with SDL and OpenGL, I create the SDL_Surface and SDL_SetVideoMode: SDL_Init(SDL_INIT_EVERYTHING);

  • 0

I am working with SDL and OpenGL, I create the SDL_Surface and SDL_SetVideoMode:

SDL_Init(SDL_INIT_EVERYTHING);

const SDL_VideoInfo * dinfo = SDL_GetVideoInfo();

// Setup the surface of SDL
if(configurer::fullscreened){
    data::Wnd_Surface = SDL_SetVideoMode(configurer::window_width,configurer::window_height,dinfo->vfmt->BitsPerPixel,SDL_FULLSCREEN | SDL_OPENGL);
}else{
    data::Wnd_Surface = SDL_SetVideoMode(configurer::window_width,configurer::window_height,16,SDL_OPENGL);
}
if(data::Wnd_Surface==0){
    return -1;
}

SDL_WM_SetCaption("Test", "Test");

SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);

// Initialize GLEW
if(glewInit()!=0){
    cout << "Failed to start glew";
    return -1;
}

I init it in my main function, then I have the following (on the main function):

while(!data::terminate){
    AscMainLoop();
    SDL_Delay(80);
}
return 0;

Everything fine. My AscMainLoop function:

int timerelapse = SDL_GetTicks();
//Check for key events
    /* BLA BLA BLA *(
AscUpdateComponents(); // Update matrixes and bla bla bla...
AscRender();// Paint

// Fps Counter Update
    /* BLA BLA BLA */

SDL_GL_SwapBuffers();// Swap the buffers of our screen

Ok, I am having an issue, I run the application, but the screen does not answer, I think the problem is the while loop on the main.
The window opens, but I can’t drag it, resize it, it’s like a wait status on the window (With the funny “please wait” cursor of windows 7) activates.
I already tried to put the main loop in a thread. I don’t know what’s happening…

Edit: It’s like a freez status caused by the loop at the main function

  • 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-15T19:51:24+00:00Added an answer on June 15, 2026 at 7:51 pm

    You need to process your SDL_Events either in your while or in your AscMainLoop by doing something like:

    SDL_Event Event;
    
    while(SDL_PollEvent(&Event))
    {
        // Later, you'll be adding your code that handles keyboard / mouse input here
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a c++ code that uses SDL/opengl. Is this possible to create
I'm trying to convert a SDL surface to an openGL texture using a snippet
I'm working on some cross-platform code using OpenGL and SDL, but have immediately run
I have a sdl/opengl game I am working on for fun. I get a
I'm working on a program with OpenGL/SDL, but the window won't draw. The window's
VC++ 2010, SDL, OpenGL, GLSL I am working on this class as a way
I'm working with SDL and OpenGL, creating a fairly simple application. I created a
I am working through the SDL tutorials over at http://lazyfoo.net/SDL_tutorials/index.php and I'm stuck on
While writing a simple game using SBCL, CL-OPENGL, and Lispbuilder-SDL, I can across a
This is for a small game project with SDL on MinGW/Windows. I am working

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.