Mail Archives: djgpp/2000/02/08/19:30:57
From: | "Brian" <none AT none DOT com>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | clear_to_color(); function
|
Lines: | 59
|
X-Newsreader: | Microsoft Outlook Express 4.72.3110.1
|
X-MimeOLE: | Produced By Microsoft MimeOLE V4.72.3110.3
|
Message-ID: | <9M1o4.14156$oU2.2450805@tw12.nn.bcandid.com>
|
NNTP-Posting-Host: | 216.54.139.54
|
X-Trace: | tw12.nn.bcandid.com 950052997 216.54.139.54 (Tue, 08 Feb 2000 16:36:37 MST)
|
NNTP-Posting-Date: | Tue, 08 Feb 2000 16:36:37 MST
|
Organization: | bCandid - Powering the world's discussions - http://bCandid.com
|
Date: | Tue, 08 Feb 2000 23:36:37 GMT
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
I posted a message a while back ("My program's a machine killer") about my
machine rebooting when using the clear_to_color() function. Someone replied
saying that the code worked fine on their machine, but when I run it on my
computer, it reboots. It didn't start doing this until I started playing
with the clear_to_color() function. The code is below. Anybody have any idea
why this is happening? Anybody else have the same problem?
Thanks,
Brian
#include <stdio.h>
#include <stdlib.h>
#include "allegro.h"
char *listbox_getter(int index, int *list_size)
{
static char *strings[] =
{
"Entry 1", "Entry 2", "Entry 3"
};
if (index < 0)
{
*list_size = 3;
return NULL;
}
else
return strings[index];
}
DIALOG the_dialog[] =
{
{ d_list_proc, 0, 100, 320, 100,
0, 255, 0, 0,
0, 0, listbox_getter },
{ NULL, 0, 0, 0, 0,
0, 0, 0, 0,
0, 0, NULL }
};
#define LISTBOX_OBJECT 3
int main(int argc)
{
int ret;
allegro_init();
install_keyboard();
set_gfx_mode(GFX_VGA, 320, 200, 0, 0);
clear_to_color(screen, 0);
ret = do_dialog(the_dialog, -1);
readkey();
return 0;
}
- Raw text -