delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/15/00:20:01

Date: Sun, 14 Sep 1997 23:20:06 -0500 (CDT)
From: Andrew Deren <aderen AT eecs DOT uic DOT edu>
To: "Allen J. Batton" <abatton AT qni DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Question
In-Reply-To: <341C786C.A0F045D6@qni.com>
Message-ID: <Pine.SUN.3.95.970914231344.7391A-100000@ernie.eecs.uic.edu>
MIME-Version: 1.0

On Sun, 14 Sep 1997, Allen J. Batton wrote:

>    Hello Djgpp Coders,
> 
>     I wanted to ask and see if anyone knows of an freeware that will
> print grids? or, if not, how would I go about printing a grid with
> djgpp?  Is there a way I could use Allegros line,hline,etc. and print up
> the lines I print?
> 

DO you want to just print vertical and horizontal lines?
use this function to print them:
it's for allegro
/* x_space and y_space is the space between the lines */
void print_grid(int x_space, int y_space, int grid_color)
{
   int i, x_max, y_max;
   x_max = SCREEN_W / x_space; //number of vertical lines
   y_max = SCREEN_H / y_space; //number of horizontal lines

   //print vertical lines
   for (i=0; i<x_max; i++) 
      vline(screen, i*x_space, 0, SCREEN_H, grid_color);
   for (i=0; i<y_max; i++)
      hline(screen, 0, i*y_space, SCREEN_W, grid_color);
}

This little function will print the grid on the entire screen.
I did not test this so, I'm not really sure it it works..

>             Sincerly,
>             Joshua A. Batton
> 
> 


                        ,,,
                       (0 0)
   +-------------oOO----(_)-------------------+
   |                Andrew Deren              |  
   |             aderen AT eecs DOT uic DOT edu          |
   | www.eecs.uic.edu/~aderen/ader/main.html  |
   +-------------------------oOO--------------+
                       || ||
                      ooO Ooo
 


- Raw text -


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