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.

Newcomers DBPro Corner / BOX and CLS

Author
Message
BriereAnthony
13
Years of Service
User Offline
Joined: 20th Feb 2011
Location:
Posted: 24th Mar 2011 17:25
Hello, I just wanted to know something about the CLS and BOX commands. Well my question is quite simple. How come using the DOT command followed by a CLS will clear the screen of all dots, while using the BOX command followed by CLS won't clear the screen of all boxes?

Is there a way to clear the screen of everything, including boxes? Thanks for your help!
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 24th Mar 2011 17:40
Quote: "using the BOX command followed by CLS won't clear the screen"


Actually it does clear the screen.



Try that and see. And if you'll post the code you're using, forum members can help you troubleshoot it.

BriereAnthony
13
Years of Service
User Offline
Joined: 20th Feb 2011
Location:
Posted: 24th Mar 2011 17:52 Edited at: 24th Mar 2011 17:53
Let's say I want only 2 boxes on the screen at the same time, here was my script :

Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 24th Mar 2011 19:07
Quote: "I want only 2 boxes on the screen at the same time"


That's exactly what you are getting. But it is happening so fast that it appears like more boxes are on the screen at once.

Try this:


BriereAnthony
13
Years of Service
User Offline
Joined: 20th Feb 2011
Location:
Posted: 24th Mar 2011 22:56
These boxes are white, if I wait a few minutes the screen gets all white because it's filled with these boxes. What I meant by "I want only 2 boxes on the screen at the same time" is that I want all other boxes to be erased from the screen, so the entire screen is black + 2 white boxes.
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 24th Mar 2011 23:39 Edited at: 24th Mar 2011 23:42
Quote: "I want all other boxes to be erased from the screen, so the entire screen is black + 2 white boxes. "


And that is exactly what I see when I run the code I posted - only two boxes on the screen at a time.

If you see something different, then there might be a problem with your display, or somewhere else.

Again, the code I posted clears the screen to black between every two boxes. But, so does your original code, only it is too fast to follow.

If your screen is filling up with white, then you might try uninstalling DBPro and reinstalling it.

And, what are your computer specs?

BriereAnthony
13
Years of Service
User Offline
Joined: 20th Feb 2011
Location:
Posted: 24th Mar 2011 23:52 Edited at: 24th Mar 2011 23:53
WINDOWS 7 64BITS
E 5200 2.50GHZ (2CPU)
4GB RAM
NVIDIA GeForce GTS 250

Here is a screenshot of what happens after 4-5 seconds using your code :
http://img593.imageshack.us/f/sanstitreinq.png/
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 25th Mar 2011 00:00
Well, I'm suspecting that WINDOWS 7 64BITS might be the culprit. You might try updating to the newest beta release, I think they are working on making DBPro play nicer with Win7 64 bit.

BriereAnthony
13
Years of Service
User Offline
Joined: 20th Feb 2011
Location:
Posted: 25th Mar 2011 00:05
Guess I'll have to try it that way then. Thanks for your help!
BriereAnthony
13
Years of Service
User Offline
Joined: 20th Feb 2011
Location:
Posted: 25th Mar 2011 00:30 Edited at: 25th Mar 2011 00:31
Just reinstalled DarkBasic Pro and tried different versions (free, the cd version, the old cd version and the current release version), and still I see more than two boxes at the same time.

I guess I'll have to use something else than DarkBasic Pro.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 25th Mar 2011 00:33
...or you can try updating your graphics drivers.

Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 25th Mar 2011 09:44
Hi. Just to say I've tested the code and get exactly the same thing (boxes not being cleared). Driver Detective at least says my graphics drivers are up to date. I too am running Windows 7 64 bit. My graphics card is NVIDIA GeForce 9400M G.
BriereAnthony
13
Years of Service
User Offline
Joined: 20th Feb 2011
Location:
Posted: 25th Mar 2011 15:39
My graphics drivers are up to date too.
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 25th Mar 2011 16:40
Well, you could try the latest U77 public release candidate and see if that fixes it.

If that doesn't fix it, y'all should report it in the bugs forum.

Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 25th Mar 2011 18:19 Edited at: 25th Mar 2011 18:23
I'm using U77 RC6 anyway for the Windows 7 SP1 fix so I'm afraid that hasn't fixed it. Interestingly, the same code works fine for circle, ellipse and line as well as IanM's fill circle and fill ellipse. It only seems to be box which is not being cleared from the screen..

So BriereAnthony, you want to submit this as a bug report or shall I?

EDIT: And here's another interesting fact. Rich's code:



works fine for me but if I comment out the text command, it fails to clear the screen..
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 25th Mar 2011 19:09
I was curious and decided to try it myself and I get the same problem that CLS won't clear the screen (see attached). What Lucas Tiridath discovered happens to me too. It'll clear the screen but won't if the TEXT command is remed off.

I'm using Vista 64bit with U77.

Attachments

Login to view attachments
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 25th Mar 2011 20:23 Edited at: 25th Mar 2011 20:29
it could be to do with the box command that used in matrix, this does not clear when cls it called works fine if you do this.



Dark Physics makes any hot drink go cold.
BriereAnthony
13
Years of Service
User Offline
Joined: 20th Feb 2011
Location:
Posted: 25th Mar 2011 21:51
Same problem for me Lucas Tiridath!

Oh and just tried your code HowDo and it now works fine! Thanks for your help! I'm going to contact the support team to see if there's anything they can do about this.
Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 25th Mar 2011 22:12
HowDo, your code works for me too. However I don't see how the problem could be to do with the Matrix1 box command. The standard DBP commands take either (int, int, int, int) or (int, int, int, int, dword, dword, dword, dword). Your code uses the second whilst the original code uses the first. The box in Matrix1 uses (int, int, int, int, dword) which has not been used in any of these examples but would look like this.



This code, like your code, works fine for me. Thus, I'm thinking the culprit is the (int, int, int, int) version of DBP's box command.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 25th Mar 2011 23:42
It's looking to me like this is a problem with NVidia graphics cards in general - My NVidia system has this problem, but my ATI and Intel systems don't.

The difference between the BOX command without specifying colour, and a BOX with colour (DBPro's and mine) is that the one without a colour value uses a 'clear rectangle' routine of DirectX to draw the box, while the colour ones use a render to draw the box. So I think that changing the straight BOX command to render instead would fix the problem pretty easily.

I'll code, test and apply that fix to the codebase, but it'll be up to Lee as to whether this will become a part of the 7.7 release.

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 26th Mar 2011 03:13
Quote: "It's looking to me like this is a problem with NVidia graphics cards in general - My NVidia system has this problem, but my ATI and Intel systems don't."


Yeah I use a NVidia GeForce G100.

Jimmy
21
Years of Service
User Offline
Joined: 20th Aug 2003
Location: Back in the USA
Posted: 27th Mar 2011 18:27
I don't think it's graphic drivers. It's just that the DirectX renderer isn't initialized properly. Making an object fixes this problem:



NaGaFailMo.
BriereAnthony
13
Years of Service
User Offline
Joined: 20th Feb 2011
Location:
Posted: 27th Mar 2011 23:37
Ohhhhh, making an object fixes the problem too. Is there a way to fix this problem without having to make an object everytime then?
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 28th Mar 2011 12:50
try backdrop on.

Dark Physics makes any hot drink go cold.
BriereAnthony
13
Years of Service
User Offline
Joined: 20th Feb 2011
Location:
Posted: 28th Mar 2011 16:42
Backdrops won't work either.
I tried that already.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 28th Mar 2011 19:55
would have thought it would work as that what happens when an object is made.

Dark Physics makes any hot drink go cold.
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 28th Mar 2011 20:03
I would assume that ALL 2D graphics are cleared every sync cycle once you have enabled the 3D operation. That's why we sometimes have to re-draw the text or 2D graphics over the camera view every sync.

But since IanM's on the case...
Quote: "I'll code, test and apply that fix to the codebase, but it'll be up to Lee as to whether this will become a part of the 7.7 release."

...the problem is being fixed.

Agent
20
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 30th Mar 2011 22:06
Perhaps, in the meantime, you can clear the screen by drawing another box: a big black one to (0, 0) - (screen width(), screen height()). This is actually faster than using CLS anyway.
BriereAnthony
13
Years of Service
User Offline
Joined: 20th Feb 2011
Location:
Posted: 30th Mar 2011 22:46
Yea that's what I am doing at the moment ahah, thanks for the tip anyways!

Login to post a reply

Server time is: 2024-11-16 19:21:40
Your offset time is: 2024-11-16 19:21:40