Advertisement
SilverTES

Allegro 4.2 link

Oct 6th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.33 KB | None | 0 0
  1. #define ALLEGRO_STATICLINK
  2. -lalleg_s
  3. -lgdi32
  4. -lwinmm
  5. -lole32
  6. -ldxguid
  7. -ldinput
  8. -lddraw
  9. -ldsound
  10.  
  11. #include <allegro.h>
  12. int main(void)
  13. {
  14.    if (allegro_init() != 0) return 1; /* you should always do this at the start of Allegro programs */
  15.      
  16.     install_keyboard(); /* set up the keyboard handler */
  17.  
  18.    /* set a graphics mode sized 320x200 */
  19.    if (set_gfx_mode(GFX_AUTODETECT, 320, 200, 0, 0) != 0) {
  20.       if (set_gfx_mode(GFX_SAFE, 320, 200, 0, 0) != 0) {
  21.     set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
  22.     allegro_message("Unable to set any graphic mode\n%s\n", allegro_error);
  23.     return 1;
  24.       }
  25.    }
  26.    set_palette(desktop_palette); /* set the color palette */
  27.    clear_to_color(screen, makecol(255, 255, 255)); /* clear the screen to white */
  28.  
  29.    /* you don't need to do this, but on some platforms (eg. Windows) things
  30.     * will be drawn more quickly if you always acquire the screen before
  31.     * trying to draw onto it.
  32.     */
  33.    acquire_screen();
  34.  
  35.    /* write some text to the screen with black letters and transparent background */
  36.    textout_centre_ex(screen, font, "Hello, world!", SCREEN_W/2, SCREEN_H/2, makecol(0,0,0), -1);
  37.    
  38.    release_screen(); /* you must always release bitmaps before calling any input functions */
  39.  
  40.    readkey(); /* wait for a keypress */
  41.    return 0;
  42. }
  43. END_OF_MAIN()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement