Computer Science Canada

help with flickering

Author:  rsknights0 [ Tue Jan 08, 2008 4:26 pm ]
Post subject:  help with flickering

code:

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

Author:  shakin cookie [ Tue Jan 08, 2008 4:34 pm ]
Post subject:  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.

Author:  Sean [ Tue Jan 08, 2008 4:35 pm ]
Post subject:  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.

Author:  shakin cookie [ Tue Jan 08, 2008 4:36 pm ]
Post subject:  RE:help with flickering

in addition to that, instead of setscreen("graphics")

put setscreen("offscreenonly")

it will stop the flickering. =)

Author:  shakin cookie [ Tue Jan 08, 2008 4:37 pm ]
Post subject:  RE:help with flickering

Either way works

Author:  shakin cookie [ Tue Jan 08, 2008 4:38 pm ]
Post subject:  RE:help with flickering

i have a question, what is this that you are making?

it seems to have no purpose...

Author:  rsknights0 [ Tue Jan 08, 2008 4:40 pm ]
Post subject:  Re: help with flickering

its some kind of an explosion for a shooter game its not done yet tho

Author:  shakin cookie [ Tue Jan 08, 2008 4:42 pm ]
Post subject:  RE:help with flickering

oh ok, btw did that help?

Author:  Sean [ Tue Jan 08, 2008 4:45 pm ]
Post subject:  Re: help with flickering

Shakin beat me earlier by a minute, damn you!

Author:  rsknights0 [ Tue Jan 08, 2008 4:46 pm ]
Post subject:  Re: help with flickering

yes thanks

Author:  shakin cookie [ Tue Jan 08, 2008 4:48 pm ]
Post subject:  RE:help with flickering

it's all in the wrist! =)

Author:  SIXAXIS [ Fri Feb 01, 2008 8:58 pm ]
Post subject:  Re: help with flickering

Turing:

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?

Author:  ericfourfour [ Fri Feb 01, 2008 10:23 pm ]
Post subject:  Re: help with flickering

Set your screen to offscreenonly.
Turing:
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:
Turing:


Call this as soon as you are done drawing a frame.

Author:  riveryu [ Mon Feb 18, 2008 8:02 pm ]
Post subject:  Re: help with flickering

ericfourfour wrote:

Set your screen to offscreenonly.
Turing:
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:
Turing:


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?

Author:  CodeMonkey2000 [ Mon Feb 18, 2008 8:04 pm ]
Post subject:  RE:help with flickering

I'm not sure what you are asking, so I'm just going to say no (a very confident no).

Author:  Mackie [ Mon Feb 18, 2008 8:38 pm ]
Post subject:  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.


: