It looks like you're new here. If you want to get involved, click one of these buttons!
Ok. So, I need to adjust windowed display size based on user screen res.
I can easily pull user desktop res with the windows API, but I have tried multiple ways to change Orx display size to no avail.
I was able to change display size by modifying a display_video_mode object manually, but this lead to all manner of problems with the viewport and frustum either distorting or just leaving a huge amount of black space with a tiny viewport.
The problem with using the push/pop method seems to be that the display section of the config is processed before any code can be called. Or, at least before code can be called by Orx to modify its config keys.
My question is quite simple: Can code be called IN the config file to act on a key, or can code modify the display size keys BEFORE the display is created?
Thanks in advance,
-Wolf
Comments
Hey @WolftrooperNo86, to answer your question yes, but that's probably not what you need at the moment.
Lemme give you more details. First, regarding code execution "in the config". You can execute commands from config, and there are two ways to do so:
Here's the quick summary that can be found at the top of
CreationTemplate.ini
/SettingsTemplate.ini
That being said, if your goal is only to use the desktop resolution, simply remove the
ScreenWidth
/ScreenHeight
properties of theDisplay
section, and the native desktop resolution will be used. Note that if you want to go for the infamous borderless fullscreen, I'd recommend settingDecoration = false
in the same section as well.Now if you want to do it later on during runtime, for example for switching after the user has changed his settings, you can retrieve the current desktop resolution easily by passing
orxU32_UNDEFINED
toorxDisplay_GetVideoMode()
.Here's the relevant inlined documentation:
Also note that you shouldn't get any viewport deformation, no matter what video mode you set. Orx should maintain the aspect ratio and use pillar/letter boxing depending on the requested resolution.
If you have a test sample for me to try, I'd be happy to have a look at this issue.
I’ll test your example over the next couple days.
Ah I see. Let us know how it goes then.
BTW, what did you mean by "infamous borderless fullscreen?" Is fullscreen frowned upon or disliked, or is there something buggy about how fullscreen works? Basically, is it something to be avoided?
I mean it is a bit of a misnomer: it's not actually fullscreen, it remains a window albeit without any decoration and that covers the whole surface of your desktop.
That means it can't run at a different refresh rate than your desktop, for example, and usually will yield inferior performance than an actual fullscreen mode.
To sum it up: