summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/glrender.cc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-04-02 23:03:22 +0000
committerKarl Berry <karl@freefriends.org>2013-04-02 23:03:22 +0000
commit324efbd652f973cd70f42fe08c665c518995bcbe (patch)
tree818ae382dfa133f3dcceec8e12e4cbd42be8bcf4 /Build/source/utils/asymptote/glrender.cc
parentbbf699abe485e707133ff3ba502119f261f27269 (diff)
asy 2.21 sources (no runtime update)
git-svn-id: svn://tug.org/texlive/trunk@29618 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 bc5a333f0d4..22486129110 100644
--- a/Build/source/utils/asymptote/glrender.cc
+++ b/Build/source/utils/asymptote/glrender.cc
@@ -192,7 +192,8 @@ void lighting()
for(size_t i=0; i < Nlights; ++i) {
GLenum index=GL_LIGHT0+i;
triple Lighti=Lights[i];
- GLfloat position[]={Lighti.getx(),Lighti.gety(),Lighti.getz(),0.0};
+ GLfloat position[]={(GLfloat) Lighti.getx(),(GLfloat) Lighti.gety(),
+ (GLfloat) Lighti.getz(),0.0};
glLightfv(index,GL_POSITION,position);
}
}
@@ -209,14 +210,16 @@ void initlighting()
size_t i4=4*i;
- GLfloat diffuse[]={Diffuse[i4],Diffuse[i4+1],Diffuse[i4+2],Diffuse[i4+3]};
+ GLfloat diffuse[]={(GLfloat) Diffuse[i4],(GLfloat) Diffuse[i4+1],
+ (GLfloat) Diffuse[i4+2],(GLfloat) Diffuse[i4+3]};
glLightfv(index,GL_DIFFUSE,diffuse);
- GLfloat ambient[]={Ambient[i4],Ambient[i4+1],Ambient[i4+2],Ambient[i4+3]};
+ GLfloat ambient[]={(GLfloat) Ambient[i4],(GLfloat) Ambient[i4+1],
+ (GLfloat) Ambient[i4+2],(GLfloat) Ambient[i4+3]};
glLightfv(index,GL_AMBIENT,ambient);
- GLfloat specular[]={Specular[i4],Specular[i4+1],Specular[i4+2],
- Specular[i4+3]};
+ GLfloat specular[]={(GLfloat) Specular[i4],(GLfloat) Specular[i4+1],
+ (GLfloat) Specular[i4+2],(GLfloat) Specular[i4+3]};
glLightfv(index,GL_SPECULAR,specular);
}
@@ -308,13 +311,13 @@ void drawscene(double Width, double Height)
double size2=hypot(Width,Height);
// Render opaque objects
- Picture->render(nurb,size2,m,M,perspective,false);
+ Picture->render(nurb,size2,m,M,perspective,Nlights,false);
// Enable transparency
glDepthMask(GL_FALSE);
// Render transparent objects
- Picture->render(nurb,size2,m,M,perspective,true);
+ Picture->render(nurb,size2,m,M,perspective,Nlights,true);
glDepthMask(GL_TRUE);
}