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

new option: GL2PS_NO_BLENDING
parent adec8ec0
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,10 @@ clean:
rm -f *.tex *.ps *.eps *.eps.gz *.pdf *.o gl2psTest a.out *~
cd doc && ${MAKE} clean
purge:
rm -f `find . -name "*~" -o -name "*~~" -o -name "\#*"\
-o -name ".\#*" -o -name "gmon.out"`
mac:
gcc -Wall -g -o gl2psTest gl2psTest.c gl2ps.c\
-framework OpenGL -framework GLUT -framework Cocoa
......
default:
default: gl2ps.ps gl2ps.html gl2ps.pdf
gl2ps.ps: gl2ps.tex
rm -f gl2ps.toc gl2ps.out gl2ps.aux
latex gl2ps
latex gl2ps
latex gl2ps
dvips gl2ps -o
make html
gl2ps.pdf: gl2ps.tex
rm -f gl2ps.toc gl2ps.out gl2ps.aux
pdflatex gl2ps
pdflatex gl2ps
pdflatex gl2ps
html:
gl2ps.html: gl2ps.tex gl2ps.ps
rm -f gl2ps.html
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">" >> gl2ps.html
echo "<html>" >> gl2ps.html
......
% $Id: gl2ps.tex,v 1.169 2004-05-09 08:19:33 geuzaine Exp $
% $Id: gl2ps.tex,v 1.170 2004-05-09 18:06:01 geuzaine Exp $
%
% GL2PS, an OpenGL to PostScript Printing Library
% Copyright (C) 1999-2004 Christophe Geuzaine <geuz@geuz.org>
......@@ -229,6 +229,9 @@ determine the way primitives are handled:
the plotting of smooth shaded primitives but can lead to problems when
converting PostScript files into PDF files. See also options \dd{nr},
\dd{ng}, \dd{nb} below.
\item[\dd{GL2PS_NO_BLENDING}] Blending (transparency) is disabled
alltogether (regardless of the current \dd{GL_BLEND} or \dd{GL2PS_BLEND}
status).
\item[\dd{GL2PS_OCCLUSION_CULL}] All the hidden polygons are removed from
the output, thus substantially reducing the size of the output file.
\item[\dd{GL2PS_USE_CURRENT_VIEWPORT}] The current OpenGL viewport is used
......@@ -540,8 +543,8 @@ glGetIntegerv(GL_VIEWPORT, viewport);
while( state == GL2PS_OVERFLOW ){
buffsize += 1024*1024;
gl2psBeginPage ( "MyTitle", "MySoftware", viewport,
GL2PS_EPS, GL2PS_BSP_SORT,
GL2PS_SIMPLE_LINE_OFFSET | GL2PS_SILENT |
GL2PS_EPS, GL2PS_BSP_SORT, GL2PS_SILENT |
GL2PS_SIMPLE_LINE_OFFSET | GL2PS_NO_BLENDING |
GL2PS_OCCLUSION_CULL | GL2PS_BEST_ROOT,
GL_RGBA, 0, NULL, 0, 0, 0, buffsize,
fp, NULL );
......
/* $Id: gl2ps.c,v 1.172 2004-05-09 16:35:27 geuzaine Exp $ */
/* $Id: gl2ps.c,v 1.173 2004-05-09 18:06:01 geuzaine Exp $ */
/*
* GL2PS, an OpenGL to PostScript Printing Library
* Copyright (C) 1999-2004 Christophe Geuzaine <geuz@geuz.org>
......@@ -687,7 +687,7 @@ static void gl2psAdaptVertexForBlending(GL2PSvertex *v)
if(!v || !gl2ps)
return;
if(GL_FALSE == gl2ps->blending){
if(gl2ps->options & GL2PS_NO_BLENDING || !gl2ps->blending){
v->rgba[3] = 1.0F;
return;
}
......@@ -4399,12 +4399,7 @@ GL2PSDLL_API GLint gl2psDrawPixels(GLsizei width, GLsizei height,
switch(format){
case GL_RGBA:
if(GL_TRUE == glIsEnabled(GL_BLEND)){
size = height * width * 4;
prim->data.image->pixels = (GLfloat*)gl2psMalloc(size * sizeof(GLfloat));
memcpy(prim->data.image->pixels, pixels, size * sizeof(GLfloat));
}
else{
if(gl2ps->options & GL2PS_NO_BLENDING || !gl2ps->blending){
/* special case: blending turned off */
prim->data.image->format = GL_RGB;
size = height * width * 3;
......@@ -4416,6 +4411,11 @@ GL2PSDLL_API GLint gl2psDrawPixels(GLsizei width, GLsizei height,
++piv;
}
}
else{
size = height * width * 4;
prim->data.image->pixels = (GLfloat*)gl2psMalloc(size * sizeof(GLfloat));
memcpy(prim->data.image->pixels, pixels, size * sizeof(GLfloat));
}
break;
case GL_RGB:
default:
......
/* $Id: gl2ps.h,v 1.86 2004-03-17 17:02:39 geuzaine Exp $ */
/* $Id: gl2ps.h,v 1.87 2004-05-09 18:06:01 geuzaine Exp $ */
/*
* GL2PS, an OpenGL to PostScript Printing Library
* Copyright (C) 1999-2004 Christophe Geuzaine <geuz@geuz.org>
......@@ -123,6 +123,7 @@
#define GL2PS_NO_PIXMAP (1<<8)
#define GL2PS_USE_CURRENT_VIEWPORT (1<<9)
#define GL2PS_COMPRESS (1<<10)
#define GL2PS_NO_BLENDING (1<<11)
/* Arguments for gl2psEnable/gl2psDisable */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment