delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/04/05/13:30:25

Date: Tue, 5 Apr 1994 12:25:46 -0400
From: Frank Sandy <fsandy AT max DOT tiac DOT net>
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Can't Get Graphics

     I am trying, unsuccessfully, to use the graphics library that comes
with djgpp.  I expected the following trivial program to draw a single red
line.  The go32 environment variable is undefined.  I expected that I
would use the default VGA driver for now.  It is compiled and run with:

       gcc graph.c -lgr
       go32 a.out

#include <graphics.h>
void main () {
/* Trivial Test Program To Draw One Red Line */
  int	red;
  GrSetMode(GR_default_graphics,800,600);
  red = GrAllocColor(255,0,0);
  GrLine(60,60,200,400,red);
/* Try to restore text mode before exiting */
  GrSetMode(GR_80_25_text,80,25);
}

     My dos screen has a black background with white text.  The only 
time I get any output from this program, is if I run it after
running my elvis editor which leaves a blue background.  My program then
turns the screen area that still has a blue background to white but
does not draw a line.  Thereafter, elvis comes up with a white background
and its white text is invisible until I issue a mode con lines=25
command.

     Using libgrx instead of libgr produces no graphic output at all.

     In case its relevant I am running DOS 6.2 on a 486DX2.  I'm a 
Fortran programmer just learning C so maybe I missing some thing obvious.
Any help will be appreciated.

- Raw text -


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