Skip to content

Instantly share code, notes, and snippets.

@MhdAljuboori
Created May 20, 2012 18:59
Show Gist options
  • Save MhdAljuboori/2759148 to your computer and use it in GitHub Desktop.
Save MhdAljuboori/2759148 to your computer and use it in GitHub Desktop.
Draw not moving thing in OpenGL
/************** main.cpp **************/
int InitGL(GLvoid) {
......
myClass = new myClass();
myClass->Draw(pos);
......
}
int DrawGLScene(GLvoid) {
......
myClass->Draw();
......
}
/************** myClass.h **************/
Class myClass {
public:
myClass();
void Draw(Vector3 pos);
void Draw();
private:
GLuint myClassList;
}
/************** myClass.cpp **************/
myClass::myClass() {}
void myClass::Draw(Vector3 pos) {
glGenLists(1);
glNewList(terrainList,GL_COMPILE);
glPushMatrix();
.....
glPopMatrix();
}
void myClass::Draw() {
glCallList(terrainList);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment