Jump to content
Einlander

windowstyle Window.FullScreen

Recommended Posts

With the last update the new default main.lua causes crashes when run. The old main.lua still works though.

UHNhHY1.png

 

--edit--

Simply commenting out all the gui related related lines causes the game to 'Assert Failed' at world:Render()

Share this post


Link to post

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

 

Share this post


Link to post

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 :/ )

 

Share this post


Link to post

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.

Share this post


Link to post

When trying to run a fullscreen window you will get a Asser Failed error.  <gamename.exe> will simply appear to fail to run.

Attempting to run it from explorer or command line will give the same results.

Share this post


Link to post

Have you updated the latest iteration of 4.4? There's been an update that fixed this. Just tried it and it works.

 

 

Share this post


Link to post

odd - it stopped working for me last week as shown in the original bug report and by updating tonight it works just fine now.

Share this post


Link to post

Can you post your code?  It will fail if the fullscreen resolution is not supported.

Share this post


Link to post

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

Share this post


Link to post

Triple Monitor 1920x1080 on all 3, landscape orientation, (default) 96dpi

Even if I didn't use ntGraphicsModes()-1, every resolution except the out of bounds one should have printed correctly.

Share this post


Link to post

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.

Share this post


Link to post

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

System::DPIScaling

Share this post


Link to post

Running in to the same problem. I haven't further investigated it yet but just to add some info:

2 monitors: 1920x1080 en 2560×1440

Windows 10

Share this post


Link to post

I think it's a dual monitor issue, everything is good here. (Single Monitor)

Share this post


Link to post

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

 

Share this post


Link to post

Find it odd that the default template works, but when using Window.Fullscreen in my code, I'm getting similar issues.

Share this post


Link to post

If you are having problems, please list your version of Windows (7, 8, 10, etc.)

Share this post


Link to post

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

Share this post


Link to post

Win10 Pro. Einlander's sample code works, but strangely, my code doesn't work anymore. I might need to do some rewriting.

 

Share this post


Link to post

Windows 10 64 Triple monitors.  I don't think I see the crash message but I see the project launching in the task bar then just disappears.

 

Share this post


Link to post
Guest
This topic is now closed to further replies.
×
×
  • Create New...