
-----------------------------------
rsknights0
Tue Jan 08, 2008 4:26 pm

help with flickering
-----------------------------------

setscreen("graphics")
var c,x,y:int 
loop
for dots:1..1000 
drawfillbox(0,0,299,maxy,brightblue)
randint (x,300,maxx) 
randint (y,50,maxy)
randint (c,41,44) 
drawfilloval(x,y,5,5,c)
drawfillbox(0,50,maxx,0,brightgreen)
end for
end loop


here it is, its for the end of my program for my culminating program and i need help with stoping the flickering

-----------------------------------
shakin cookie
Tue Jan 08, 2008 4:34 pm

RE:help with flickering
-----------------------------------
try putting the command View.Update

that should get rid of the flickering.

It goes at the bottom, before the end if.

-----------------------------------
Sean
Tue Jan 08, 2008 4:35 pm

Re: help with flickering
-----------------------------------
You can add to your setscreen with an offscreenonly then put in a View.Update or change your setscreen to a View.Set ("graphics, offscreenonly") and still add in the View.Update to the program near the end.

-----------------------------------
shakin cookie
Tue Jan 08, 2008 4:36 pm

RE:help with flickering
-----------------------------------
in addition to that, instead of setscreen("graphics")

put setscreen("offscreenonly")

it will stop the flickering. =)

-----------------------------------
shakin cookie
Tue Jan 08, 2008 4:37 pm

RE:help with flickering
-----------------------------------
Either way works

-----------------------------------
shakin cookie
Tue Jan 08, 2008 4:38 pm

RE:help with flickering
-----------------------------------
i have a question, what is this that you are making?

it seems to have no purpose...

-----------------------------------
rsknights0
Tue Jan 08, 2008 4:40 pm

Re: help with flickering
-----------------------------------
its some kind of an explosion for a shooter game its not done yet tho

-----------------------------------
shakin cookie
Tue Jan 08, 2008 4:42 pm

RE:help with flickering
-----------------------------------
oh ok, btw did that help?

-----------------------------------
Sean
Tue Jan 08, 2008 4:45 pm

Re: help with flickering
-----------------------------------
Shakin beat me earlier by a minute, damn you!

-----------------------------------
rsknights0
Tue Jan 08, 2008 4:46 pm

Re: help with flickering
-----------------------------------
yes thanks

-----------------------------------
shakin cookie
Tue Jan 08, 2008 4:48 pm

RE:help with flickering
-----------------------------------
it's all in the wrist! =)

-----------------------------------
SIXAXIS
Fri Feb 01, 2008 8:58 pm

Re: help with flickering
-----------------------------------

setscreen ("graphics,offscreenonly")
var c, x, y : int
loop
    for dots : 1 .. 1000
        drawfillbox (0, 0, 299, maxy, brightblue)
        View.Update
        randint (x, 300, maxx)
        randint (y, 50, maxy)
        randint (c, 41, 44)
        drawfilloval (x, y, 5, 5, c)
        drawfillbox (0, 50, maxx, 0, brightgreen)
    end for
end loop


Is that what you wanted?

-----------------------------------
ericfourfour
Fri Feb 01, 2008 10:23 pm

Re: help with flickering
-----------------------------------
Set your screen to offscreenonly.
View.Set ("offscreenonly")

This implements what is called a backbuffer. It makes your program draw everything to the memory instead of the screen. When you want to take what was drawn in the memory and put it on the screen, you flip the backbuffer with this command:
View.Update

Call this as soon as you are done drawing a frame.

-----------------------------------
riveryu
Mon Feb 18, 2008 8:02 pm

Re: help with flickering
-----------------------------------

Set your screen to offscreenonly.
View.Set ("offscreenonly")

This implements what is called a backbuffer. It makes your program draw everything to the memory instead of the screen. When you want to take what was drawn in the memory and put it on the screen, you flip the backbuffer with this command:
View.Update

Call this as soon as you are done drawing a frame.


So if you put both in, they cancel each other out and makes the computer do useless calculations?

-----------------------------------
CodeMonkey2000
Mon Feb 18, 2008 8:04 pm

RE:help with flickering
-----------------------------------
I'm not sure what you are asking, so I'm just going  to say no (a very confident no).

-----------------------------------
Mackie
Mon Feb 18, 2008 8:38 pm

RE:help with flickering
-----------------------------------
By default the window will refresh every chance it can get, up to once a millisecond (never happens).

View.Set ("offscreenonly") makes it so that the window will only refresh when you deselect the window then reselect it. Alternatively it will refresh when the function View.Update is called.
