1
/* $Id: gl2psTest.c,v 1.84 2007/05/02 20:57:15 geuzaine Exp $ */
3
2
* GL2PS, an OpenGL to PostScript Printing Library
4
* Copyright (C) 1999-2007 Christophe Geuzaine <geuz@geuz.org>
3
* Copyright (C) 1999-2009 Christophe Geuzaine <geuz@geuz.org>
6
5
* This program is free software; you can redistribute it and/or
7
6
* modify it under the terms of either:
28
27
* library in the file named "COPYING.GL2PS"; if not, I will be glad
32
* Rouben Rostamian <rostamian@umbc.edu>
33
* Guy Barrand <barrand@lal.in2p3.fr>
34
* Micha Bieber <bieber@traits.de>
30
* For the latest info about gl2ps and a full list of contributors,
31
* see http://www.geuz.org/gl2ps/.
36
* For the latest info about gl2ps, see http://www.geuz.org/gl2ps/.
37
33
* Please report all bugs and problems to <gl2ps@geuz.org>.
251
251
/* call gl2psText before the glut function since glutBitmapCharacter
252
252
changes the raster position... */
253
gl2psText(string, fonts[4], 12);
253
gl2psTextOpt(string, fonts[4], 12, GL2PS_TEXT_BL, angle);
255
255
for (i = 0; i < strlen(string); i++)
256
256
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, string[i]);
260
261
double x = -1.25, y = -0.33, dy = 0.13;
262
263
glColor3f(1., 1., 0.);
264
glRasterPos2d(x, y); y -= dy;
265
printstring("Press:");
266
glRasterPos2d(x, y); y -= dy;
267
printstring(" p: to change the print format (PS, EPS, PDF, ...)");
268
glRasterPos2d(x, y); y -= dy;
269
printstring(" s: to save the images");
270
glRasterPos2d(x, y); y -= dy;
271
printstring(" t: to alternate between teapot and torus");
272
glRasterPos2d(x, y); y -= dy;
273
printstring(" v: to alternate between single and multiple viewport modes");
274
glRasterPos2d(x, y); y -= dy;
275
printstring(" b: to change the blending mode (transparency)");
276
glRasterPos2d(x, y); y -= dy;
277
printstring(" q: to quit");
278
glRasterPos2d(x, y); y -= dy;
279
printstring("Click and move the mouse to rotate the objects");
266
printstring("Press:", 0.);
269
printstring(" p: to change the print format (PS, EPS, PDF, ...)", 0.);
272
printstring(" s: to save the images", 0.);
275
printstring(" t: to alternate between teapot and torus", 0.);
278
printstring(" v: to alternate between single and multiple viewport modes", 0.);
281
printstring(" b: to change the blending mode (transparency)", 0.);
284
printstring(" q: to quit", 0.), 0.;
287
printstring("Click and move the mouse to rotate the objects", 0.);
289
glRasterPos2d(0, 0.75);
290
printstring("rotated", 45.);
281
292
gl2psSpecial(GL2PS_TEX, "% This should only be printed in LaTeX output!");
285
297
glColor3d (0.0,1.0,0.);
286
298
glBegin(GL_POLYGON);
287
299
glVertex3d( 0.5,-0.5,-0.5);
319
void image(float x, float y, GLboolean opaque){
331
void image(float x, float y, GLboolean opaque)
320
333
int w = 64, h = 66, row, col, pos = 0;
321
334
float *pixels, r = 0., g = 0., b = 0.;
482
499
void writefile(int format, int sort, int options, int nbcol,
483
char *filename, const char *extension){
500
char *filename, const char *extension)
486
504
int state = GL2PS_OVERFLOW, buffsize = 0;
591
void motion(int x, int y){
610
void motion(int x, int y)
596
int main(int argc, char **argv){
616
int main(int argc, char **argv)
597
618
glutInit(&argc, argv);
598
619
glutInitDisplayMode(GLUT_SINGLE | GLUT_DEPTH);
599
620
glutInitWindowSize(400, 600);