
switch resolution without new window
Hi All,
I want to be able to switch resolution of screen (window or full) without the need to re-create that window.
Any ideas on how to do that?
thx

I guess that you can set the size and position and other properties of the window on startup as you would set them with fullscreen, and then switch to fullscreen. One other way would be to make one the background completely black (making a completely black borderless window that covers the full screen?), or something like that, and keep your OpenGL form on top with the same size and properties, so that you''ll get a small window within a big black screen.
Newbie programmers think programming is hard.Amature programmers think programming is easy.Professional programmers know programming is hard.
Just use the ChangeDisplaySettings API call to change resolution and refresh rate.
---
I write code.
DelphiGL (http://delphigl.cfxweb.net)
---
I write code.
DelphiGL (http://delphigl.cfxweb.net)
---I write code.DelphiGL (http://delphigl.cfxweb.net)
If you use ChangeDisplaySetting, be sure not to change colour depth, or z and stencil, otherwise the render context will no longer be valid.
I had similar problems, I got it to switch, but then when I wanted to destroy the window, it would crash the program because the values of one of the contexts was changed or something. It was sooo annoying, I''m still trying to get it to work properly...
This is actually a problem I had about a month ago. I wanted to be able to dynamically change the window settings (toggle fullscreen, resolution) without destroying and recreating the window.
As was said before, you can use the ChangeDisplaySettings() function to change the screen resolution if you''re in fullscreen mode. Obviously this won''t work in windowed mode. I''ll post some code when I get home (I''ll try to, no promises being the holidays
) but to change the resolution in windowed mode, you can use SetWindowPos(). Can''t remember the syntax off the top of my head, but that should give you a start.
I hope this helps
Jason
As was said before, you can use the ChangeDisplaySettings() function to change the screen resolution if you''re in fullscreen mode. Obviously this won''t work in windowed mode. I''ll post some code when I get home (I''ll try to, no promises being the holidays

I hope this helps
Jason
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement