Respond to this messageReturn to Index
Original Message
  • Re: How I am doing it
    • Anonymous (no login)
      Posted Jul 21, 2011 3:03 PM

      never used allegro before, but after looking through examples, this seems like a similar effect to DATA/GET/PUT in QB. not sure what you guys are talking about, though

      #include <allegro.h>



      int main(void)

      {

      if (allegro_init() != 0) return 1;



      install_keyboard();

      set_gfx_mode(GFX_AUTODETECT, 320, 240, 0, 0);



      set_color_depth(8);

      clear_to_color(screen, 0);

      BITMAP *m = create_bitmap(10,10);

      clear_to_color(m, 0);



      int dat[100]={

      10,10,10,10,10,10,10,10,10,10,

      10,10,10,10,10,10,10,10,10,10,

      10,10,00,00,10,10,10,00,00,10,

      10,10,10,00,10,10,10,00,10,10,

      10,10,10,10,10,10,10,10,10,10,

      10,10,10,10,10,10,10,10,10,10,

      10,10,10,10,10,10,10,10,10,10,

      10,00,00,00,00,00,00,00,00,10,

      10,10,10,10,10,10,10,10,10,10,

      10,10,10,10,10,10,10,10,10,10

      };

      int x,y,z=00;

      for(y=0;y<=9;y++){

      for(x=0;x<=9;x++){

      m->line[y][x]=dat[z];

      z++;

      }

      }



      /* similar to PUT in QB */

      blit(m, screen, 0,0,160,120,10,10);



      release_screen();



      readkey();



      return 0;

      }

      END_OF_MAIN()

    Your Name
    Message Title
    Message Text
    Image Services Photobucket.com
    Options
    Enable formatted text (what's this?)