本文整理汇总了C++中Paths::render方法的典型用法代码示例。如果您正苦于以下问题:C++ Paths::render方法的具体用法?C++ Paths::render怎么用?C++ Paths::render使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paths
的用法示例。
在下文中一共展示了Paths::render方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(void){
int running = GL_TRUE;
char currentKey = 'A';
SphereRotate sphereA;
coneRotate coneB;
SphereNormals normalsC;
Paths pathsE;
SphereShaded shadedD;
//initialise GLFW
if(!glfwInit()) {
exit(EXIT_FAILURE);
}
//open window
if(!glfwOpenWindow(600, 600, 0, 0, 0, 0, 0, 0, GLFW_WINDOW)){
glfwTerminate();
exit(EXIT_FAILURE);
}
glewInit();
if(!(sphereA.init() && coneB.init() && normalsC.init() && pathsE.init() && shadedD.init()))
exit(EXIT_FAILURE);
while( running ) {
//render here
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearColor(0, 0, 0, 1);
if(currentKey == 'A'){
sphereA.render();
} else if(currentKey =='B'){
coneB.render();
} else if(currentKey == 'C'){
normalsC.render();
} else if(currentKey == 'D'){
shadedD.render();
} else if(currentKey == 'E'){
pathsE.render();
}
//check("draw");
glfwSwapBuffers();
//check("swap buffers");
//check esc key
running= !(glfwGetKey(GLFW_KEY_ESC) || glfwGetKey('Q')) && glfwGetWindowParam(GLFW_OPENED);
if(glfwGetKey('A'))
currentKey = 'A';
else if(glfwGetKey('B'))
currentKey='B';
else if(glfwGetKey('C'))
currentKey='C';
else if(glfwGetKey('D'))
currentKey='D';
else if(glfwGetKey('E'))
currentKey = 'E';
glFlush();
}
//end app
glfwTerminate();
exit(EXIT_SUCCESS);
}