Posts: 3,616
Threads: 287
Joined: Jan 2003
This afternoon I downloaded the Allegro binaries for Mingw32 (I'm using Dev-C++, ver 4.9). I copied the contents of the include directory of Allegro into the mingw32 include dir, and the lib files into the lib directory. Of course, the dlls I copied into the windows/system directory.
This thread will probably house many questions of mine re Allegro...and here's the first one:
How can I set the screen mode to the equivalent of SCREEN 13? I didn't understand the set_gfx_mode() documentation.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 1,272
Threads: 36
Joined: Feb 2003
set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 320, 200, 0, 0);
Or, if you want a window:
set_gfx_mode(GFX_AUTODETECT_WINDOWED, 320, 200, 0, 0);
Posts: 3,616
Threads: 287
Joined: Jan 2003
Thanks!
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 1,080
Threads: 87
Joined: Feb 2002
Do you have the help file in .chm format? Else download it,
it describes every? allegro function, and is split up in "chapters"
like keyboard routines, blitting and sprites, etc.
/post]
Posts: 3,616
Threads: 287
Joined: Jan 2003
Where can I get it?
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 1,272
Threads: 36
Joined: Feb 2003
http://alleg.sourceforge.net/api.html
This (the english version 4.1.12 doc in chm format) is probably what you want.
Posts: 3,616
Threads: 287
Joined: Jan 2003
Cool, thanks!
Another qustion: Does Allegro have the equivalent of GET/PUT in QB?
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 6,419
Threads: 74
Joined: Mar 2002
Read the manual: "blitting and sprites" and "bitmap objects".
You just have bitmaps, like I told you in MSN messenger. In that chapter it explains what you can do with those bitmaps. Functions like blit cover all the functionality of GET/PUT.
Look at this tiny proggie (I wrote this directly here, it may be wrong ):
Code: #include <allegro.h>
int main(void)
{
BITMAP *sprite;
BITMAP *buffer;
int x=320, y=240, mx = 1, my = 1;
allegro_init();
install_keyboard();
set_color_depth(16);
set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 640, 480, 0, 0);
buffer = create_bitmap (640, 480);
/* Draw some gfx to our sprite: */
sprite = create_bitmap(32, 32);
rectfill (sprite, 0, 0, 31, 31, makecol(255, 0, 0));
rectfill (sprite, 4, 4, 27, 27, makecol(0,255,0));
rect (sprite, 6, 6, 25, 25, makecol(0,255,255));
while (!key[KEY_ESC])
{
/* move */
x += mx;
y += my;
if (x == 0 || x == 608) mx = -mx;
if (y == 0 || y == 448) my = -my;
/* clear buffer */
clear_bitmap (buffer);
/* draw sprite */
blit (sprite, buffer, 0, 0, x, y, 32, 32);
/* vsync */
vsync ();
/* make stuff visible */
blit (buffer, screen, 0, 0, 0, 0, 640, 480);
}
remove_keyboard();
allegro_exit();
return (0);
}END_OF_MAIN;
Posts: 3,616
Threads: 287
Joined: Jan 2003
Okay - So everything runs off bitmaps, I see. And "screen" is a predefined one?
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 6,419
Threads: 74
Joined: Mar 2002
Yeah. As it says on the reference ( ) screen is a predefined bitmap that is created when you call to set_screen_mode and represents your actual screen. It measures SCREEN_W x SCREEN_H pixels.
|