Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / "SET DISPLAY MODE" issues. When compiling/running from within editor, works fine. When running from standalone EXE copied to another folder, gives error saying that display mode is not supported... even though it IS supported

Author
Message
Omega gamer 89
17
Years of Service
User Offline
Joined: 10th Sep 2007
Location: Pittsburgh, PA
Posted: 22nd Dec 2024 04:10
Title basically says it. Running into an odd issue with SET DISPLAY MODE. Im trying to set it to 1920x1080x32. When I run PERFORM CHECKLIST FOR DISPLAY MODES, this resolution is indeed listed as one of the ones available. So, I put



near the very top of my program. When I hit F5 to compile and run, it works fine. No issues, no error message. If I double click the EXE in my project folder, also runs with no issues. But if I then copy and paste that EXE to my desktop, and double click that to run it, I get the error " Runtime error 1507 - Display using 32 bit is not supported by available hardware at line 0"

Obviously, this is not correct, because as previously stated, this resolution is listed when I run PERFORM CHECKLIST FOR DISPLAY MODES. And curiously, I only get this error the first time I run the EXE like this. If I close the program down and double click the EXE again, it does not give the error.

Anyone have any ideas on this?
Mage
Valued Member
18
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 22nd Dec 2024 10:51 Edited at: 22nd Dec 2024 10:58
One would probably have to look at the actual code to work out what was going on.

However I can suggest one possibility, which is that you are not seeing an accurate error code. The actual error might be something else earlier in the programs execution. On rare occasions errors are not handled gracefully.


Edit:
Also you should SYNC before using Set Display Mode (especially if the program is launching and was never sync). This will initialize a number of DBP systems and is generally a best practice. In this case however it may also reveal a different error message. No guarantees.

Mage's Modular Code - Get awesome UI controls and powerful Bitmap Fonts!
Screen Device Recovery - Stop your apps from crashing when minimized/tabbed/screen locked.
CPU Friendly Frame Limiter - Make your app generate less computer heat + noise, and use less battery life!
James H
18
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 22nd Dec 2024 14:31
I have had this before though whether its the same case as yours may be another matter! So this happens when the built in options for the editor have changed to say 16 bit or from a window/fullscreen option is checked/unchecked which then results in a 16 bit mode - I recall one of those windows options defaults to the ghosted out option which only becomes a valid choice when the other window option is in play. This can happen by accidentally clicking on an option and changing it while not noticing, double clicking while moving over it or single click and mouse wheel movement then spotting your none blinking cursor and clicking on the text space, that sort of thing. It can also be the case when you switch or update editors so in turn the default options are in place - perhaps even when updating DBP itself is a possibility to resetting defaults? It may be plausible that something else took place that reset those options, I know the default editor annoyed me a few times by going back to defaults for all and without explanation. That's my best guess I'm afraid!
Win 10 Home 64, Intel(R) Core(TM) i5-10300H, 8GB DDR4, NVidia GeForce GTX 1650 4GB GDDR6
Omega gamer 89
17
Years of Service
User Offline
Joined: 10th Sep 2007
Location: Pittsburgh, PA
Posted: 22nd Dec 2024 19:26
Quote: "One would probably have to look at the actual code to work out what was going on."


I could post my code here but its about 7400 lines right now and relies on a bunch of media.

Quote: "Also you should SYNC before using Set Display Mode (especially if the program is launching and was never sync). This will initialize a number of DBP systems and is generally a best practice. In this case however it may also reveal a different error message. No guarantees."


Thank you for the suggestion! Tried it, but no luck. Same error message.


Quote: "So this happens when the built in options for the editor have changed to say 16 bit or from a window/fullscreen option is checked/unchecked which then results in a 16 bit mode"


Ive attached a screenshot of what the editor settings look like. I tried switching it to full screen exclusive, and to windowed, and both of those caused the program to freeze and stop responding, and I had to kill it with task manager. I did notice that the resolution for full screen exclusive mode keeps changing back to 640x480x16 no matter what I do though.

Quote: "It can also be the case when you switch or update editors so in turn the default options are in place - perhaps even when updating DBP itself is a possibility to resetting defaults? "


Im basically stuck with an old version of DB. Ive tried the newest version from github and multiple other versions, and despite hours and hours of effort, I simply cannot get them to run, so Im basically stuck with this one version that I CAN get to work, so updating isnt an option.

