delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/23/15:05:49

From: et1850 AT aol DOT com (Et1850)
Newsgroups: comp.os.msdos.djgpp
Subject: Help me again please!
Lines: 46
NNTP-Posting-Host: ladder03.news.aol.com
X-Admin: news AT aol DOT com
Date: 23 Feb 1999 19:54:56 GMT
Organization: AOL http://www.aol.com
Message-ID: <19990223145456.01143.00001879@ng-cf1.aol.com>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

ok im stuck again. just learning the allegro library and monkeying around now.
how do i print text on the screen when i hit the mouse button. it woks when i
hit esc and then click a button.

#include <stdlib.h>
#include <stdio.h>
#include "allegro.h"
PALLETE my_pallete;
BITMAP *scry;

DIALOG the_dialog[] =
{

  { d_clear_proc,      0,    0,    0,    0,    255,  0,    0,    0,    0,    0,
   NULL },
  { d_icon_proc,       2,    2,    32,   32,   255,  9,    0,    0,    0,    0,
   NULL },
  { d_check_proc,      32,   64,   88,   12,   255,  0,    't',  0,    0,    0,
   "&Toggle Me" },
  { NULL,              0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
   NULL }
};

int main()
{
   allegro_init();
   install_keyboard(); 
   install_mouse();
   install_timer();
    set_gfx_mode(GFX_VESA1,1024,768,0,0);
   set_pallete(desktop_pallete);

   scry = load_bmp("shield.bmp",my_pallete);
   the_dialog[1].dp=scry;
   do_dialog(the_dialog, -1);
    do{

    if (mouse_b & 1)
     textout(screen,font,"Left button is pressed",116,112,255);
    if (mouse_b & 2)
     textout(screen,font,"Right button is pressed",116,112,255);
        } while (!keypressed());
        readkey();
        return 0;
}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019