本文整理匯總了C++中Technique::usePipeline方法的典型用法代碼示例。如果您正苦於以下問題:C++ Technique::usePipeline方法的具體用法?C++ Technique::usePipeline怎麽用?C++ Technique::usePipeline使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Technique
的用法示例。
在下文中一共展示了Technique::usePipeline方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: main
int main(int argc, char **argv)
{
//Initialize glut
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_RGBA | GLUT_DOUBLE);
glutInitWindowPosition(50, 25);
glutInitWindowSize(WINDOW_WIDTH, WINDOW_HEIGHT);
glutCreateWindow("GL Test");
glutDisplayFunc(Render);
glutIdleFunc(Render);
glutSpecialFunc(keyHandler);
glutKeyboardFunc(specialHandler);
glutPassiveMotionFunc(mouseHandler);
//Initialize glew
GLenum res = glewInit();
if(res != GLEW_OK)
return 1;
//Set up GL state
glFrontFace(GL_CCW);
glCullFace(GL_BACK);
glEnable(GL_CULL_FACE);
glDepthFunc(GL_LEQUAL);
glEnable(GL_DEPTH_TEST);
//Set up renderer
eye = new Camera(WINDOW_WIDTH, WINDOW_HEIGHT);
eye->mPos = glm::vec3(0.0f, 0.0f, 3.0f);
pipeline.setCamera(eye);
//Set up the technique
tech.usePipeline(&pipeline);
solid.usePipeline(&pipeline);
//Load scene
Light::PntLight light;
light.mPos = glm::vec3(1.0f, 0.0f, 0.0f);
light.mCol = glm::vec3(1.0f, 0.0f, 0.0f);
LoadedMesh dragonMesh = LoadedMesh("Assets/Dragon/Dargon posing.obj");
Entity dragon = Entity(&dragonMesh);
LoadedMesh potMesh = LoadedMesh("Assets/teapot.obj");
Entity pot = Entity(&potMesh);
pot.updateScale(glm::vec3(0.1f, 0.1f, 0.1f));
scene.addEntity(dragon);
scene.addEntity(pot);
scene.addLight(light);
//Start loop
glutMainLoop();
return 0;
}