Created
May 20, 2012 18:59
-
-
Save MhdAljuboori/2759148 to your computer and use it in GitHub Desktop.
Draw not moving thing in OpenGL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************** 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