From: Soyka Date: Thu, 27 Apr 1995 09:42:01 -0400 To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: djgpp.env I am having a problem changing the default graphics driver using the djgpp.env environment file. The default driver does NOT work with my mach32 graphics adapter- when trying to run the t05 test program, I get a "Graphics initialization error -- probably incorrect driver" message, the program hangs and a control-break is needed to get to the DOS prompt. After reading the docs, I found out I could change the default driver via the GO32 environment variable. So I tried a number of the other drivers in the drivers subdirectory and found that set go32=c:/djgpp/drivers/atipro.grd topline allowed t05 to run without error (topline was added for reasons that will be apparent later). Wishing to make this a permanent selection, I added the line GO32=driver %DJGPP%/drivers/atipro.grd topline to my djgpp.env file and cleared the variable from the environment. Rerunning t05.bat, I saw the topline messages during the build but once again the "Graphics initialization error ..." message appeared when I t05 ran. I then inserted a call to getkey() as the first executable statement in t05.c and reran t05.bat. When getkey is reached, I don't see the expected status info on the top line and still get the graphics error when GrLine() is called. Suspecting that something might be "funny" with GO32 entry in djgpp.env, I moved the GO32 line into a .BAT file, defined DJGDIR, and executed the bat file and t05, and everything works OK. Interestingly, with the GO32 environment variable defined and also present in djgpp.env, everything is OK, even though GO32 is not prefixed with '+'. In summary, so long as the environment variable GO32 is defined before go32 is invoked, everything is OK but if I delete the environment variable, things break. As a work around, I've put the set GO32 statement into my setupdjg.bat file. I guess I should be satisfied and move on but something's not right here. Anybody have any ideas what the problem is or how I can obtain additional diagnostics? Copy of djgpp.env follows: >> DJDIR=%:/>DJGPP% >> >> +USER=dosuser >> +TMPDIR=%DJDIR%/tmp >> +GO32TMP=%DJDIR%/tmp >> GO32=driver c:/gcc/drivers/atipro.grd gw 640 gh 480 topline >> >> [bison] >> BISON_HAIRY=%DJDIR%/lib/bison.hairy >> BISON_SIMPLE=%DJDIR%/lib/bison.simple >> >> [cpp] >> CPLUS_INCLUDE_PATH=%/>;CPLUS_INCLUDE_PATH%%DJDIR%/cplusinc;%DJDIR%/include >> C_INCLUDE_PATH=%/>;C_INCLUDE_PATH%%DJDIR%/include >> OBJCPLUS_INCLUDE_PATH=%/>;OBJCPLUS_INCLUDE_PATH%%DJDIR%/include;%DJDIR%/include/objc >> OBJC_INCLUDE_PATH=%/>;OBJC_INCLUDE_PATH%%DJDIR%/include;%DJDIR%/include/objc >> >> [flex] >> FLEX_SKELETON=%DJDIR%/lib/flex.skeleton >> >> [gcc] >> COMPILER_PATH=%/>;COMPILER_PATH%%DJDIR%/bin >> LIBRARY_PATH=%/>;LIBRARY_PATH%%DJDIR%/lib >> >> [info] >> INFOPATH=%/>;INFOPATH%%DJDIR%/docs;%DJDIR%/docs/djgpp;%DJDIR%/docs/texinfo Copy of modified t05.c follows: >> #include >> #include >> >> #define MODS >> >> main() >> { >> int c, i, mx, my; >> char buf[100]; >> >> #if defined(MODS) >> { >> char * penv; >> >> penv = getenv("GO32"); >> if (penv != 0 ) printf("%s = %s\n","GO32",penv); >> >> getkey(); >> } >> #endif >> >> GrSetMode(GR_default_graphics); >> c = GrAllocColor(255, 255, 0); >> mx = GrSizeX()-1; >> my = GrSizeY()-1; >> GrLine( 0, 0, mx, 0, c); >> GrLine(mx, 0, mx, my, c); >> GrLine(mx, my, 0, my, c); >> GrLine( 0, my, 0, 0, c); >> mx = GrSizeX()/2; >> my = GrSizeY()/2; >> GrLine( 0, 0, mx, my, c); >> sprintf(buf, "(%d,%d)", mx, my); >> GrTextXY(mx, my, buf, GrWhite(), GrBlack()); >> getkey(); >> GrSetMode(GR_default_text); >> }