Jump to content

windowstyle Window.FullScreen


Recommended Posts

Further experimentation on my amd system (r9 390) System:GetGraphicsMode() returns  vec2(0,0) for all screen modes

for i=0 , System:CountGraphicsModes() do
	System:Print(i)
	System:Print(System:GetGraphicsMode(i).x .." " .. System:GetGraphicsMode(i).y)
end

 

Link to comment
Share on other sites

The solution that I found is to use a ternary operator to fix it.

add this after line 21:

gfxmode = Vec2( (gfxmode.x <= 0 and 1280 or gfxmode.x) , (gfxmode.x <= 0 and 720 or gfxmode.x))

This will make sure the window is > (0,0), if not it will set it to 720p(16:9) .

This will not effect the game if it is running properly. Think of it as safe mode like gta5 has, except it doesn't start at the absolute safest resolution (640,480).

I need to do some looking into menu.lua to make sure it doesn't mess up when you select the non existent screen modes. (It gives you the option to select 0x0 screen res :/ )

 

Link to comment
Share on other sites

in menu.lua add this after line 249:

gfxmode = {tostring(tonumber(gfxmode[1]) <= 0 and 1280 or gfxmode[1]) , tostring(tonumber(gfxmode[2]) <= 0 and 720 or gfxmode[2])}

Does the same as the above. it will only catch if the screenres is (0,0) or lower then set it to 720p.

This is just a failsafe for when a screen resolution is unable to be selected. Think gta 4 for people with more than 2gb of video ram iirc. The game was unable to see all the ram and was unable to see the screen resolutions.

Link to comment
Share on other sites

What is your screen resolution and DPI?  Your code above should be like this:
for i=0 , System:CountGraphicsModes()-1 do

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

window=Window:Create("Test window",0,0,1920,1080,Window.FullScreen)

--Create the graphics context
context=Context:Create(window,0)
if context==nil then return end
while window:KeyDown(Key.Escape)==false do
end

As simple as I can make it. It will fail at any resolution.

System Specs:

http://i.imgur.com/46t02gl.png

Gfx Card Specs:

http://i.imgur.com/wsaj0bL.png

Link to comment
Share on other sites

This is happening because the available graphics modes are not being returned correctly.  It's due to a problem with some Window-specific code that handles DPI calculation.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Is it possible to, in C++, print out this value AFTER CountGraphicsModes() has been called?

System::DPIScaling

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

This is what i get if I count the graphics mode from c++ and getting the dpi scaling before and after the count

> guitest.debug.exe
Error: No debugger hostname supplied in command line.
DPI Scaling0.000000
(0,0)
(0,0)
(0,0)
(0,0)
(0,0)
(0,0)
(0,0)
(0,0)
(0,0)
(0,0)
(0,0)
(0,0)
(0,0)
(0,0)
(0,0)
(0,0)
(0,0)
(0,0)
(0,0)
(0,0)
DPI Scaling0.000000

 

Link to comment
Share on other sites

Please list your Windows version if you are having problems with this.  It may be specific to Win 7.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • Josh locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...