QB64.org Forum

QB64 Team Software => InForm Discussion => Topic started by: IronMan on March 26, 2020, 02:41:45 pm

Title: Black background windows when running
Post by: IronMan on March 26, 2020, 02:41:45 pm
I have used InForm for one of my applications and it works very well with the exception for when starting, the program has a FAST black windows popup then disappear before loading the main Form and starting. It's like a fast Command Windows that blinks each time the application  starts. Not causing a problem in the way the applications runs, just a little unexpected when starting the app.

Is this something that is wrong inside my applications, or just a feature of using InForm?

Thanks.
- Kent
Title: Re: Black background windows when running
Post by: FellippeHeitor on March 26, 2020, 03:49:15 pm
Aren't you using SHELL at all?
Title: Re: Black background windows when running
Post by: SMcNeill on March 26, 2020, 04:25:23 pm
This is actually just standard QB64 behavior.

When QB64 first starts, it starts up in an emulated SCREEN 0 text screen.  This is that black screen that you're seeing initially, before it swaps over to whatever SCREEN_NEWIMAGE you specify.

You might try $SCREEN HIDE at start up, and the switch to_SCREENSHOW after the new image call, but I personally haven't had much luck making it work as expected for me -- but I've never really did much more than play around with those commands...  They might've been updated/fixed and work perfectly fine now; I dunno.  One thing's for certain: it doesn't hurt to experiment and give it a shot.  ;)
Title: Re: Black background windows when running
Post by: TerryRitchie on March 26, 2020, 05:32:01 pm
What Steve said. On slower computers the initial screen 0 will be more noticeable. While testing out my latest game I ran it on hardware ranging from a single processor Pentium 1.4Ghz up to Quad core i7s. I distinctly remember noticing the black screen longer on the slower systems.
Title: Re: Black background windows when running
Post by: RhoSigma on March 26, 2020, 05:41:57 pm
This is actually just standard QB64 behavior.

When QB64 first starts, it starts up in an emulated SCREEN 0 text screen.  This is that black screen that you're seeing initially, before it swaps over to whatever SCREEN_NEWIMAGE you specify.

You might try $SCREEN HIDE at start up, and the switch to_SCREENSHOW after the new image call, but I personally haven't had much luck making it work as expected for me -- but I've never really did much more than play around with those commands...  They might've been updated/fixed and work perfectly fine now; I dunno.  One thing's for certain: it doesn't hurt to experiment and give it a shot.  ;)

Yes, place $SCREENHIDE in the beginning of the program, but different from Steve's suggestion, the _SCREENSHOW must definitly come before the SCREEN statement, otherwise the QB64-GL versions tend to hang and can only be killed via TaskManager. Timing is everything here, I did many experiments in GuiTools, because I also was very irritated/annoyed by that window flashing, so here is what I basically do in GuiTools now:
Code: QB64: [Select]
  1. 'program init here
  2. appScreen& = _NEWIMAGE(wid%, hei%, mode%)
  3. SCREEN appScreen&
  4. _DELAY 0.025
  5. 'more code follows here
  6.