Quote: " I know the default editor annoyed me a few times by going back to defaults for all and without explanation. "


That might be whats happening. Would the editor settings override the command to set the display mode, or would the command override the editor setting?
James H
18
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 23rd Dec 2024 00:10 Edited at: 23rd Dec 2024 00:13
Quote: "That might be whats happening. Would the editor settings override the command to set the display mode, or would the command override the editor setting?"


It will launch the program using the editor settings, then after that the command will override the settings.

For me normally the program will crash if it launches in 16 bit fullscreen from the settings and then a command is used to change it to 32 bit in the code. However i have the GG version of dbp installed currently alongside of another version of GG upgraded to version 1.076. I am however normally using a different editor - Codesurge and also Indigo sometimes. The GG installed version of dbp uses one version of many of the editor called Synergy. The 1.076 version uses a different version of Synergy. There are a few versions of Synergy around in the upgrades and on the forum. The original DBP installer is version 1.054 and uses a different editor altogether, I believe it to be the original editor and I don't recall it having a name - I suspect this is what you have. This was the version that gave me issues of running in other windows modes but seemed to be trying to do the 16 bit launch when it shouldn't...basically as if it launched fullscreen but never actually went fullscreen and threw the error, whereas the normal behaviour I mentioned(which although I describe it as normal it is still a bug) does go fullscreen before throwing the error. Perhaps that is something you can try to spot - does the entire screen flash black before the error is thrown or does the error message pop up without this "black flash"? I would say at this point its more of a curiosity as I believe your main issue is getting any version of dbp you wish to use working. Nobody should be forced to use the oldest available version of dbp lol. You need to get that sorted out pronto.
The Synergy editor with GG version of dbp also suffers the same error that I described as "normal" earlier, whereas the Synergy editor shipped with version 1.076 has zero errors for me. I actually rarely touch dbp these days, but when I did I mostly used Indigo or Codesurge editors as there where some other issues not related to this that meant they where the best option(I THINK it was the behaviour of a demo that belonged to a plugin which rendered the demo pointless along with some other stuff that I don't reccall).

Never noticed the second run of the exe being a thing as I never tried, however at one point in time, don't know when or what versions I had installed, but I spotted that every second run the performance of fps was very different to the first. Someone did point out that we should be restarting our machines between launches as we would for any game back then and this did work, I could guarantee the same fps first launch. Not that I ever released anything - I have always just enjoyed it!
Win 10 Home 64, Intel(R) Core(TM) i5-10300H, 8GB DDR4, NVidia GeForce GTX 1650 4GB GDDR6
Omega gamer 89
17
Years of Service
User Offline
Joined: 10th Sep 2007
Location: Pittsburgh, PA
Posted: 23rd Dec 2024 02:52 Edited at: 23rd Dec 2024 02:52
Quote: "However i have the GG version of dbp installed currently alongside of another version of GG upgraded to version 1.076. I am however normally using a different editor - Codesurge and also Indigo sometimes. The GG installed version of dbp uses one version of many of the editor called Synergy. The 1.076 version uses a different version of Synergy. There are a few versions of Synergy around in the upgrades and on the forum. The original DBP installer is version 1.054 and uses a different editor altogether, I believe it to be the original editor and I don't recall it having a name - I suspect this is what you have."


Ive been unable to get any other version of DBP to work other than the one Im using (which is 1.054. Yeah, I know thats extremely old, but its all I can get to run for whatever reason) but I will have to try seeing if maybe I can get a different editor to work.

Quote: "does the entire screen flash black before the error is thrown or does the error message pop up without this "black flash"? "


the error comes up first, before the program window appears at all.

Quote: " I would say at this point its more of a curiosity as I believe your main issue is getting any version of dbp you wish to use working. Nobody should be forced to use the oldest available version of dbp lol. You need to get that sorted out pronto."


Trust me I know. Ive spent literal weeks trying to get newer versions to work. I have no idea what the problem is, but it just wont happen. After that much time trying Ive basically arrived at the conclusion of "I have SOMETHING working. Id rather just take what I can get, rather than continue trying to get something else to work and just end up breaking the one I currently have working."

Quote: "Never noticed the second run of the exe being a thing as I never tried, however at one point in time, don't know when or what versions I had installed, but I spotted that every second run the performance of fps was very different to the first. Someone did point out that we should be restarting our machines between launches as we would for any game back then and this did work, I could guarantee the same fps first launch. Not that I ever released anything - I have always just enjoyed it!"


I do plan on "releasing" the project Im working on, in a certain sense. Not to the public, but to the Game Grumps. Im making a custom little game for them, and Im going to send it to them when its done and try to get them to play it on the show. So basically it doesnt have to be perfect; it just has to work well enough for them to record an episode with, lol. And considered the extreme jankiness of some of the games theyve played in the past, Id say that bar is definitely not too high to reach.
Mage
Valued Member
18
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 23rd Dec 2024 11:26
It seems what you need to do is begin blocking out sections of the program until you can narrow down where the error is coming from. It might even come down to you transplanting all of the code into a fresh project file.

You run the program with as little code as possible because you can end up discovering odd things like it not crashing if physics isn't initialized, and maybe a plugin or section of code isn't handling errors correctly. Etc.

So backup the source code, then begin removing things until it starts working again.

Mage's Modular Code - Get awesome UI controls and powerful Bitmap Fonts!
Screen Device Recovery - Stop your apps from crashing when minimized/tabbed/screen locked.
CPU Friendly Frame Limiter - Make your app generate less computer heat + noise, and use less battery life!
Omega gamer 89
17
Years of Service
User Offline
Joined: 10th Sep 2007
Location: Pittsburgh, PA
Posted: 24th Dec 2024 00:21
Im gonna be honest, Mage; that sounds like a reasonable way to suss out the source of the issue, but... at 7500 lines of code and counting, I think Id rather just live with the error. XD

Like it doesnt stop the program from running, it just incorrectly throws an error message when it doesnt need to, one time, and then its fine. Sorting through all the code to find the section causing the issue (if it even IS the code, could easily be weirdness from the editor) is a level of effort Im not willing to put forth if its not actually stopping the game from working. XD

I appreciate the suggestion though. If the problem ever gets worse, I know what to do.
TheWanted
1
Years of Service
User Offline
Joined: 17th Oct 2023
Location:
Posted: 24th Dec 2024 08:00
I would personally create a small test project with the set display mode your trying to use and if it compiles runs fine it's not the set display mode.
Mage
Valued Member
18
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 24th Dec 2024 13:58
A situation like this where a seemingly innocent command throwing an error, it can mean that another bit of code somewhere encountered an error and didn't immediately stop the program. It might be giving you the wrong line number when erroring out. So if you are going to just live with the error message, just be aware that other unfound error is possibly still out there making the program unstable.

Mage's Modular Code - Get awesome UI controls and powerful Bitmap Fonts!
Screen Device Recovery - Stop your apps from crashing when minimized/tabbed/screen locked.
CPU Friendly Frame Limiter - Make your app generate less computer heat + noise, and use less battery life!
Yarbles2018
7
Years of Service
User Offline
Joined: 16th Jan 2018
Location:
Posted: 24th Dec 2024 21:18 Edited at: 24th Dec 2024 21:21
The problem is probably in your project property settings. I had a similar issue where on some desktops it would fail at launch because of "unsupported resolution". I have attached a screenshot of the properties that seem to work best on all systems for me.



That setting will initially set it to a very common resolution supported on many systems. Then you can set your resolution in code afterwards based on your checklist or using the CHECK DISPLAY MODE command.
Omega gamer 89
17
Years of Service
User Offline
Joined: 10th Sep 2007
Location: Pittsburgh, PA
Posted: 25th Dec 2024 16:46 Edited at: 25th Dec 2024 23:10
I believe Ive determined that it is indeed something in the project settings, and not any actual line of code. Up until now, its been saying the error is at line 0, which, logically, would mean that its happening before we actually get to any code, when its just going through the project settings. I tired changing the "SET DISPLAY MODE" to 1920,1080,16 to see what happened, and when I did that, it threw up the error message as soon as I compiled and ran, this time saying the error was at line 6; precisely the line where that command is located. And this time it prevented the program from launching at all.

Ive tried changing things in the project settings, but Ive found that any setting other than "windowed full screen" causes the program to freeze and wont appear on screen, but also wont let me do anything else on that screen. I had to use Windows key + Tab to open up a second dekstop, and open up task manager there to kill the program. Im going to have to try a different editor and see if that fixes the problem.



Ill also note that when I click on the options for fullscreen exclusive or windowed mode and try to change the resolution setting, no matter how many times I click on 32bit, it always switches back to 16 bit.

Attachments

Login to view attachments
Yarbles2018
7
Years of Service
User Offline
Joined: 16th Jan 2018
Location:
Posted: 25th Dec 2024 20:02 Edited at: 25th Dec 2024 20:13
@Omega gamer 89

I see that you are using Guy Savoie's original editor for DBPro. That editor integrates well, but it has some infuriating flaws. I have switched over to the Synergy Editor (see post stickied on this forum) and have not looked back.

The Synergy Editor requires some tweaking of it's setting to be usable as well, like the colours need to be set with a dark background in the editor or things get strange when you highlight text. The syntax highlighting in the editor actually trains you to do proper variable declaration in DBPro. Also, you will need to add an option to "Compile & Run in Debug Mode" to your menu bar at the top.

Despite it's flaws, I think you should give Synergy a try as your main editor for DBPro, it definitely works better than the default editor on modern systems.
TinTin
18
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 26th Dec 2024 16:43 Edited at: 26th Dec 2024 16:43
Hi Guys
I don't know if this is related or not, but I'm currently trying to upgrade an old project that is also displaying weird graphics issues.
I commonly use a Boolean variable to set whether I'm in DEBUG or RELEASE mode as there isn't a working inbuilt variable to represent these modes
in DEBUG mode I set the application to a window a sixth the size of my desktop resolution with a Title bar that can easily be shutdown or moved out of the way.
in RELEASE mode the application hopefully runs in full screen.
DEBUG also conveniently displays and populates a log file with progress messages (handy to determine how far the application progressed before crashing!)
The weirdness is in DEBUG the text in the window is blurred and none of the 3D objects were visible?
After several attempts I think I found the solution...
the code for each mode although almost identical, after rearranging the order in which the DBP commands were ordered appears to have fixed the issue! although I'm not entirely sure why?



Hope you find a solution.
Mage
Valued Member
18
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 28th Dec 2024 11:39
You should create a new project entirely, confirm it will compile and run, then copy paste your source code into that new project.

Mage's Modular Code - Get awesome UI controls and powerful Bitmap Fonts!
Screen Device Recovery - Stop your apps from crashing when minimized/tabbed/screen locked.
CPU Friendly Frame Limiter - Make your app generate less computer heat + noise, and use less battery life!
Omega gamer 89
17
Years of Service
User Offline
Joined: 10th Sep 2007
Location: Pittsburgh, PA
Posted: 29th Dec 2024 02:09
@Yarbles2018 I will try another editor at some point. Right now Im honestly more focused on just getting the rest of the program written, and THEN sorting out this display mode bug

@Mage, I created a new project and just added a Print statement, wait key, and then end. Compiled and ran it, no issues. Double clicked the EXE from desktop, no issues. THEN I added in the SET DISPLAY MODE command, and... yep, same issue as original project. So it apparently seems to be that the problem really is with this command somehow.
Mage
Valued Member
18
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 29th Dec 2024 10:34
This may then lead to you needing to update DBP and then patching your code to compile with the updates.

Mage's Modular Code - Get awesome UI controls and powerful Bitmap Fonts!
Screen Device Recovery - Stop your apps from crashing when minimized/tabbed/screen locked.
CPU Friendly Frame Limiter - Make your app generate less computer heat + noise, and use less battery life!
Omega gamer 89
17
Years of Service
User Offline
Joined: 10th Sep 2007
Location: Pittsburgh, PA
Posted: 29th Dec 2024 17:22
Thats a project for way down the road. Ive spent quite literally dozens of hours trying to get ANY newer version of DBP to work for me, and its just a no-go. This is the only version Ive ever been able to get to work ever since it went open source, and after bashing my head against that particular wall for weeks on end, I decided to just live with the version that works for now. Maybe once Ive gotten everything else done on this project, Ill take another crack at getting a newer version to work, but for now, its not worth throwing any more time into.

Login to post a reply

Server time is: 2025-05-12 05:20:49
Your offset time is: 2025-05-12 05:20:49