|
From: <ste...@ge...> - 2000-12-28 20:39:04
|
Oh, well... that's sound kinda cool.
I'm doing something like this in my programs;
unsigned char *VGA =3D (unsigned char *) MK_FP(0xA000, 0);
unsigned char *BUFF =3D NULL;
BUFF =3D new unsigned char[64000]; 320x200 =3D 64000
draw_stuff_to_buff( );
__fmemcpy(VGA, BUFF, 64000);
So, is there anyone who has something to use for some kewl and fast =
graphics for games in min. 640x480. I'm using Turbo C++ 3.0
Thanks!
----- Original Message -----=20
From: Elias Pschernig=20
To: dev...@li...=20
Sent: Wednesday, December 27, 2000 3:52 PM
Subject: Re: [Dev-C++] some more to Graphics
oh, and also... I would like to know about page-flipping/buffering =
in 640x480??
If you want to know the difference to 320x200, it is basically the =
same. Only, in 320x200 you don't need page-flipping because you can =
update all the pixels on the screen fast enough to get smooth animation =
without it.
=20
Page flipping is a technique to create smooth graphics movement. =
Basically, you 'buffer' the data to be displayed, and only when they are =
ready, they are displayed. For example, if you make an animation where a =
circle moves over a background, you will use an 'offscreen-page' or =
'back-buffer' where you first draw the background, then the circle over =
it, and then display it. While it is displayed, you (invisibly) draw the =
background on the next offscreen page, then the circle on it, and then =
swap both pages, so the new one gets displayed. Now you draw the next =
animation frame on the first page, and so on... the same is used for =
more complex animations like in 3d games. The advantage is that the =
watcher of the program never sees how the background and the circle are =
drawn, so it looks like there is a smooth animation. (as long as you =
flip new pages at least about 30 times per second)
I'm not sure how you can tell a DOS program to do this. I'm using the =
DOS-Allegro library where i have a function show_video_page to do the =
page-flipping, or DirectX where you have Surface->Flip or something =
similiar depending on the version.
Elias Pschernig
|