Advertisement

Having Trouble Switching From Windowed To Fullscreen using SDL2/OpenGL

Started by April 05, 2018 03:44 AM
17 comments, last by Rutin 6 years, 10 months ago
9 hours ago, Rutin said:

That's extremely odd. When I run your minimal code I get the same problem you're having, but when I add in:



screenSurface = SDL_GetWindowSurface(window);
SDL_UpdateWindowSurface(window);

Everything works perfectly fine... Did you try to make a clean EMPTY project?

Follow this guide 100% then paste my code in and run it.

http://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/msvsnet2010u/index.php

If you're not using Visual Studio let me know.

If you're still getting the same problem, then I would strongly suggest uploading the project file and posting on the SDL forums, also stating Windows 7.

https://discourse.libsdl.org

Just an FYI, I was using SDL2 2.0.7. Maybe there is an issue with 2.0.8? Try using 2.0.7 maybe?

SDL2-devel-2.0.7-VC.zip

Thanks, yeah I am using Visual Studio 2015, and I set my project settings like that. I even downloaded the source code and loaded the debug symbols from the PDB file so I can step into the SDL code itself. Still no luck. Tried 2.0.7 too and that didn't do it either. It's weird that it only seems to be certain resolutions that this happens for. I tried arbitrary ones too like 400x400 which worked. I'll give the SDL boards a try.

@JackOfCandles I really wish I could help you on this, so best of luck going forward.

I know this is a long shot, but try this one last thing. Make sure you're using the DLLs that match the version of SDL2 you're using. Delete whatever you have (not sure if you put them in your systems folder) and add the related DLLs to your debug folder and run it again.

Programmer and 3D Artist

Advertisement
11 hours ago, Rutin said:

@JackOfCandles I really wish I could help you on this, so best of luck going forward.

I know this is a long shot, but try this one last thing. Make sure you're using the DLLs that match the version of SDL2 you're using. Delete whatever you have (not sure if you put them in your systems folder) and add the related DLLs to your debug folder and run it again.

Yeah I thought of this too actually, and I did ensure the DLL was correct.

Could you do me a favor? Can you please zip or rar your entire minimal project file with the debug exe plus all DLLs so I can run it on my machine.

Also, are you able to run the exe on another machine you have to confirm if it does the same thing?

If SDL2 is causing such a headache, I strongly suggest moving to SFML. You can use openGL as well. I moved from Allegro to SDL1, then to SFML and have stayed ever since for my 2D and smaller 3D needs.

Programmer and 3D Artist

5 hours ago, Rutin said:

Could you do me a favor? Can you please zip or rar your entire minimal project file with the debug exe plus all DLLs so I can run it on my machine.

Also, are you able to run the exe on another machine you have to confirm if it does the same thing?

If SDL2 is causing such a headache, I strongly suggest moving to SFML. You can use openGL as well. I moved from Allegro to SDL1, then to SFML and have stayed ever since for my 2D and smaller 3D needs.

Sure thing! You can download it here: http://www.mediafire.com/file/u9hkmi0k5drgvqk/SdlTestbed.zip

Unfortunately I don't have any other machines I can run it on. And I'll give SFML a look too, thanks!

 

 

Edit: So I'm thinking this may be a hardware problem? I tried SFML and I get the same result when I create a full screen window. Though I did try another monitor I had lying around and it didn't work on that one either, so now I'm totally lost. Maybe it's my graphics card? Really strange...

 

Edit2: I found a game in my steam library that runs at 1280x720 and confirmed the same thing happens when I try to play it full screen. I guess this is officially not a game dev problem.

Sorry I took so long! I was running your program in release mode on my work stations in the office. All of them work perfectly fine, so this leaves me to believe it's something to do with your hardware or drivers.

Can you try running Driver Booster to make sure you have all the updates and then reboot, and try your application again?

https://www.iobit.com/en/driver-booster.php

Programmer and 3D Artist

Advertisement
14 minutes ago, Rutin said:

Sorry I took so long! I was running your program in release mode on my work stations in the office. All of them work perfectly fine, so this leaves me to believe it's something to do with your hardware or drivers.

Can you try running Driver Booster to make sure you have all the updates and then reboot, and try your application again?

https://www.iobit.com/en/driver-booster.php

 

My graphics card is pretty old (Radeon HD 5900, released in 2009), and so it looks like it's no longer supported and it has the most up to date drivers installed. I think now with all this information, I'm less concerned about it, as it looks like a one off problem caused by ancient hardware. If other people aren't likely to have this issue when playing my game, I'm not too concerned about it. I'll just run it in windowed mode for now, until I can afford a better graphics card.

I appreciate all your assistance with this!

Just now, JackOfCandles said:

 

My graphics card is pretty old (Radeon HD 5900, released in 2009), and so it looks like it's no longer supported and it has the most up to date drivers installed. I think now with all this information, I'm less concerned about it, as it looks like a one off problem caused by ancient hardware. If other people aren't likely to have this issue when playing my game, I'm not too concerned about it. I'll just run it in windowed mode for now, until I can afford a better graphics card.

I appreciate all your assistance with this!

No problem. Hopefully you can get a new card soon. :) Have a great weekend, and enjoy your project.

Programmer and 3D Artist

This topic is closed to new replies.

Advertisement