Skip to main content
deleted 40 characters in body
Source Link

By experimenting, we have found that adding a short delay(~100ms) at the very start(after SDL_CreateWindow) fixes the issue. This might mean that there iswas a conflict between the OS's Dekstop/Window Manager and SDL when lastthe latter renders too quickly. So, adding aA short delay tellsforces SDL to wait some time while OS's Dekstop/Window Manager handles the window's creation. Also, this This might also be something related to OS's (D/E)M or itsthe compositor(i.e. compiz), which in our case KDE Plasma- compiz.

In other words, the changes:

...
        // Create window
        window = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );
        SDL_Delay(100); // A short delay should be put here(if doesn't work try increasing delay)
         
if( window == NULL )
        {
...

After thatWith these changes, athe white window opens successfully.

Already'Already wrote to the author of LazyFoo and hopefully he'll committhey will alter the tutorial.

By experimenting, we have found that adding a short delay(~100ms) at the very start(after SDL_CreateWindow) fixes issue. This might mean that there is a conflict between OS's Dekstop/Window Manager and SDL when last renders too quickly. So, adding a short delay tells SDL to wait some time while OS's Dekstop/Window Manager handles window's creation. Also, this might be something related to OS's (D/E)M or its compositor(i.e. compiz) in our case KDE Plasma.

In other words, the changes:

...
        //Create window
        window = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );
        SDL_Delay(100); // A short delay should be put here(if doesn't work try increasing delay)
        if( window == NULL )
        {
...

After that, a white window opens successfully.

Already wrote to author of LazyFoo and hopefully he'll commit tutorial.

By experimenting, we found that adding a short delay(~100ms) at the very start(after SDL_CreateWindow) fixes the issue. This might mean that there was a conflict between the OS's Dekstop/Window Manager and SDL when the latter renders too quickly. A short delay forces SDL to wait some time while OS's Dekstop/Window Manager handles the window's creation. This might also be something related to the compositor, which in our case - compiz.

In other words, the changes:

...
// Create window
window = SDL_CreateWindow("SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN);
SDL_Delay(100); // A short delay should be put here(if doesn't work try increasing delay)
 
if(window == NULL)
{
...

With these changes, the white window opens successfully.

'Already wrote to the author of LazyFoo and hopefully they will alter the tutorial.

deleted 21 characters in body
Source Link

By experimenting, we have found that adding a short delay(~100ms) at the very start(after SDL_CreateWindow) fixes issue. This might mean that there is a conflict between OS's Dekstop/Window Manager and SDL when last renders too quickly. So, adding a short delay tells SDL to wait some time while OS's Dekstop/Window Manager handles window's creation. Also, this might be something related to OS's (D/E)M or its compositor(i.e. compiz) in our case KDE Plasma.

In other words, the changes:

...
        //Create window
        window = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );
        SDL_Delay(100); // A short delay should be put here(if doesn't work try increasing delay)
        if( window == NULL )
        {
...

After that, a white window opens successfully.

Already wrote to author of LazyFoo and hopefully he'll commit tutorial.

Best regards, V7

By experimenting, we have found that adding a short delay(~100ms) at the very start(after SDL_CreateWindow) fixes issue. This might mean that there is a conflict between OS's Dekstop/Window Manager and SDL when last renders too quickly. So, adding a short delay tells SDL to wait some time while OS's Dekstop/Window Manager handles window's creation. Also, this might be something related to OS's (D/E)M or its compositor(i.e. compiz) in our case KDE Plasma.

In other words, the changes:

...
        //Create window
        window = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );
        SDL_Delay(100); // A short delay should be put here(if doesn't work try increasing delay)
        if( window == NULL )
        {
...

After that, a white window opens successfully.

Already wrote to author of LazyFoo and hopefully he'll commit tutorial.

Best regards, V7

By experimenting, we have found that adding a short delay(~100ms) at the very start(after SDL_CreateWindow) fixes issue. This might mean that there is a conflict between OS's Dekstop/Window Manager and SDL when last renders too quickly. So, adding a short delay tells SDL to wait some time while OS's Dekstop/Window Manager handles window's creation. Also, this might be something related to OS's (D/E)M or its compositor(i.e. compiz) in our case KDE Plasma.

In other words, the changes:

...
        //Create window
        window = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );
        SDL_Delay(100); // A short delay should be put here(if doesn't work try increasing delay)
        if( window == NULL )
        {
...

After that, a white window opens successfully.

Already wrote to author of LazyFoo and hopefully he'll commit tutorial.

deleted 1 character in body
Source Link

By experimenting, we have found that adding a short delay(~100ms) at the mostvery start(after SDL_CreateWindow) fixes issue. This might meansmean that there is a conflict between OS's Dekstop/Window Manager and SDL when last renders too quickly. So, adding a short delay tells SDL to wait some time while OS's Dekstop/Window Manager handles window's creation. Also, this might be something related to OS's (D/E)M or its compositor(i.e. compiz) in our case KDE Plasma.

In other words, the changes:

...
        //Create window
        window = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );
        SDL_Delay(100); // A short delay should be put here(if doesn't work try increasing delay)
        if( window == NULL )
        {
...

After that, a white window opens successfully.

Already wrote to author of LazyFoo and hopefully he'll commit tutorial.

Best regards, V7

By experimenting, we have found that adding a short delay(~100ms) at the most start(after SDL_CreateWindow) fixes issue. This might means that there is a conflict between OS's Dekstop/Window Manager and SDL when last renders too quickly. So, adding a short delay tells SDL to wait some time while OS's Dekstop/Window Manager handles window's creation. Also, this might be something related to OS's (D/E)M or its compositor(i.e. compiz) in our case KDE Plasma.

In other words, the changes:

...
        //Create window
        window = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );
        SDL_Delay(100); // A short delay should be put here(if doesn't work try increasing delay)
        if( window == NULL )
        {
...

After that, a white window opens successfully.

Already wrote to author of LazyFoo and hopefully he'll commit tutorial.

Best regards, V7

By experimenting, we have found that adding a short delay(~100ms) at the very start(after SDL_CreateWindow) fixes issue. This might mean that there is a conflict between OS's Dekstop/Window Manager and SDL when last renders too quickly. So, adding a short delay tells SDL to wait some time while OS's Dekstop/Window Manager handles window's creation. Also, this might be something related to OS's (D/E)M or its compositor(i.e. compiz) in our case KDE Plasma.

In other words, the changes:

...
        //Create window
        window = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );
        SDL_Delay(100); // A short delay should be put here(if doesn't work try increasing delay)
        if( window == NULL )
        {
...

After that, a white window opens successfully.

Already wrote to author of LazyFoo and hopefully he'll commit tutorial.

Best regards, V7

Source Link
Loading