trying to fix rendering of managed objects when a textured object comes along...
git-svn-id: svn://anubis/anaglym/trunk@174 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
parent
cdfaf84c28
commit
6647f81dc0
10
Engine.cc
10
Engine.cc
@ -906,19 +906,20 @@ void Engine::Object::createManagedObject()
|
||||
/* prerequisite: m_args->size() is big enough */
|
||||
void Engine::Object::render()
|
||||
{
|
||||
GLUquadric * quad = gluNewQuadric();
|
||||
if (m_display_list <= 0)
|
||||
m_display_list = glGenLists(1);
|
||||
glNewList(m_display_list, GL_COMPILE);
|
||||
GLUquadric * quad = gluNewQuadric();
|
||||
glPushAttrib(GL_ENABLE_BIT);
|
||||
if (m_texture != 0)
|
||||
{
|
||||
gluQuadricTexture(quad, 1);
|
||||
glPushAttrib(GL_ENABLE_BIT);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glBindTexture(GL_TEXTURE_2D, m_texture);
|
||||
}
|
||||
else
|
||||
{
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, m_color);
|
||||
}
|
||||
switch (m_geom_type)
|
||||
@ -1090,10 +1091,7 @@ void Engine::Object::render()
|
||||
break;
|
||||
}
|
||||
gluDeleteQuadric(quad);
|
||||
if (m_texture != 0)
|
||||
{
|
||||
glPopAttrib();
|
||||
}
|
||||
glPopAttrib();
|
||||
glEndList();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user