delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/17/17:25:49

From: "big choi" <supercms AT netian DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: mouse blinking..help meee..under allegro
Date: Wed, 18 Nov 1998 07:27:19 +0900
Organization: Korea Telecom
Lines: 66
Message-ID: <72st3u$ig9$1@news.kornet.nm.kr>
NNTP-Posting-Host: 210.113.149.153
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

this is my program..
now mouse picture is blinking.
i think because show_mouse is in for loop.
but i dont know method..
help me...

#include <stdlib.h>
#include <stdio.h>
#include "allegro.h"

BITMAP *back, *map;  // load the back picture
BITMAP *vback; // virtual screen

void close();
void init();

void close()
{
    destroy_bitmap(vback);
    destroy_bitmap(back);
    destroy_bitmap(map);
}

void init()
{
    allegro_init();
    install_timer();
    install_keyboard();
    install_mouse();

    set_color_depth(24);
    set_gfx_mode(GFX_AUTODETECT,640,480,0,0);

    position_mouse(319,239); // set the mouse position on screen
    set_mouse_range(0,0,639,479); // set the mouse range on screen

    vback = create_bitmap(640,480);
    clear(vback);
    map = create_bitmap(192,480);
    clear(map);

    map = load_pcx("back_1.pcx",NULL);
    back= load_pcx("db.pcx",NULL);
}

int main()
{
 init();

    while(1)
    {
       if(key[KEY_ESC])    {remove_keyboard(); break;}
        blit(back, vback, 0, 0, 0, 0, 640, 480);
        blit( map, vback, 0, 0, 447, 0, 192, 480);
        draw();
        blit(vback, screen, 0, 0, 0, 0, 640, 480);
        show_mouse(screen);
   clear_to_color(vback, 0);
    }
    close();
    return 0;
}




- Raw text -


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