Hi anyone knows how to simulate ALT+ENTER through code? I don't want to call screenres again and load my assets just to switch from Windowed to Fullscreen.
Thanks!
Oh yeah, it has to be cross-platform.
Simulating ALT+ENTER through code.
Re: Simulating ALT+ENTER through code.
Well, then I would just save the screen contents into an image buffer (and the cursor position and current color, if needed), call screenres and load the data back from the buffer to the screen.
Re: Simulating ALT+ENTER through code.
The idea is not to use screenres. I have done this by using screenres but it seems hackish and i needed to reload gfx assets for opengl screens.Cherry wrote:Well, then I would just save the screen contents into an image buffer (and the cursor position and current color, if needed), call screenres and load the data back from the buffer to the screen.
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: Simulating ALT+ENTER through code.
The FreeBASIC gfx lib is limited to a fixed size (the result of Screen() or ScreenRes())
The gfx window has one device context and in the case of opengl one render context also.
If you change the size of the window a new device context is created and the old opengl render context are destroyed.
If you need a resizeable opengl environment you have to use lib's like glut or better freeglut.
With this or other libs you can enter or leave a fullscreen environment without to destroy the opengl render context.
Currently i use the glCanvas from the IUP lib i can switch between DesktopFullSize or any WindowSize
and i can share the opengl rendercontext with other windows also.
With this feature you can have more views of your scene in diffrent windows (top,left,camera ..)
and all windows share the same glLists and textures.
Joshy
The gfx window has one device context and in the case of opengl one render context also.
If you change the size of the window a new device context is created and the old opengl render context are destroyed.
If you need a resizeable opengl environment you have to use lib's like glut or better freeglut.
With this or other libs you can enter or leave a fullscreen environment without to destroy the opengl render context.
Currently i use the glCanvas from the IUP lib i can switch between DesktopFullSize or any WindowSize
and i can share the opengl rendercontext with other windows also.
With this feature you can have more views of your scene in diffrent windows (top,left,camera ..)
and all windows share the same glLists and textures.
Joshy
Re: Simulating ALT+ENTER through code.
I generally use glfw for this on a non FB language:D.J.Peters wrote:The FreeBASIC gfx lib is limited to a fixed size (the result of Screen() or ScreenRes())
The gfx window has one device context and in the case of opengl one render context also.
If you change the size of the window a new device context is created and the old opengl render context are destroyed.
If you need a resizeable opengl environment you have to use lib's like glut or better freeglut.
With this or other libs you can enter or leave a fullscreen environment without to destroy the opengl render context.
Currently i use the glCanvas from the IUP lib i can switch between DesktopFullSize or any WindowSize
and i can share the opengl rendercontext with other windows also.
With this feature you can have more views of your scene in diffrent windows (top,left,camera ..)
and all windows share the same glLists and textures.
Joshy
http://rel.phatcode.net/junk.php?id=129
But I was wondering if there is a workaround for gfxlib2.
Re: Simulating ALT+ENTER through code.
Oh, I understand. I didn't know about the OpenGL problem (for gfxlib-only screens this should work fine).relsoft wrote:The idea is not to use screenres. I have done this by using screenres but it seems hackish and i needed to reload gfx assets for opengl screens.Cherry wrote:Well, then I would just save the screen contents into an image buffer (and the cursor position and current color, if needed), call screenres and load the data back from the buffer to the screen.