Mail Archives: djgpp/1997/09/15/00:20:01
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 -