Mail Archives: djgpp/1996/04/03/19:24:18
I just downloaded the bcc2grx package today, and I've had a slight
problem. Outtextxy won't seem to work at all whenever I run my program.
The test simply doesn't show up on the screen. Anyway, here is a listing:
#include <libbcc.h>
#include <stdio.h>
#include <stdlib.h>
void initialize(void)
{
int gdriver = DETECT, gmode, errorcode;
initgraph(&gdriver, &gmode, "");
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* return with error code */
}
}
void main(void)
{
initialize();
settextstyle(DEFAULT_FONT, HORIZ_DIR, 1);
setfillstyle(SOLID_FILL, LIGHTGRAY);
bar(0, 0, 639, 20);
setcolor(WHITE);
line(0, 20, 0, 0);
line(0, 0, 639, 0);
setcolor(DARKGRAY);
line(639, 0, 639, 20);
line(0, 20, 639, 20);
setcolor(BLUE);
outtextxy(5, 5, "File"); /*won't do anything */
outtextxy(30, 30, "JKHFDD"); /* Again, nothing */
getch();
clearviewport();
closegraph();
}
The program works perfectly when compiled under Borland C++ 3.1. Please
post here or e-mail me if you know what's wrong, or I might have to return
to 16-bit real mode!
/-|rcanix
- Raw text -