Skip to content
Snippets Groups Projects
Commit 7e95e72b authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

Upgrade to latest gl2ps version
parent 095f7550
No related branches found
No related tags found
No related merge requests found
// $Id: CreateFile.cpp,v 1.39 2003-03-02 05:31:45 geuzaine Exp $
// $Id: CreateFile.cpp,v 1.40 2003-03-07 18:53:21 geuzaine Exp $
//
// Copyright (C) 1997 - 2003 C. Geuzaine, J.-F. Remacle
//
......@@ -216,11 +216,11 @@ void CreateOutputFile(char *name, int format)
size3d = 0;
res = GL2PS_OVERFLOW;
while(res == GL2PS_OVERFLOW) {
size3d += 2048 * 2048;
gl2psBeginPage(CTX.base_filename, "Gmsh", psformat, pssort, psoptions,
GL_RGBA, 0, NULL, size3d, fp, name);
gl2psBeginPage(CTX.base_filename, "Gmsh", CTX.viewport,
psformat, pssort, psoptions, GL_RGBA, 0, NULL,
0, 0, 0, size3d, fp, name);
CTX.print.gl_fonts = 0;
FillBuffer();
CTX.print.gl_fonts = 1;
......@@ -236,9 +236,9 @@ void CreateOutputFile(char *name, int format)
Msg(GERROR, "Unable to open file '%s'", name);
return;
}
gl2psBeginPage(CTX.base_filename, "Gmsh",
GL2PS_TEX, GL2PS_NO_SORT, 0,
GL_RGBA, 0, NULL, 1, fp, name);
gl2psBeginPage(CTX.base_filename, "Gmsh", CTX.viewport,
GL2PS_TEX, GL2PS_NO_SORT, GL2PS_NONE, GL_RGBA, 0, NULL,
0, 0, 0, 1, fp, name);
CTX.print.gl_fonts = 0;
FillBuffer();
CTX.print.gl_fonts = 1;
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* GL2PS, an OpenGL to PostScript Printing Library
* Copyright (C) 1999-2003 Christophe Geuzaine
*
* $Id: gl2ps.h,v 1.36 2003-03-01 22:34:18 geuzaine Exp $
* $Id: gl2ps.h,v 1.37 2003-03-07 18:53:21 geuzaine Exp $
*
* E-mail: geuz@geuz.org
* URL: http://www.geuz.org/gl2ps/
......@@ -55,7 +55,7 @@
#endif
#define GL2PS_VERSION 0.74
#define GL2PS_VERSION 0.8
#define GL2PS_NONE 0
/* Output file format */
......@@ -80,6 +80,7 @@
#define GL2PS_NO_TEXT (1<<5)
#define GL2PS_LANDSCAPE (1<<6)
#define GL2PS_NO_PS3_SHADING (1<<7)
#define GL2PS_NO_PIXMAP (1<<8)
/* Arguments for gl2psEnable/gl2psDisable */
......@@ -96,17 +97,15 @@
#define GL2PS_ZERO(arg) (fabs(arg)<1.e-20)
/*#define GL2PS_ZERO(arg) ((arg)==0.0)*/
/* Message levels */
/* Message levels and error codes */
#define GL2PS_SUCCESS 0
#define GL2PS_INFO 1
#define GL2PS_WARNING 2
#define GL2PS_ERROR 3
/* Error codes */
#define GL2PS_SUCCESS 0
#define GL2PS_NO_FEEDBACK -1
#define GL2PS_OVERFLOW -2
#define GL2PS_NO_FEEDBACK 4
#define GL2PS_OVERFLOW 5
#define GL2PS_UNINITIALIZED 6
/* Primitive types */
......@@ -115,6 +114,7 @@
#define GL2PS_LINE 3
#define GL2PS_QUADRANGLE 4
#define GL2PS_TRIANGLE 5
#define GL2PS_PIXMAP 6
/* BSP tree primitive comparison */
......@@ -174,12 +174,19 @@ typedef struct {
char *str, *fontname;
} GL2PSstring;
typedef struct {
GLsizei width, height;
GLenum format, type;
GLfloat *pixels;
} GL2PSimage;
typedef struct {
GLshort type, numverts;
char boundary, dash, culled;
GLfloat width, depth;
GL2PSvertex *verts;
GL2PSstring *text;
GL2PSimage *image;
} GL2PSprimitive;
typedef struct {
......@@ -187,32 +194,37 @@ typedef struct {
const char *title, *producer, *filename;
GLboolean shade, boundary;
GLfloat *feedback, offset[2];
GLint viewport[4];
GL2PSrgba *colormap, lastrgba, threshold;
float lastlinewidth;
GL2PSlist *primitives;
GL2PSbsptree2d *image;
GL2PSbsptree2d *imagetree;
FILE *stream;
} GL2PScontext;
/* public functions */
#ifdef __cplusplus
extern "C" {
#endif
GL2PSDLL_API void gl2psBeginPage(const char *title, const char *producer,
GLint format, GLint sort, GLint options,
GLint colormode, GLint colorsize,
GL2PSrgba *colormap, GLint buffersize,
GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer,
GLint viewport[4], GLint format, GLint sort,
GLint options, GLint colormode,
GLint colorsize, GL2PSrgba *colormap,
GLint nr, GLint ng, GLint nb, GLint buffersize,
FILE *stream, const char *filename);
GL2PSDLL_API GLint gl2psEndPage(void);
GL2PSDLL_API void gl2psText(const char *str, const char *fontname, GLshort fontsize);
GL2PSDLL_API void gl2psEnable(GLint mode);
GL2PSDLL_API void gl2psDisable(GLint mode);
GL2PSDLL_API void gl2psPointSize(GLfloat value);
GL2PSDLL_API void gl2psLineWidth(GLfloat value);
GL2PSDLL_API void gl2psNumShadeColors(GLint nr, GLint ng, GLint nb);
GL2PSDLL_API GLint gl2psBeginViewport(GLint viewport[4]);
GL2PSDLL_API GLint gl2psEndViewport(void);
GL2PSDLL_API GLint gl2psText(const char *str, const char *fontname, GLshort fontsize);
GL2PSDLL_API GLint gl2psDrawPixels(GLsizei width, GLsizei height,
GLint xorig, GLint yorig,
GLenum format, GLenum type, const void *pixels);
GL2PSDLL_API GLint gl2psEnable(GLint mode);
GL2PSDLL_API GLint gl2psDisable(GLint mode);
GL2PSDLL_API GLint gl2psPointSize(GLfloat value);
GL2PSDLL_API GLint gl2psLineWidth(GLfloat value);
#ifdef __cplusplus
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment