www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/11/02/16:26:26

Date: Tue, 2 Nov 93 21:53:33 +0100
From: til AT zentrum DOT phys DOT chemie DOT tu-muenchen DOT de (Tilmann Haeberle)
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: optimization_related_graphics_problem

A graphics problem with dos extender version 1.10, patched with
CSDPMIT1.ZIP, Gnu-C version 2.4.1, running MS-DOS 6.0/DBLSPACE

I have a problem with the graphics, which seems to be related to an effect
which can be demonstrated using this tiny program (named tgra.c):

   #include <stdio.h>
   #include <graphics.h>

   main()
      {
      int x,y;
      GrSetMode(GR_default_graphics);
      x = GrMaxX();
      y = GrMaxY();
      GrLine(0,0,x,y,1);
      getkey();
      GrSetMode(GR_default_text);
      printf("Graphik: %d, %d\n", x,y);
      printf("Text: %d, %d\n", GrMaxX(), GrMaxY());
      }

When compiled without optimization using the following command line

   gcc tgra.c -o tgra1 -lgr

it behaves as expected and produces this output

   Graphik: 1023, 767
   Text: 79, 24

But, when I turn on optimization using the following command line

   gcc -O tgra.c -o tgra2 -lgr

it doesn't deliver the right value for GrMaxX() in graphics mode:

   Graphik: 80, 767
   Text: 79, 24

although the line drawn and the resolution selected seems to be correct.
Similar effects could be produced on several different machines with
different graphic cards, using values for GO32 like

   GO32=driver e:\gcc\drivers\tseng4k.grd gw 1024 gh 720

or similar with the driver files ati.grd or tridn89n.grd.
Using the value `nodpmi' in GO32 doesn't help. I think I've configured
everything allright, since I've used successful every release since 1.06.
It would be very helpful for me to get some hint.

Tilmann Haeberle
Institut fuer physikalische Chemie I
TU Muenchen
Lichtenbergstr. 4       Tel: 089/3209-3373
D-85747 Garching        Fax: 089/3209-3026
Germany                 e-mail: til AT zentrum DOT phys DOT chemie DOT tu-muenchen DOT de


- Raw text -


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