本文整理汇总了C++中ModelFactory::BuildModel方法的典型用法代码示例。如果您正苦于以下问题:C++ ModelFactory::BuildModel方法的具体用法?C++ ModelFactory::BuildModel怎么用?C++ ModelFactory::BuildModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelFactory
的用法示例。
在下文中一共展示了ModelFactory::BuildModel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, const char * argv[]) {
ModelFactory modelFactory;
teapot = modelFactory.BuildModel("teapot.obj");
std::cout << teapot.m_Info.vertCount << std::endl;
if (!glfwInit())
exit(EXIT_FAILURE);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, GL_VERSION_MAJOR);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, GL_VERSION_MINOR);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_SAMPLES, 8);
GLFWwindow* window = glfwCreateWindow(WIN_WIDTH, WIN_HEIGHT, WIN_TITLE, NULL, NULL);
gScreenWidth = WIN_WIDTH;
gScreenHeight = WIN_HEIGHT;
if (!window) {
glfwTerminate();
exit(EXIT_FAILURE);
}
glfwMakeContextCurrent(window);
glfwSwapInterval(1);
glInit();
std::cout << glGetString(GL_RENDERER) << std::endl;
std::cout << glGetString(GL_VERSION) << std::endl;
glfwSetKeyCallback(window, KeyCallback);
glfwSetWindowSizeCallback(window, ResizeCallback);
while (!glfwWindowShouldClose(window)) {
glLoop();
glfwPollEvents();
glfwSwapBuffers(window);
}
glShutdown();
glfwDestroyWindow(window);
glfwTerminate();
return 0;
}