Question about fullscreen resolutions and a NEW Ifsogui issue

BlitzMax Forums/BlitzMax Programming/Question about fullscreen resolutions and a NEW Ifsogui issue

Takis76(Posted 2017) [#1]
Hello my friends,

I am programming my nice game here and goes nice.
I have one new question.

I usually use to run my game in windowed mode with 800x600 resolution
Also I run my game and in fullscreen exclusive mode with 800x600 resolution too.

These 2 resolutions work in my computer , but in few monitors few people can't see the game in fullscreen or the monitor goes out of range in hertz.

I tried to play with Flip 0 , Flip 1 and Flip -1
If some cases things was worked , but the FPS was dropped.

So I discovered a nice function with name SetVirtualResolution(800, 600)

So I run the game with the desktop width and height and then after I am entering in full screen I change the virtual resolution to 800x600 and I can see the game in full screen without need to change the monitor resolution and the game runs in all monitors.

But I am encounter one new issue.
In windowed modes and in full screen exclusive mode , before I use the SetVirtualResolution(800, 600) function the ifsoguy gadgets was worked.
After I was changed the resolution to Desktop width and height and put the setvirtualresolution function I am not able to click on the ifsogui gadgets.



It seems like the mouse spots for ifsogui was changed. Might you see the resized stretched graphics in whole desktop but the ifsogui seems is not compatible or the program believes I am clicking to other position. X Y in pixels.

Is there any tip or some fix this for give some paremeter to ifsogui or if I am making something wrong.

Thank you very much :)


Brucey(Posted 2017) [#2]
... or the monitor goes out of range in hertz

Graphics(DesktopWidth(), DesktopHeight(), 32, 120)

120hz ?
Asking a 60hz screen to display at 120hz will probably display an error.


Takis76(Posted 2017) [#3]
What about when I am using the SetVirtualResolution(800, 600) I am not able to clikc on the ifsogui gadgets?


Derron(Posted 2017) [#4]
If you got black bars left and right your coordinates for the mouse are offset too. Instead of mouseX you need to use VirtualMouseX and ***Y (or so). If ifsogui does still use MouseX/***Y then it will fail as soon as black bars are added.


Bye
Ron


GW(Posted 2017) [#5]
Do a mass copy and replace all the non virtual and virtual function calls in the mod.
just to be safe, use a copy of the mod.

VirtualResolutionWidth
VirtualResolutionHeight
VirtualMouseX
VirtualMouseY
VirtualMouseXSpeed
VirtualMouseYSpeed
MoveVirtualMouse

I did that a long time ago with HighGui and it worked for me.


Takis76(Posted 2017) [#6]
Do I need to search each source file of the ifsogui?
If I will replace all virtual function will it work?
First I will try instead of changing all non virtual functions I will try to only

mousex an mousey

If will change all functions in ifsogui does the ifsogui work in non vistual resolution?


I changed from



To this



and worked

@Derron
Fortunatelly I don't have black bars left and right.


Derron(Posted 2017) [#7]
You might also have them on the top and bottom (if you dev for widescreen on a 4:3 screen for example).

The culprit was: it used MouseX() and MouseY() which got the left and top offset "included".

So without the done adjustment you would have had to move your mouse some pixels more right and/or down to "hover" a button.


PS: I fixed that issue some weeks ago in my GUI too (never realized until I started to try my game in full screen - with black bars).


bye
Ron


Takis76(Posted 2017) [#8]
Some other people have black bars when I was using full screen exclusive.
With the desktop fullscreen there are not black bars.
But I have test my game in TVs in 3 different computers and 2 different laptops in windows xp in windows 7 and windows 10 and I didn't have problem.
I show it to some other person and he had vertical bars.

That was the reason to have my game in full desktop instead of full screen exclusive.
The fullscreen exclusive gives me more FPS.

I will create another one configuration program like setup for the user to choose what kind of screen resolution want or I will put a special configuration interface in my game.

My screen here is widescreen too. I remember playing with flip -1 , 0 and 1 some other people had these horizontal or vertical black bars.

The mouse was stopped in black bars , which means the game aspect ratio was 4:3 in wide screen.


Derron(Posted 2017) [#9]
You cannot rely on what happens to 4:3 on widescreen monitors.

Your screen and your GPU driver: both are able to stretch your fullscreen app to the screen resolution. So while fullscreen-800x600 might have black bars on my widescreen monitor, your setup might say:stretch it.
In both cases the mouse coordinates are _not_ offet -> means they are correct.

By using the virtual resolution you define for what resolution you "designed" the application/game. With SetGraphics() you tell the resolution to "use".
If they differ, then Blitzmax will prepend/append black bars if needed - or scale the whole thing keeping the aspect ratio.

In all of these cases MouseX() and MouseY() will tell incorrect values (if scaled or black bars got added). Which is why VirtualMouseX/Y have to get used.
Think it is that way because VirtualResolution-support was put on top of everything - without modifying the underlaying functionality like MouseX().

But normally such things should be hidden from the "end-developer" - and raw mouse coordinates should be made available via "RawMouseX()" or so.



bye
Ron


Takis76(Posted 2017) [#10]
:)
What is the RawMousex()

Another one new function :P


Derron(Posted 2017) [#11]
This is a non-existing function.

I just mentioned it as I thought it would be better they had overridden "MouseX()" to take care of virtual resolution and to return the "real mouse x position" (including the virtual resolution-bar's offset) in "rawMouseX()" or "realMouseX()".


bye
Ron