Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define ALLEGRO_STATICLINK
- -lalleg_s
- -lgdi32
- -lwinmm
- -lole32
- -ldxguid
- -ldinput
- -lddraw
- -ldsound
- #include <allegro.h>
- int main(void)
- {
- if (allegro_init() != 0) return 1; /* you should always do this at the start of Allegro programs */
- install_keyboard(); /* set up the keyboard handler */
- /* set a graphics mode sized 320x200 */
- if (set_gfx_mode(GFX_AUTODETECT, 320, 200, 0, 0) != 0) {
- if (set_gfx_mode(GFX_SAFE, 320, 200, 0, 0) != 0) {
- set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
- allegro_message("Unable to set any graphic mode\n%s\n", allegro_error);
- return 1;
- }
- }
- set_palette(desktop_palette); /* set the color palette */
- clear_to_color(screen, makecol(255, 255, 255)); /* clear the screen to white */
- /* you don't need to do this, but on some platforms (eg. Windows) things
- * will be drawn more quickly if you always acquire the screen before
- * trying to draw onto it.
- */
- acquire_screen();
- /* write some text to the screen with black letters and transparent background */
- textout_centre_ex(screen, font, "Hello, world!", SCREEN_W/2, SCREEN_H/2, makecol(0,0,0), -1);
- release_screen(); /* you must always release bitmaps before calling any input functions */
- readkey(); /* wait for a keypress */
- return 0;
- }
- END_OF_MAIN()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement