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 / Flashing screen - help please!

Author
Message
Jamesb187
16
Years of Service
User Offline
Joined: 26th Nov 2008
Location:
Posted: 26th Nov 2008 10:28
Hi all,

This is my first post here on the forums, and I have a very noobish question that I'm hoping will be very easily rectified with your extensive knowledge

I've recently started learning DB Classic and I'm loving it, but I'm having a slight issue that I'd be grateful for any suggestions on. I'm using DarkEdit as my IDE, and have no problems getting short programs running. However, around 80% of the time that I run any program from DarkBasic (and when I independently run the executables that DB produces), regardless of the type of program (ie just displaying text, doing basic graphics work, moving bitmaps etc) the screen on my laptop flashes between white and the chosen background colour very rapidly as the program runs. It's not a traditional "flicker" from refreshing the screen when doing graphics etc as I get it in a simple "hello world". The programs themselves are not affected and run fine - but I'm not sure if this is something to do with the way I'm setting up the screen in the program, or a known issue with DarkBasic on some hardware.

I've tried various combinations of sync rates, sync on and off, using cls and not etc in the programs to no avail. It's intermittent in that I could run the same program 10 times, and get the flashing screen 7 or 8 times. I don't have this issue with any other software on my PC so it's not a hardware fault.

Any ideas? Sorry if this is a little too vague, but the problem is so general that I haven't been able to narrow it down to any particular code I've been using. My laptop is an HP 530 Celeron-based one with basic Intel integrated graphics.

Many thanks in advance,

Jim
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 26th Nov 2008 16:26
Hello, and welcome.

What windows operating system are you using?

What version of DarkBASIC are you using?

Could you post some code that is specifically giving you trouble? Post the entire code please. To do that, copy and paste it into your post, highlight the code in the post and click on the code button at the top right just above the emoticons

Enjoy your day.
Jamesb187
16
Years of Service
User Offline
Joined: 26th Nov 2008
Location:
Posted: 27th Nov 2008 08:08
Apologies, I'm on Vista Home Basic - I have patched DarkBasic to v1.2 so was hoping that this wasn't a Vista compatibility issue.

I've attached some sample code, although as I said I seem to have this issue with pretty much anything I run, from "hello world" to a Space Invaders or Pong clone. This is very rough code (my first attempt at controlling and animating a sprite) and I'm having some problems with the sprite collision (which may be the subject of another thread!) but when I run this some of the time the background black screen will flash white and then back to black very quickly - and sometimes it won't.

Many thanks!

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 27th Nov 2008 18:47
hmmmm... See if any of the dialog in this thread helps:

Flashing

Enjoy your day.
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 27th Nov 2008 21:59
Welcome to the forum!

Firstly, it is NOT a Vista problem. I tried DBC on my old XP laptop and, if anything, it was worse.

It seems you havecome across the most complicated problem of all. If you look around the forum, you'll see that there are nmany unanswered threads on this topic.

Some advice: if you didn't this time, please search before you post a new topic.

Also, you could do what I do when I come across this problem: live with it. You can go ahead and code your whole thing out and then troubleshoot once you're done. I can see why you're concerned and I understand.

Good luck, this is looking pretty good for a beginner.

~QJ
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 28th Nov 2008 02:06 Edited at: 28th Nov 2008 02:08
This may not be the only solution, but I have found one that works for me:

1) Create an offscreen bitmap (or many) and draw to them (instead of directly to the screen).

2) Then use either:

a) get image and set current bitmap to 0, followed by using a sprite.

b) copy bitmap x,0 (where x is the offscreen bitmap you want to copy from, e.g. 1).

Try this program:



It doesn't do anything special, just prints the time and the current screen fps.

Hopefully you can run this several times and it doesn't make the screen flash like a strobe light.

You might notice an initial low frame rate whilst your hardware is firing up, but it should run at a good frame rate after a few seconds.
Jamesb187
16
Years of Service
User Offline
Joined: 26th Nov 2008
Location:
Posted: 28th Nov 2008 03:07
thanks very much for your responses - this will help me greatly! Apologies that this had already been covered on some threads - I'll dig a bit deeper next time before posting.

Login to post a reply

Server time is: 2025-06-07 17:14:36
Your offset time is: 2025-06-07 17:14:36