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 Discussion / Screen splitting question - darkbasic works, exe doesn`t!

Author
Message
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 14th Jul 2008 21:47 Edited at: 14th Jul 2008 21:48
Hey guys!

Here is a quick example on splitting the screen made by latch(thank you), and I carried it on for further games:

for v1.13:


for v1.14 or v1.2:


Anyway, this all works fine in darkbasic, but once you make an exe out of it, the screen blinks and flashes like mad!

How can I stop this?

Thanks, TheComet

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th Jul 2008 00:53
The problem has to do with the call to SYNC. It redraws the screen every time it's encountered - so each camera frame is drawn then erased and you can see it. When a DB script is made into an exe, in fullscreen mode (i'm making some assumptions here) the exe's TOP sync rate seems to be limited by a max of 2x the monitors refresh rate. In my case, it's 2 x 85hz. However, when run in windowed mode, the SYNC controls the redraw of the db app independently of the monitor refresh. Make exes out of the following examples and observe the FPS:





In the 1.20 example you posted, try putting SET WINDOW ON at the top of the program. Then try increasing the SYNC RATE. In both cases, the three windows with the rotating cubes looks smooth on my machine.

Enjoy your day.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 19th Jul 2008 18:07
That works! Thanks Latch

Isn`t there a way to fix this to work in fullscreen mode?

Your signature has been erased by a mod - Please reduce it to 600x120 maximum size
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Jul 2008 03:40 Edited at: 20th Jul 2008 03:42
I don't really know. I've always noticed fullscreen exes do not run as fast as windowed mode exes.

For some reason, windowed mode exes run much closer to the speed that the script runs in the DBC editor than fullscreen exes. You can fake a fullscreen app in windowed mode by getting the desktop dimensions and bit depth and use SET DISPLAY MODE with those values and using the command SET WINDOW LAYOUT 0,0,0 to remove the titlebar . You can get the desktop dimensions using the win32 api. You can also grab it out of regedit by accessing the key:

HKEY_CURRENT_USERDisplaySettings

There are two values : BitsPerPixel and Resolution

Lookup command line options for regedit. I think it's regedit /e to export a key to a file. You could call that using EXECUTE FILE from DBC. But look up the syntax, I'm not positive of it.

Using the win32 api, there's a function called GetSystemMetrics.



Enjoy your day.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 20th Jul 2008 10:56
Good suggestion, my desktop is exactly 1024*768, but making a game with a resolution of those dimensions will slow down the game more than if you have it in fullscreen mode...

Anyway, I`ll try that method out, thanks Latch

TheComet

Your signature has been erased by a mod - Please reduce it to 600x120 maximum size

Login to post a reply

Server time is: 2025-06-07 06:58:31
Your offset time is: 2025-06-07 06:58:31