Removed display lists.

This commit is contained in:
leo 2014-01-31 00:29:09 +00:00
parent ac6a61768c
commit 3b08ba7a0b
3 changed files with 4 additions and 24 deletions

View file

@ -536,14 +536,14 @@ void Piece::RenderBox(bool bHilite, float fLineWidth)
glLineWidth(2*fLineWidth);
glPushAttrib(GL_POLYGON_BIT);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glCallList(mPieceInfo->GetBoxDisplayList());
mPieceInfo->RenderBox();
glPopAttrib();
glLineWidth(fLineWidth);
}
else
{
lcSetColor(mColorIndex);
glCallList(mPieceInfo->GetBoxDisplayList());
mPieceInfo->RenderBox();
}
glPopMatrix();
}

View file

@ -14,7 +14,6 @@ PieceInfo::PieceInfo(int ZipFileIndex)
mFlags = 0;
mMesh = NULL;
mRefCount = 0;
m_nBoxList = 0;
}
PieceInfo::~PieceInfo()
@ -33,14 +32,8 @@ void PieceInfo::CreatePlaceholder(const char* Name)
mFlags = LC_PIECE_PLACEHOLDER;
}
void PieceInfo::CreateBoxDisplayList()
void PieceInfo::RenderBox()
{
if (m_nBoxList)
return;
// Create a display for the bounding box.
m_nBoxList = glGenLists(1);
glNewList(m_nBoxList, GL_COMPILE);
glEnableClientState(GL_VERTEX_ARRAY);
float box[24][3] =
@ -73,7 +66,6 @@ void PieceInfo::CreateBoxDisplayList()
glVertexPointer(3, GL_FLOAT, 0, box);
glDrawArrays(GL_QUADS, 0, 24);
glEndList();
}
void PieceInfo::Load()
@ -110,10 +102,6 @@ void PieceInfo::Unload()
delete mMesh;
mMesh = NULL;
if (m_nBoxList != 0)
glDeleteLists(m_nBoxList, 1);
m_nBoxList = 0;
}
// Zoom extents for the preview window and print catalog

View file

@ -76,14 +76,8 @@ public:
// Operations
void ZoomExtents(float Fov, float Aspect, float* EyePos = NULL) const;
void RenderPiece(int nColor);
void RenderBox();
// Implementation
GLuint GetBoxDisplayList()
{
if (!m_nBoxList)
CreateBoxDisplayList();
return m_nBoxList;
};
void CreatePlaceholder(const char* Name);
public:
@ -98,11 +92,9 @@ public:
protected:
int mRefCount;
GLuint m_nBoxList;
void Load();
void Unload();
void CreateBoxDisplayList();
};
#endif // _PIECEINF_H_