Hi, I've got a laptop and when I try to run my game on it in OpenGL mode (set in an ini file), the game just bombs out after trying to create a full-screen OpenGL display. You actually see the screen go black for a split second then in bombs. It works in windowed mode. Also a simpler demo I made works in full-screen mode, it's just the more complex full-game that doesn't work. It totally works in DirectX mode by the way.
Why could this be? The laptop really isn't very powerful but it does seem to run OpenGL some of the time but not when the full-screen scene is too complex. Has anyone ever heard of this before?
Anyway, in an effort to trap an error so that I can see what is happening, I've put this code around the main code where the screen is created and drawn:
This error trapping code works well for debug.exes because it displays the full error message when the exe is run outside of the IDE (which is what's happening on the laptop). However, with the OpenGL issue no error is returned, making me think that nowhere in Blitz is it being trapped and raised for me to trap at the top level. I suppose I could put BMax on the laptop and try it in the IDE to see if anything shows up. I may also make a log file to see how far it gets.
I'm setting OpenGl mode with this: SetGraphicsDriver GLMax2DDriver() but I note that the function doesn't return a value you can check.
I've even got code protecting the Graphics() call like this:
The main reason I need to fix this is, if you offer the user the option to change to OpenGL and it fails, you need to put back DirectX (and in the ini file), but if it bombs immediately and is not trapped, every time they try to load it'll use OpenGL mode due to the ini file! i.e. game appears permanently broken = not good.
Any help/advice is welcome, thanks.
Why could this be? The laptop really isn't very powerful but it does seem to run OpenGL some of the time but not when the full-screen scene is too complex. Has anyone ever heard of this before?
Anyway, in an effort to trap an error so that I can see what is happening, I've put this code around the main code where the screen is created and drawn:
Try 'main code Catch o:Object HandleGeneralError(o) End Try Function HandleGeneralError(o:Object) If TBlitzException(o) Then Notify TBlitzException(o).ToString() Else 'Perhaps a string has been raised? If so, show it. Notify o.Tostring() EndIf End Function
This error trapping code works well for debug.exes because it displays the full error message when the exe is run outside of the IDE (which is what's happening on the laptop). However, with the OpenGL issue no error is returned, making me think that nowhere in Blitz is it being trapped and raised for me to trap at the top level. I suppose I could put BMax on the laptop and try it in the IDE to see if anything shows up. I may also make a log file to see how far it gets.
I'm setting OpenGl mode with this: SetGraphicsDriver GLMax2DDriver() but I note that the function doesn't return a value you can check.
I've even got code protecting the Graphics() call like this:
If FullScreen Then 'Try 32 bit. Don't test for Hertz as some drivers return 0Hz! If GraphicsModeExists(ScreenWidth, ScreenHeight,32) Then OK = Graphics(ScreenWidth, ScreenHeight,32,Hertz) EndIf 'Was 32 bit set OK? If OK=Null Then 'some error code EndIf EndIf
The main reason I need to fix this is, if you offer the user the option to change to OpenGL and it fails, you need to put back DirectX (and in the ini file), but if it bombs immediately and is not trapped, every time they try to load it'll use OpenGL mode due to the ini file! i.e. game appears permanently broken = not good.
Any help/advice is welcome, thanks.