Page 2 of 3
Posted: Thu Jul 22, 2004 10:36 pm
by Codemonger
Hmm this is a common full-screen programming problem .. In Direct X programming in fullscreen it is up to the programmer to use a window that is borderless and is a pop-up window ... so it stays on top and has no close or minimize button .. it seems that the window PB is drawing on in fullscreen is a standard window. The window style should be changed to WS_POPUP. A solution, i'll tell you when i get home tonight
The window is probably repainting itself causing the flicker on the titlebar ... unless you have another application that is fighting to stay on top of this one ?
Posted: Thu Jul 22, 2004 10:46 pm
by Codemonger
Maybe it is your debugger window fighting for its right to stay on top ? try turning debugging off .. See if that helps. Sorry for the many replies but I'm really bored

Posted: Thu Jul 22, 2004 11:03 pm
by Krylar
Doh! Thought you may have had something with that debugger thought cause it didn't flicker for like the first 5 seconds. But it came back.
MadMax already posted up code that did the borderless window, and that did in fact stop the flickering. But I didn't know if there was another way around it or not that didn't require that method.
Not seen this in any other language I've tried. 'Tis an interesting challenge!
-Krylar
Posted: Thu Jul 22, 2004 11:35 pm
by Codemonger
I just tried it at home here and .. no problems at all ... you said all your machines are doing this ?
Posted: Fri Jul 23, 2004 2:22 pm
by Krylar
So here's the latest. It's now only THIS machine.
I went through all of my other machines last night and updated them all to the latest drivers and made sure that they all had DX9.0b. Sworn I'd done this already, but apparently those were my machines at the office. All the other machines at home work fine now with the app.
So it must have something to do with the Radeon card on this machine. Strange that it's only with PB apps that I'm seeing this, but at least I know it's mostly likely some type of compatibility issue with the video card.
-Krylar
Posted: Fri Jul 23, 2004 4:56 pm
by Fred
may be there is another hidden problem. I will take a look, for this tonight.
Posted: Fri Jul 23, 2004 7:12 pm
by Krylar
Thanks, Fred. Please let me know if there's anything I can do to help!
-Krylar
Posted: Fri Jul 23, 2004 9:42 pm
by Kale
Try adding a delay just here:
Code: Select all
...
Delay(1)
Until KeyboardPushed(#PB_Key_Escape)
...
does that help?
Posted: Fri Jul 23, 2004 10:15 pm
by Krylar
I tried that before, using Delay(50) and it seemed to stop the flickering.
Delay(1) seems to help a little, but it does still flicker.
Thanks!
-Krylar
Posted: Sat Jul 24, 2004 12:00 am
by Moonshine
If delaying the frame drawing stops the flicker then it sounds Vsync related...
Posted: Sun Jul 25, 2004 4:43 pm
by Derlidio
@Krylar/Fred
"EDITED twice..."
I'd experiment that kind of flickering within an App I'm working on, but I realize that:
When you open a Screen, you must give it a Tittle, right?
Result = OpenScreen(Width, Height, Depth, Title$)
Windows OS will use that Title$ to create a button item for your app within its taskbar. If you do not give Windows enough time to create that button (and to perform that animated "minimize" effect) before you start using the Screeen, a Tittle Bar will appear at the top of the screen while your app is running, and the flickering occurs.
It seems that even when your App doesn't use a Window, one will be created for it just in order to provide Windows a way to do such things. The same kind of flickering will take place if you try to use MessageRequester while working in Full Screen mode.
So, after using OpenScreen your app must wait for a while (in iddle mode), so Windows can do whatever it needs to do in order to provide the user with a way of selecting your app back after an Alt+Tab or Ctrl+Esc. I can't say why it happens this way, but it happens. I can't explain it in a more confuse way also
Try to put a "Delay(1000)" in the beginning of your code (1 second delay just after the OpenScreen). It shall solve the problem (at least for me it worked).
(After that you can remove other delays within your code)
(I have edited this post 2 times so far, trying to be a little more specific. It seems to me that the related problem is not in PB itself. It seems more like a OS concept issue...)
Regards...
Posted: Mon Jul 26, 2004 1:52 pm
by Krylar
Derlidio,
That worked perfectly, and that is really interesting.
Code: Select all
If InitSprite() And InitKeyboard() And OpenScreen(800,600,16,"")
Delay(1000) ; just added this one line
....rest of the code here...
That one delay made the flicker go away (s'cuse the poetry).
Maybe there should be an added delay in the OpenScreen call so the window has time to minimize, as you say.
Thanks very much!
-Krylar
Posted: Mon Jul 26, 2004 2:12 pm
by MadMax
Glad to hear your flicker problems have been solved, I will include that delay in my code, just in case.

Posted: Mon Jul 26, 2004 4:13 pm
by Krylar
Seems I may have spoken a bit too soon
The flicker does dramatically decrease with the delay addition after the OpenScreen Call, but I still get a blip every 8-12 seconds.
-Krylar
Posted: Mon Jul 26, 2004 8:37 pm
by Derlidio
In adition to the primary delay (after OpenScreen) you can try a minimum delay inside the main loop of your code. Something close to 10 milliseconds should be enough. It'll surely decrease speed (not that much, but it will), but it will also provide Windows OS some iddle time from your app. I usually do that within my apps becouse I noticed (as many of you should certainly noticed too) that CPU usage almost reaches 100% within tight loops (especially those demanding huge graphics manipulation), and I think this is not a good behavior for any app within a Multi-Task environment.
I still suspect that the TittleBar appearing at the top of an OpenScreen is more like an OS issue than a PB bug. I'm not sure if it is possible to open a screeen in a way it doesn't create an item within Windows Taskbar (more like a process instead of an application). Never tryed it. But in that case, users will loose Alt+Tab / Ctrl+Esc ability...
Well, thats it...