summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/glrender.cc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-04-19 23:59:33 +0000
committerKarl Berry <karl@freefriends.org>2010-04-19 23:59:33 +0000
commitdddce3148a2bc785603576b18ffcf72d39adbe47 (patch)
tree14f4c79ef11bcf0820a8d4ff2ab0c5ac009c365c /Build/source/utils/asymptote/glrender.cc
parenta01e51b01f5819b6091af48cdca581e9f2a9282e (diff)
asy 1.93
git-svn-id: svn://tug.org/texlive/trunk@17934 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/glrender.cc')
-rw-r--r--Build/source/utils/asymptote/glrender.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/Build/source/utils/asymptote/glrender.cc b/Build/source/utils/asymptote/glrender.cc
index e2b5c094ed3..41c2f66c0c9 100644
--- a/Build/source/utils/asymptote/glrender.cc
+++ b/Build/source/utils/asymptote/glrender.cc
@@ -11,7 +11,7 @@
#include "common.h"
-#ifdef HAVE_LIBGL
+#ifdef HAVE_GL
// For CYGWIN
#ifndef FGAPI
@@ -323,18 +323,15 @@ void drawscene(double Width, double Height)
double size2=hypot(Width,Height);
- glEnable(GL_BLEND);
// Render opaque objects
Picture->render(nurb,size2,m,M,perspective,false);
// Enable transparency
- glEnable(GL_BLEND);
glDepthMask(GL_FALSE);
// Render transparent objects
Picture->render(nurb,size2,m,M,perspective,true);
glDepthMask(GL_TRUE);
- glDisable(GL_BLEND);
}
// Return x divided by y rounded up to the nearest integer.
@@ -397,6 +394,7 @@ void Export()
outOfMemory();
}
setProjection();
+ glutPostRedisplay();
#ifdef HAVE_LIBPTHREAD
if(glthread && readyAfterExport) {
@@ -628,7 +626,7 @@ void display()
lastframetime=tv;
double milliseconds=1000.0*(delay-seconds);
if(milliseconds > 0)
- glutTimerFunc(milliseconds,nextframe,0);
+ glutTimerFunc((int) (milliseconds+0.5),nextframe,0);
else nextframe(0);
}
#endif
@@ -1326,7 +1324,9 @@ void glrender(const string& prefix, const picture *pic, const string& format,
if(maxWidth <= 0) maxWidth=max(maxHeight,2);
if(maxHeight <= 0) maxHeight=max(maxWidth,2);
if(screenWidth <= 0) screenWidth=maxWidth;
+ else screenWidth=min(screenWidth,maxWidth);
if(screenHeight <= 0) screenHeight=maxHeight;
+ else screenHeight=min(screenHeight,maxHeight);
oWidth=width;
oHeight=height;
@@ -1354,8 +1354,8 @@ void glrender(const string& prefix, const picture *pic, const string& format,
setosize();
if(View && settings::verbose > 1)
- cout << "Rendering " << prefix << " as " << Width << "x" << Height
- << " image" << endl;
+ cout << "Rendering " << stripDir(prefix) << " as "
+ << Width << "x" << Height << " image" << endl;
}
#ifdef HAVE_LIBPTHREAD
@@ -1462,9 +1462,12 @@ void glrender(const string& prefix, const picture *pic, const string& format,
setosize();
}
+ glEnable(GL_BLEND);
glEnable(GL_DEPTH_TEST);
glEnable(GL_MAP1_VERTEX_3);
+ glEnable(GL_MAP1_VERTEX_4);
glEnable(GL_MAP2_VERTEX_3);
+ glEnable(GL_MAP2_VERTEX_4);
glEnable(GL_MAP2_COLOR_4);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);