I have been experiencing a problem related to the CLS function. The same problem happens using the BACKDROP ON, COLOR BACKDROP functions.
This problem seems to happen on alot of 64 Bits systems. What happens is that the screen is not cleared of the boxes when using the CLS or COLOR BACKDROP functions. Here is an exemple :
SYNC ON
SYNC RATE 60
RANDOMIZE TIMER()
DO
CLS
xPosition1 = RND(SCREEN WIDTH())
yPosition1 = RND(SCREEN HEIGHT())
xPosition2 = RND(SCREEN WIDTH())
yPosition2 = RND(SCREEN HEIGHT())
BOX xPosition1 - 20, yPosition1 - 20, xPosition1 + 20, yPosition1 + 20
BOX xPosition2 - 20, yPosition2 - 20, xPosition2 + 20, yPosition2 + 20
SYNC
wait 500
LOOP
This script will fill the screen with boxes instead of showing only 2 boxes at a time. I am not the only one with this problem. All my drivers are up to date.
NOTE : Declaring colors on the BOX function will prevent this problem from happening.
Example :
SYNC ON
SYNC RATE 60
RANDOMIZE TIMER()
DO
CLS
xPosition1 = RND(SCREEN WIDTH())
yPosition1 = RND(SCREEN HEIGHT())
xPosition2 = RND(SCREEN WIDTH())
yPosition2 = RND(SCREEN HEIGHT())
BOX xPosition1 - 20, yPosition1 - 20, xPosition1 + 20, yPosition1 + 20,rgb(255,255,255),rgb(255,255,255),rgb(255,255,255),rgb(255,255,255)
BOX xPosition2 - 20, yPosition2 - 20, xPosition2 + 20, yPosition2 + 20,rgb(255,255,255),rgb(255,255,255),rgb(255,255,255),rgb(255,255,255)
SYNC
wait 500
LOOP
This script will work perfectly and show only 2 boxes at the same time.
Thank you for your help and please fix this problem!
EDIT : We believe this problem is not happening on 64 bits systems anymore but on NVIDIA GeForce Graphics Cards. 100% of the people reporting this error are using GeForce cards.
EDIT: Using BACKDROP ON & COLOR BACKDROP won't fix this problem.
EDIT : Creating an object before using the BOX function will also fix the problem (Thanks to Jimmy)
SYNC ON
SYNC RATE 60
RANDOMIZE TIMER()
MAKE OBJECT CUBE 1, 1
DO
CLS
xPosition1 = RND(SCREEN WIDTH())
yPosition1 = RND(SCREEN HEIGHT())
xPosition2 = RND(SCREEN WIDTH())
yPosition2 = RND(SCREEN HEIGHT())
BOX xPosition1 - 20, yPosition1 - 20, xPosition1 + 20, yPosition1 + 20
BOX xPosition2 - 20, yPosition2 - 20, xPosition2 + 20, yPosition2 + 20
SYNC
LOOP