当前位置: 首页>>代码示例>>C++>>正文


C++ Voxel::readPngDepthMap方法代码示例

本文整理汇总了C++中Voxel::readPngDepthMap方法的典型用法代码示例。如果您正苦于以下问题:C++ Voxel::readPngDepthMap方法的具体用法?C++ Voxel::readPngDepthMap怎么用?C++ Voxel::readPngDepthMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Voxel的用法示例。


在下文中一共展示了Voxel::readPngDepthMap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(int argc, char** argv)
{
	
	Model = glm::mat4();;
	View = glm::mat4();
	Projection = glm::mat4();;

	if (!glfwInit())
    exit(EXIT_FAILURE);
	
	glfwWindowHint(GLFW_CLIENT_API,GLFW_OPENGL_API);
	glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR,4);
	glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR,4);
	
	glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT,GL_TRUE );
	glfwWindowHint(GLFW_OPENGL_PROFILE ,GLFW_OPENGL_CORE_PROFILE);
	
	glfwSetErrorCallback(glfw_error_callback);
	
    GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL);
	
	if (!window)
	{
		glfwTerminate();
		exit(EXIT_FAILURE);
	}
	
	glfwMakeContextCurrent(window);
	
	glfwSetMouseButtonCallback(window, mouse_button_callback);
	glfwSetScrollCallback(window, scroll_callback);
	glfwSetCursorPosCallback(window, cursor_pos_callback);
	
	
	glfwSwapInterval(1);
	pngObject.readPngDepthMap("1341841873.505863.png");
	 
	if (!gladLoadGLLoader((GLADloadproc) glfwGetProcAddress))
    {
        std::cout << "Failed to initialize OpenGL context" << std::endl;
        return -1;
    }
	
	
	//glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
	glDebugMessageCallback(openglCallbackFunction, NULL);
	GLuint unusedIds = 0;
	glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, &unusedIds, true);
	
	init();
	
	int nbFrames;
	double currentTime = 0;
	double lastTime = 0;
	while (!glfwWindowShouldClose(window)){
	    display();

	    // Measure speed
	    double currentTime = glfwGetTime();
	    nbFrames++;

	    if (currentTime - lastTime >= 1.0) { // If last cout was more than 1 sec ago
	        char title[256];
	        title[255] = '\0';

	        snprintf(title, 255, "FPS: %d", nbFrames);

	        glfwSetWindowTitle(window, title);

	        nbFrames = 0;
	        lastTime += 1.0;
	    }

		glfwSwapBuffers(window);
		glfwPollEvents();

	}
	glfwDestroyWindow(window);
	glfwTerminate();
	
	return 0;
}
开发者ID:RishabhRawat,项目名称:3dLocalisation,代码行数:82,代码来源:voxelMergeTest.cpp


注:本文中的Voxel::readPngDepthMap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。