Mail Archives: djgpp/2000/07/04/15:00:17
On Tue, 04 Jul 2000 18:43:49 GMT, eglebbk AT phys DOT uva DOT nl (Evert Glebbeek)
wrote:
>Newsgroup: comp.os.msdos.djgpp
> From: "23yrold3yrold" <cbarry AT pangea DOT ca>
> On Sun, 2 Jul 2000 10:53:54 -0500
>
>>I found the original program refused to page flip, simply because 640 x 960
>>seems too big for it to handle.
>How much video memory does your card have? I think Allegro comes with
>an `info' program in it's standard distribution that can tell you
>this.
vesainfo.exe
afinfo.exe
>BTW, what version of Allegro are you using?
Should be 3.9.32 (that's the latest version and is already as stable
as the last so-called Stable Release, if not more).
>>No prob compiling, big prob running.
>There are a few problems with your code; see below.
>
>>set_color_depth(16);
>>
>>set_gfx_mode(GFX_MODEX, 320, 240, 320, 480);
>16 bit colour doesn't normally work in VGA modes, such as mode X, so
>you'll need to change to 8 bit colour if you want to do mode X.
Or switch to VESA modes. But do all video cards support 16-bit color
in 320x240? Or are they designed for Windows business applications?
>>page1 = create_sub_bitmap(screen, 0, 0, SCREEN_W, SCREEN_H);
>>page2 = create_sub_bitmap(screen, 0, SCREEN_H, SCREEN_W, SCREEN_H);
>>active_page = page2;
...
>> // Move the sprite according to the controls
>> if(key[KEY_LEFT])
>> {if(sx > 0) {sx = sx - 5;} else {sx = 0;};};
>> if(key[KEY_RIGHT])
>> {if(sx < 595) {sx = sx + 5;} else {sx = 595;};};
>> if(key[KEY_UP])
>> {if(sy > 0) {sy = sy - 5;} else {sy = 0;};};
>> if(key[KEY_DOWN])
>> {if(sy < 425) {sy = sy + 5;} else {sy = 425;};};
>Since you set your resolution to 320x240, any coordinates outside that
>space are outside the screen. Since RLE sprites can't be clipped
RLE sprites _are_ clipped. Compiled sprites are not guaranteed to be
clipped or even to be supported on some platforms.
>Finally a warning about page flipping. It's a great way for doing
>screen updates, but my own experience shows that it is incompatible
>with the Allegro GUI routines. Maybe that's because I'm doing
>something illegal by setting `page1=screen;'
screen is undefined if you use create_video_bitmap().
What you should do in this case is save `screen' in your init code and
then assign `screen' to whatever page is showing on screen.
--
Damian Yerrick
"I refuse to listen to those who refuse to listen to reason."
See the whole sig: http://www.rose-hulman.edu/~yerricde/sig.html
This is McAfee VirusScan. Add these two lines to your signature to
prevent the spread of signature viruses. http://www.mcafee.com/
- Raw text -