I am making an OpenGL-based game and am using GLGraphics() to open a window or screen. On some computers, for example the older ibooks, their OpenGL drivers does not support full-screen mode. It also only has a software renderer (no hardware acceleration).
I need to detect when full-screen mode is not available, so that I don't try to open it, or having tried to open it, I detect that it failed and take action to open a window.
The problem is finding a way to detect if full-screen is supported. If the OpenGL driver does not support full-screen mode, when you try to open a full-screen context it creates an exception and the Max application crashes out. I have tried using Try/Catch to trap the exception but it did not prevent the crash.
How can I detect if full-screen is available so that I can either avoid trying to open it or come back from attempting to open it without crashing?
One idea I had was to try opening full-screen and if it fails then open a window, but as I said it makes an exception that I couldn't trap.
Another idea was to find how much video memory there is and find out the highest screen mode and then compute how much memory that mode takes, and if it would not be possible to open a double-buffered full-screen within the amount of video memory available, assume that the driver won't allow full-screen mode and then take action. However, there is no way to get the video ram availability. There is an OpenGL thing called proxy textures, which tells you if there would be enough space to store a texture of a given size, so maybe I could use that to create a dummy double-buffered-screen-size texture and see if there is enough memory, and if not assume it won't allow fullscreen? I'm not sure if that would work, the manual said something about it would return different values if other textures were already loaded or something.
Any advice/ideas how I can get around this and safely only open fullscreen when it's supported?
I need to detect when full-screen mode is not available, so that I don't try to open it, or having tried to open it, I detect that it failed and take action to open a window.
The problem is finding a way to detect if full-screen is supported. If the OpenGL driver does not support full-screen mode, when you try to open a full-screen context it creates an exception and the Max application crashes out. I have tried using Try/Catch to trap the exception but it did not prevent the crash.
How can I detect if full-screen is available so that I can either avoid trying to open it or come back from attempting to open it without crashing?
One idea I had was to try opening full-screen and if it fails then open a window, but as I said it makes an exception that I couldn't trap.
Another idea was to find how much video memory there is and find out the highest screen mode and then compute how much memory that mode takes, and if it would not be possible to open a double-buffered full-screen within the amount of video memory available, assume that the driver won't allow full-screen mode and then take action. However, there is no way to get the video ram availability. There is an OpenGL thing called proxy textures, which tells you if there would be enough space to store a texture of a given size, so maybe I could use that to create a dummy double-buffered-screen-size texture and see if there is enough memory, and if not assume it won't allow fullscreen? I'm not sure if that would work, the manual said something about it would return different values if other textures were already loaded or something.
Any advice/ideas how I can get around this and safely only open fullscreen when it's supported?