stefanhendriks / Dune-II---The-Maker

A remake of the classic Dune 2 - The Building of a Dynasty (by Westwood Studios) with several enhancements. Like: higher screenresolutions, zooming, multiselect, skirmish play, etc.
https://www.dune2themaker.com
302 stars 27 forks source link

Failed to create window #536

Closed Exarkuniv closed 2 years ago

Exarkuniv commented 2 years ago

i downloaded your new release and when i try to start it i get a window pop up and go away.

heres the log

\\-------------------
\\Dune II - The Maker
\\-------------------
\\
\\-------------------
\\Version information
\\-------------------
0|INFO|VERSION|Version 0.7.0, Compiled at Apr 27 2022 , 17:07:15|Initializing
0|INFO|GAMEINI|Load file settings.ini|(cIniFile)
15|INFO|GAMEINI|Load file game.ini|(cIniFile)
\\-------
\\Allegro
\\-------
147|INFO|ALLEGRO|Allegro 4.4.3, MinGW32|SUCCESS|Allegro init
148|INFO|ALLEGRO|Dune II - The Maker [0.7.0] - (by Stefan Hendriks)|SUCCESS|Set up window title
148|INFO|ALLEGRO|install_timer()|SUCCESS|Initializing timer functions
148|INFO|ALLEGRO|alfont_init()|SUCCESS|Initializing ALFONT
193|INFO|ALLEGRO|install_keyboard()|SUCCESS|Initializing Allegro Keyboard
197|INFO|ALLEGRO|install_mouse()|SUCCESS|Initializing Allegro Mouse
197|INFO|ALLEGRO|LOCK_VARIABLE/LOCK_FUNCTION|SUCCESS|Set up timer related variables
197|INFO|SETUP|Resolution 1920x1080 loaded from settings.ini.|Resolution from ini file
197|INFO|ALLEGRO|Desktop color dept is 32.|Screen init
197|INFO|ALLEGRO|Windowed mode requested.|Screen init
313|ERROR|ALLEGRO|Failed to create window with resolution 1920x1080 and color depth 32.|FAILED|Screen init
315|ERROR|NONE|Error: Allegro could not create the game window at resolution 1920x1080 depth 32.|Unknown
316|INFO|NONE|Thanks for playing.|Logger shut down

not sure what i did wrong

Exarkuniv commented 2 years ago

i did go in and #Uncomment to hard set resolution and that least got it to work

Chernoskill commented 2 years ago

Setting Fullscreen to true also works. But, critically, the default settings (windowed) don't work

stefanhendriks commented 2 years ago

I believe creation of window fails when resolution equals the same width/height as the native full screen resolution.

stefanhendriks commented 2 years ago

Somehow the settings.ini file had fullscreen to false in the release zip. I updated the release zip (as the intent is to run it in fullscreen mode by default).

Still means this is a bug. I hope it is resolved when using SDL (#386 )

stefanhendriks commented 2 years ago

In the meantime I could probably to some check for the native full-screen resolution, and if that is the case either enforce full-screen mode OR make sure the window is a tiny bit smaller so it 'fits'

Exarkuniv commented 2 years ago

I redownloaded your release and it when full screen with no issues, i made it past mission 1 so from what i see it is working well

stefanhendriks commented 2 years ago

So, what I did was basically change the settings.ini file and change the line saying FullScreen=false into FullScreen=true.

This still needs room for improvement. When - for whatever reason - the resolution cannot be acquired, it should fall back to something. Not sure how I could code this yet; there is an existing GH ticket about some fallback mechanism - so I'll relate these tickets and pick it up there.

@Exarkuniv - I presume we can close this ticket then?

Exarkuniv commented 2 years ago

thanks for all the great work you have been doing this

i did post about this on my facebook on my MSDOS page.

stefanhendriks commented 2 years ago

Awesome, thanks! And glad you enjoy it 👍