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


C++ GraphicsWindow::getWindowHandle方法代码示例

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


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

示例1: main


//.........这里部分代码省略.........
	Framebuffer* opaqueFrameBuffer = new Framebuffer(window->getWindowWidth(),window->getWindowHeight());
	
	activeColorAttachmentsOpaque.push_back(0);

	opaqueFrameBuffer->setColorAttachment(0);

	//frameBuffer->setDepthAttachment();
	opaqueFrameBuffer->setDepthStencilTexture();

	opaqueFrameBuffer->unbind();

	Framebuffer* accumFrameBuffer = new Framebuffer(window->getWindowWidth(),window->getWindowHeight());
	
	activeColorAttachmentsTransparent.push_back(0);
	activeColorAttachmentsTransparent.push_back(1);

	accumFrameBuffer->setColorAttachment(0);
	accumFrameBuffer->setColorAttachment(1);

	//frameBuffer->setDepthAttachment();
	accumFrameBuffer->setDepthStencilTexture();

	accumFrameBuffer->unbind();

	// Additional textures to pass for the second transparency render pass.
	std::vector<GLuint> additionalTextureHandles;
	additionalTextureHandles.push_back(accumFrameBuffer->getColorAttachment(0));
	additionalTextureHandles.push_back(accumFrameBuffer->getColorAttachment(1));

	std::vector<GLuint> opaqueTextureHandle;
	opaqueTextureHandle.push_back(opaqueFrameBuffer->getColorAttachment(0));

	// Move this to "GraphicsWindow" 
	glfwSetCursorPos(window->getWindowHandle(), (double) (window->getWindowWidth()/2.0), (double) (window->getWindowHeight()/2.0));
	
	// Move this to "Camera"
	//glClearColor(0.4f,0.6f,0.94f,0.0f);
	glClearColor(0.0f,0.0f,0.0f,0.0f);

	const float clearColorWhite = 1.0f;
	const float clearColorBlack = 0.0f;

	// Sampler
	GLuint sampler = 0;
	glGenSamplers(1, &sampler);

	glSamplerParameteri(sampler, GL_TEXTURE_WRAP_S, GL_REPEAT);  
	glSamplerParameteri(sampler, GL_TEXTURE_WRAP_T, GL_REPEAT);
	glSamplerParameteri(sampler, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glSamplerParameteri(sampler, GL_TEXTURE_MIN_FILTER, GL_NEAREST);

	check_gl_error();

	// Render Loop
	while(!window->shouldClose())
	{
		//glClearColor(0.0f,0.0f,0.0f,0.0f);
		glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);

		glEnable(GL_DEPTH_TEST);
		glDepthFunc(GL_LEQUAL);
		glEnable(GL_CULL_FACE);
		glCullFace(GL_BACK);

		// Update camera
		camera->camControll(window->getWindowHandle());
开发者ID:GregJo,项目名称:BA-Framework,代码行数:67,代码来源:Main.cpp


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