Mail Archives: djgpp/1996/06/21/08:28:35
Yup... me again... :)
I am having some problems with allegro. I am running under Windows 95, using
RHIDE as the Editor. I seem to have an erratic bug. I am making some GUI
class libraries, and things seem to go wrong in my CApp constructor. This
class simply initializes the entire system, ready for use. It goes like this
/*
CApp Class Implementation
=========================
*/
#include <allegro.h>
#include <stdlib.h>
#include <time.h>
#include <conio.h>
#include "app.h"
#include "gui.h"
#include "control.h"
#include "contlist.h"
CApp::CApp(int GfxCard, int Width, int Height)
{
// Initialize Allegro:
allegro_init();
install_keyboard();
install_mouse();
install_timer();
// Initialize Screen:
set_gfx_mode(GfxCard, Width, Height, 0, 0);
show_mouse(screen);
// Defaults:
ActiveWindow = NULL;
QuitFlag = FALSE; // Set to non-zero to quit the app
DblClickSpeed= 400; // Over-ride as necessary
Zone.Left = 0; // Define zone for window
Zone.Top = 0; // movement...
Zone.Width = SCREEN_W; // ...
Zone.Height = SCREEN_H; // ...
Event_Open();
};
Sometimes everything opens nice and correctly. Most mostly, ALLEGRO quits
with a GPF. From some testing, it seems to occur around the set_gfx_mode()
function. I am passing 'GFX_AUTODETECT, 640, 480' to the constructor which
then, as you can see gets put in the set_gfx_mode() function.
Has anyone got any ideas?
--
Cheers,
Ben -=Look for "Moo-Juice" on the IRC=-
---------------------====### legal notice ###====--------------------------
Microsoft Network is prohibited from redistributing this work in any
form,in whole or in part. License to distribute this post is available to
Microsoft for $499. Posting without permission constitutes an agreement to
these terms.
- Raw text -