00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 #ifndef __GL2PS_H__
00035 #define __GL2PS_H__
00036 
00037 #include <stdio.h>
00038 #include <stdlib.h>
00039 
00040 
00041 
00042 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
00043 #  if defined(_MSC_VER)
00044 #    pragma warning(disable:4115)
00045 #  endif
00046 #  include <windows.h>
00047 #  if defined(GL2PSDLL)
00048 #    if defined(GL2PSDLL_EXPORTS)
00049 #      define GL2PSDLL_API __declspec(dllexport)
00050 #    else
00051 #      define GL2PSDLL_API __declspec(dllimport)
00052 #    endif
00053 #  else
00054 #    define GL2PSDLL_API
00055 #  endif
00056 #else
00057 #  define GL2PSDLL_API
00058 #endif
00059 
00060 #if defined(__APPLE__) || defined(HAVE_OPENGL_GL_H)
00061 #  include <OpenGL/gl.h>
00062 #else
00063 #  include <GL/gl.h>
00064 #endif
00065 
00066 
00067 
00068 
00069 #if defined(HAVE_ZLIB) || defined(HAVE_LIBZ)
00070 #  define GL2PS_HAVE_ZLIB
00071 #  if defined(HAVE_LIBPNG) || defined(HAVE_PNG)
00072 #    define GL2PS_HAVE_LIBPNG
00073 #  endif
00074 #endif
00075 
00076 
00077 
00078 #define GL2PS_MAJOR_VERSION 1
00079 #define GL2PS_MINOR_VERSION 3
00080 #define GL2PS_PATCH_VERSION 2
00081 #define GL2PS_EXTRA_VERSION ""
00082 
00083 #define GL2PS_VERSION (GL2PS_MAJOR_VERSION + \
00084                        0.01 * GL2PS_MINOR_VERSION + \
00085                        0.0001 * GL2PS_PATCH_VERSION)
00086 
00087 #define GL2PS_COPYRIGHT "(C) 1999-2006 Christophe Geuzaine (geuz@geuz.org)"
00088 
00089 
00090 
00091 #define GL2PS_PS  0
00092 #define GL2PS_EPS 1
00093 #define GL2PS_TEX 2
00094 #define GL2PS_PDF 3
00095 #define GL2PS_SVG 4
00096 #define GL2PS_PGF 5
00097 
00098 
00099 
00100 #define GL2PS_NO_SORT     1
00101 #define GL2PS_SIMPLE_SORT 2
00102 #define GL2PS_BSP_SORT    3
00103 
00104 
00105 
00106 #define GL2PS_SUCCESS       0
00107 #define GL2PS_INFO          1
00108 #define GL2PS_WARNING       2
00109 #define GL2PS_ERROR         3
00110 #define GL2PS_NO_FEEDBACK   4
00111 #define GL2PS_OVERFLOW      5
00112 #define GL2PS_UNINITIALIZED 6
00113 
00114 
00115 
00116 #define GL2PS_NONE                 0
00117 #define GL2PS_DRAW_BACKGROUND      (1<<0)
00118 #define GL2PS_SIMPLE_LINE_OFFSET   (1<<1)
00119 #define GL2PS_SILENT               (1<<2)
00120 #define GL2PS_BEST_ROOT            (1<<3)
00121 #define GL2PS_OCCLUSION_CULL       (1<<4)
00122 #define GL2PS_NO_TEXT              (1<<5)
00123 #define GL2PS_LANDSCAPE            (1<<6)
00124 #define GL2PS_NO_PS3_SHADING       (1<<7)
00125 #define GL2PS_NO_PIXMAP            (1<<8)
00126 #define GL2PS_USE_CURRENT_VIEWPORT (1<<9)
00127 #define GL2PS_COMPRESS             (1<<10)
00128 #define GL2PS_NO_BLENDING          (1<<11)
00129 #define GL2PS_TIGHT_BOUNDING_BOX   (1<<12)
00130 
00131 
00132 
00133 #define GL2PS_POLYGON_OFFSET_FILL 1
00134 #define GL2PS_POLYGON_BOUNDARY    2
00135 #define GL2PS_LINE_STIPPLE        3
00136 #define GL2PS_BLEND               4
00137 
00138 
00139 
00140 
00141 
00142 
00143 
00144 #define GL2PS_TEXT_C  1
00145 #define GL2PS_TEXT_CL 2
00146 #define GL2PS_TEXT_CR 3
00147 #define GL2PS_TEXT_B  4
00148 #define GL2PS_TEXT_BL 5
00149 #define GL2PS_TEXT_BR 6
00150 #define GL2PS_TEXT_T  7
00151 #define GL2PS_TEXT_TL 8
00152 #define GL2PS_TEXT_TR 9
00153 
00154 typedef GLfloat GL2PSrgba[4];
00155 
00156 #if defined(__cplusplus)
00157 extern "C" {
00158 #endif
00159 
00160 GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer, 
00161                                   GLint viewport[4], GLint format, GLint sort,
00162                                   GLint options, GLint colormode,
00163                                   GLint colorsize, GL2PSrgba *colormap, 
00164                                   GLint nr, GLint ng, GLint nb, GLint buffersize,
00165                                   FILE *stream, const char *filename);
00166 GL2PSDLL_API GLint gl2psEndPage(void);
00167 GL2PSDLL_API GLint gl2psSetOptions(GLint options);
00168 GL2PSDLL_API GLint gl2psBeginViewport(GLint viewport[4]);
00169 GL2PSDLL_API GLint gl2psEndViewport(void);
00170 GL2PSDLL_API GLint gl2psText(const char *str, const char *fontname, 
00171                              GLshort fontsize);
00172 GL2PSDLL_API GLint gl2psTextOpt(const char *str, const char *fontname, 
00173                                 GLshort fontsize, GLint align, GLfloat angle);
00174 GL2PSDLL_API GLint gl2psSpecial(GLint format, const char *str);
00175 GL2PSDLL_API GLint gl2psDrawPixels(GLsizei width, GLsizei height,
00176                                    GLint xorig, GLint yorig,
00177                                    GLenum format, GLenum type, const void *pixels);
00178 GL2PSDLL_API GLint gl2psEnable(GLint mode);
00179 GL2PSDLL_API GLint gl2psDisable(GLint mode);
00180 GL2PSDLL_API GLint gl2psPointSize(GLfloat value);
00181 GL2PSDLL_API GLint gl2psLineWidth(GLfloat value);
00182 GL2PSDLL_API GLint gl2psBlendFunc(GLenum sfactor, GLenum dfactor);
00183 
00184 
00185 GL2PSDLL_API GLint gl2psDrawImageMap(GLsizei width, GLsizei height,
00186                                      const GLfloat position[3],
00187                                      const unsigned char *imagemap);
00188 GL2PSDLL_API const char *gl2psGetFileExtension(GLint format);
00189 GL2PSDLL_API const char *gl2psGetFormatDescription(GLint format);
00190 
00191 #if defined(__cplusplus)
00192 }
00193 #endif
00194 
00195 #endif