Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - buffering graphics ???
Page 1 of 1

PostPosted: Mon Apr 30, 2001 1:19 am
by brendan
Does anyone have any idea how to stop flickering, I.E buffering the screen ?

have a look at my sample app

#define num_of_balls 20 //you must change number below as well.
#define gravity 3
#define friction 1

int quit = 0;

struct abl
{
int color; //a ball has a color
int velx; //x > 0 right, x < 0 left
int vely; //y > 0 up, y < 0 down
int locx; //currect x location
int locy; //currect y location
int diameter; // ball diameter
};

#define a_ball struct abl

a_ball balls[20]; //for some readin balls[num_of_balls] does not work ?

setup()
{
int i;
for(i = 0; i < num_of_balls; i++)
{
balls[i].locx = 120;
balls[i].locy = 300;
balls[i].velx = random(30)-15;
balls[i].vely = random(20)-40;
balls[i].color = random(255);
balls[i].diameter = random(8)+1;
}
}

display_balls()
{
int i;
for (i = 0; i < num_of_balls; i++)
{
setbrushattr(balls[i].color,0,0);
setbkcolor(balls[i].color,0,0);
circle(balls[i].locx,balls[i].locy,balls[i].diameter);
}
}

move_balls()
{
int i;
for (i = 0; i < num_of_balls; i++)
{
balls[i].vely = balls[i].vely + gravity; //adjust velocity

balls[i].locy = balls[i].locy + balls[i].vely; //new y location.

if (balls[i].locy > 320) //off the screen, going up.
{
balls[i].vely = 0 - balls[i].vely;
balls[i].locy = 320 - (balls[i].locy - 320);
}

balls[i].locx = balls[i].locx + balls[i].velx; //new x location.

if ((balls[i].locx > 240) || (balls[i].locx < 0)) //off the screen, other dir
{
balls[i].velx = 0 - balls[i].velx;
}
}
}

main()
{
setup();
while(quit == 0)
{
display_balls();
move_balls();
event(quit);
clearg();
}
}

PostPosted: Mon Apr 30, 2001 9:01 am
by Justinespinosa
it's no use trying to stop flickering, i asked kevin about a sprite support. I think we must wait for this.
just some things about your code:
setbkcolor() is only used for drawed text. So you don't need to change it.

And the global declared struct variables are not working correctly for the moment. I had a lot of problems with them.


J.Espinosa

OUTS Softwares

Edited by - justinespinosa on 04/30/2001 04:02:57

PostPosted: Mon Apr 30, 2001 9:22 pm
by brendan
mmm, should have mentioned that I'm using V3 :)
I found it a problem that a defined constant could not be used to define the array, the drawing bit I was playing around with, to see what draws faster, so yes there may be a little redundant code.

Interesting fact:
text(balls[i].locx,balls[i].locy,i); is faster than drawing circles ?

-anyhow, apparently you can move a large picture around the screen etc, what if you made a picture twice as wide as the screen so the second half was off the screen, then drew to that half, then moved the screen, so that half was now visiable, then erase what was just visiable, and redraw the new screen and swap again, and so on and so on, ???

-there has got to be a way ???

can you define 2 windows, and write to them, then swap them to foreground etc.


All I want is 2 pages to draw to, then commands like:

int page = 0;

for....
page = 1-page;
setactivepage(page);
draw....
setvisualpage(page);
end for

-I'll step down from my soap box now :)

PostPosted: Tue May 01, 2001 6:18 am
by Justinespinosa
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
text(balls[i].locx,balls[i].locy,i); is faster than drawing circles ?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
it should be faster. but these functions are from deep in the system. And we don't see the difference.
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
-anyhow, apparently you can move a large picture around the screen etc, what if you made a picture twice as wide as the screen so the second half was off the screen, then drew to that half, then moved the screen, so that half was now visiable, then erase what was just visiable, and redraw the new screen and swap again, and so on and so on, ???
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
You can't do this because PocketC don't redraw the pixels that are out of the standard window size (240*320 on the PPC)
So you will have to draw them only while the part of the window where you draw is visible. Otherwise, there will be erased when you move the window.
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
can you define 2 windows, and write to them, then swap them to foreground etc.


All I want is 2 pages to draw to, then commands like:

int page = 0;

for....
page = 1-page;
setactivepage(page);
draw....
setvisualpage(page);
end for

-I'll step down from my soap box now :)
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
you should be able to that with two applets are sharing the data with a file or the registry (registry is better because it's sorted). But now, PocketC V3 applets runs a lot of times. So you can't switch between the applets, that are your two pages. We should ask kevin, when he comes back, for a command line interface, to call pcshell.exe with a command line parameter allowing to select which to running applet we want to switch.


J.Espinosa

OUTS Softwares

Edited by - justinespinosa on 05/01/2001 01:19:45

PostPosted: Sat May 05, 2001 1:57 am
by brendan
mmm, seems like a lot of "stuffing" around just to get buffered graphics working ?, any idea on the sprite thing happning soon ? there are just sooo many things I wan't to do, but graphics is holding me back, I've just got my casio e-125, so i'll check out how it performs <img src=icon_smile.gif border=0 align=middle>