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


C++ drawScene函数代码示例

本文整理汇总了C++中drawScene函数的典型用法代码示例。如果您正苦于以下问题:C++ drawScene函数的具体用法?C++ drawScene怎么用?C++ drawScene使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: lockRenderTarget

void Renderer::CreateGBuffer()
{
	GLenum buffers [3] = { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2};
	COGLRenderTargetLock lockRenderTarget(m_gbuffer->GetRenderTarget(), 3, buffers);

	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	COGLBindLock lockProgram(m_createGBufferProgram->GetGLProgram(), COGL_PROGRAM_SLOT);

	drawScene(m_camera->GetViewMatrix(), m_camera->GetProjectionMatrix());
}
开发者ID:flosmn,项目名称:AntiradianceCuts,代码行数:11,代码来源:Render.cpp

示例2: glClear

void GLWidget::paintGL() {
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glEnable(GL_DEPTH_TEST);
	glDepthFunc(GL_LESS);
	glDisable(GL_TEXTURE_2D);

	glMatrixMode(GL_MODELVIEW);
	camera->applyCamTransform();	

	drawScene();	
}
开发者ID:gnishida,项目名称:StreetDesigner,代码行数:11,代码来源:GLWidget.cpp

示例3: update

		/// <summary>
		/// シーンの更新と描画を行います。
		/// </summary>
		/// <returns>
		/// シーンの更新に成功した場合 true, それ以外の場合は false
		/// </returns>
		bool update()
		{
			if (!updateScene())
			{
				return false;
			}

			drawScene();

			return true;
		}
开发者ID:azaika,项目名称:OpenSiv3D,代码行数:17,代码来源:SceneManager.hpp

示例4: ofPushView

void MissingControl::drawSection(float x, float y, float side) {
	ofPushView();
	ofViewport(x, y, side, side);
	ofSetupScreenOrtho(side, side, OF_ORIENTATION_DEFAULT, false, -stageHeight, stageHeight);
	ofTranslate(side / 2, side / 2);
	ofRotateX(-90);
	float scale = side / stageSize;
	ofScale(scale, scale, scale);
	drawScene(false);
	ofPopView();
}
开发者ID:cibomahto,项目名称:Missing,代码行数:11,代码来源:MissingControl.cpp

示例5: WndProc

LRESULT CALLBACK WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam)
{
	RECT rt;

	switch (iMessage)
	{
	case WM_CREATE:
		g_hDC = GetDC(hWnd);
		if (!bSetupPixelFormat(g_hDC))
			PostQuitMessage(0);
		g_hRC = wglCreateContext(g_hDC);
		wglMakeCurrent(g_hDC, g_hRC);
		GetClientRect(hWnd, &rt);
		initializeGL();
		ViewControl.initializeCamera();
		break;

	case WM_PAINT:
	case WM_SIZE:
		GetClientRect(hWnd, &rt);
		ViewControl.SetWindowWidthHeight(rt.right, rt.bottom);
		resize(rt.right, rt.bottom);
		drawScene();
		break;

	case WM_DESTROY:
		if (g_hRC)
			wglDeleteContext(g_hRC);
		if (g_hDC)
			ReleaseDC(hWnd, g_hDC);
		PostQuitMessage(0);
		break;
	}

	MSG_RESULT msgResultMenu  = menuEventMessage(hWnd, iMessage, wParam, lParam);
	if (msgResultMenu == MSG_CHECKEND) return TRUE;
	MSG_RESULT msgResultMouse = mouseEventMessage(hWnd, iMessage, wParam, lParam);
	if (ViewControl.mouseEventControl() == MOUSE_EVT_UPDATE) drawScene();
	if (msgResultMouse == MSG_CHECKEND) return TRUE;
	return (LONG)DefWindowProc(hWnd, iMessage, wParam, lParam);
}
开发者ID:jonntd,项目名称:mayadev-1,代码行数:41,代码来源:main_windows_api.cpp

示例6: ofPushStyle

//--------------------------------------------------------------
void testApp::draw() {
    if (oculusRift.isSetup()) {
        if (showOverlay) {

            oculusRift.beginOverlay(-230, 320, 240);
            ofRectangle overlayRect = oculusRift.getOverlayRectangle();

            ofPushStyle();
            ofEnableAlphaBlending();
            ofFill();
            ofSetColor(255, 40, 10, 200);

            ofRect(overlayRect);

            ofSetColor(255, 255);
            ofFill();

            ofSetColor(0, 255, 0);
            ofNoFill();
            ofCircle(overlayRect.getCenter(), 20);

            ofPopStyle();
            oculusRift.endOverlay();
        }

        oculusRift.beginLeftEye();
        drawScene();
        oculusRift.endLeftEye();

        oculusRift.beginRightEye();
        drawScene();
        oculusRift.endRightEye();

        oculusRift.draw();
    } else {
        cam.begin();
        drawScene();
        cam.end();
    }

}
开发者ID:jherico,项目名称:ofxOculusDK2,代码行数:42,代码来源:testApp.cpp

示例7: glClear

void View::paintGL()
{
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    m_camera->loadModelViewMatrix();
    drawScene();

    if( m_visualHints & VH_ShowAxis )
        drawAxis();

    if( m_visualHints & VH_ShowPlane )
        drawPlane();
}
开发者ID:0rps,项目名称:3dmanager,代码行数:12,代码来源:view.cpp

示例8: renderDepthMap_FrameBuffer

	void renderDepthMap_FrameBuffer ( int n, float wx, float wy )
	{
		float vmat[16];

		computeLightMatrix ( n, TEX_SIZE, TEX_SIZE );	

		glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, frameBufferObject);
		
		if ( n == 0 )	{	
			glFramebufferTexture2DEXT (GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, shadow1_id, 0);
		} else {		
			glFramebufferTexture2DEXT (GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, shadow2_id, 0);
		}
		
		if ( n == 0 )	glActiveTextureARB( GL_TEXTURE1_ARB );			// TEXTURE1 = shadow map stage	
		else			glActiveTextureARB( GL_TEXTURE2_ARB );			// TEXTURE2 = shadow map stage				
		
		glViewport (1, 1, TEX_SIZE-2, TEX_SIZE-2);		// Note: Avoid artifact cause by drawing into border pixels
		glClear ( GL_DEPTH_BUFFER_BIT );	
		glLoadIdentity();

		// Plight - projection matrix of light
		glMatrixMode ( GL_PROJECTION );			// Setup projection for depth-map rendering
		glLoadIdentity ();
		gluPerspective ( light_mfov*2.0, float(TEX_SIZE) / TEX_SIZE, LIGHT_NEAR, LIGHT_FAR );

		// L^-1 - light view matrix (gluLookAt computes inverse)
		glMatrixMode ( GL_MODELVIEW);			// Setup view for depth-map rendering
		glLoadIdentity ();
		gluLookAt ( light_x, light_y, light_z, light_tox, light_toy, light_toz, 0, 0, 1);
		glPushMatrix ();						// Save view matrix for later
		glGetFloatv ( GL_MODELVIEW_MATRIX, vmat );
		glPopMatrix ();

		glDisable ( GL_LIGHTING );
		glColor4f ( 1, 1, 1, 1 );
		glShadeModel (GL_FLAT);					// No shading (faster)
		
		glEnable ( GL_CULL_FACE );
		glCullFace ( GL_FRONT );	
		
		glEnable ( GL_POLYGON_OFFSET_FILL );
		glPolygonOffset ( 50.0, 0.1 );			// Depth bias
		
		drawScene ( &vmat[0], false );				// Draw scene. 

		glDisable ( GL_POLYGON_OFFSET_FILL );	
		glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0);
		glViewport ( 0, 0, (GLsizei) wx, (GLsizei) wy );

		//glCullFace (GL_BACK);					// Restore render states
		//glBindTexture ( GL_TEXTURE_2D, 0);
	}
开发者ID:tikwid,项目名称:jsfluid,代码行数:53,代码来源:gl_helper.cpp

示例9: glfwGetTime

void Game::startMainLoop() {
    double glfwTime = glfwGetTime();
    if(glfwTime - lastTimeStamp >= FRAG_GEN_PAUSE) {
        createNewOpponent();
        lastTimeStamp = glfwTime;
    }
    checkPressedKeys();
    drawScene();
    glfwSwapBuffers();
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    running = !glfwGetKey(GLFW_KEY_ESC) && glfwGetWindowParam(GLFW_OPENED);
}
开发者ID:segrived,项目名称:killbox-game,代码行数:12,代码来源:game.cpp

示例10: display

void display( void ){
  glutSetWindow(window);
  glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
  glColor3f( 1.0, 1.0, 1.0 );

  /* Set up where the projection */
  setUserView( );
  /* Draw the scene into the back buffer */
  drawScene( );
  /* Swap the front buffer with the back buffer - assumes double buffering */
  glutSwapBuffers( );
}
开发者ID:matkam,项目名称:school-projects,代码行数:12,代码来源:cube.c

示例11: display

/*
 *  display()
 *  ------
 *  Display the scene
 */
void display(void)
{
  /* setup functions */  
  glClear(GL_COLOR_BUFFER_BIT);

  /* Draw Scene */
  drawScene();

  /* Flush and sanity check */
  glFlush();
  errCheck("display sanity check");
}
开发者ID:davidwparker,项目名称:opengl-screencasts-2,代码行数:17,代码来源:display.c

示例12: superNova

void superNova(float size){
    glPushMatrix();
    glDisable(GL_FOG);
    float blastRadius = 2+size+.05;
    drawScene(blastRadius);
    glColor3f(.8,0,0);
    glRotatef(90,1,0,0);
    glutSolidTorus(2,2+size+.05,25,25);
    glRotatef(-90,1,0,0); 
    glPopMatrix();

}
开发者ID:pmathai,项目名称:solarsystem,代码行数:12,代码来源:render.cpp

示例13: fbScp

void SystemCinderApp::renderSceneToFbo()
{
	gl::ScopedFramebuffer fbScp(mFbo);
	gl::clear(Color(0, 0, 0));

	//set the viewport to match the dimensions of the FBO;
	gl::ScopedViewport scVprt(ivec2(0), mFbo->getSize());

	gl::setMatrices(mCamFbo);

	drawScene();
}
开发者ID:Danielacoco,项目名称:SystemCinder,代码行数:12,代码来源:SystemCinderApp.cpp

示例14: setupMatrices

bool DX11ViewportRenderer::renderToTarget( const MRenderingInfo &renderInfo )
//
// Description:
//		Rener to off-screen render target and read back into system memory 
//		output buffer.
//
//
{
	// Direct rendering to a D3D surface
	//
	if (renderInfo.renderingAPI() == MViewportRenderer::kDirect3D)
	{
		// Maya does not support D3D currently. Would need
		// to have access to the device, and surface here
		// from an MRenderTarget. API doesn't exist, so
		// do nothing.
		return false;
	}

	//
	// Offscreen rendering
	//
	if (!m_pD3DDevice || !m_pD3DDeviceCtx || !m_pTextureOutput || !m_pTextureInterm)
		return false;

	// START RENDER

	// Set colour and depth surfaces.
	//
	ID3D11RenderTargetView* targets[] = { m_pTextureIntermView };
	m_pD3DDeviceCtx->OMSetRenderTargets( 1, targets, m_pDepthStencilView );

	{
		// Setup projection and view matrices
		setupMatrices( renderInfo );

		// set rasterizer state
		m_pD3DDeviceCtx->RSSetState( m_pNormalRS );

		// Clear the entire buffer (RGB, Depth). Leave stencil for now.
		//
		float clearColor[4] = { 0.0f, 0.125f, 0.6f, 1.0f }; // RGBA
		m_pD3DDeviceCtx->ClearRenderTargetView( m_pTextureIntermView, clearColor );
		if ( m_pDepthStencilView )
			m_pD3DDeviceCtx->ClearDepthStencilView( m_pDepthStencilView, D3D11_CLEAR_DEPTH, 1.0f, 0 );

		// Render the scene
		drawScene(renderInfo);
	}
	// END SCENE RENDER

	return true;
}
开发者ID:BigRoy,项目名称:Maya-devkit,代码行数:53,代码来源:DX11ViewportRenderer.cpp

示例15: drawScene

void Facade::drawScene()
{
    try
    {
        DrawScene drawScene(this->action);
        drawScene.execute();
    }
    catch(BaseException& exc)
    {
        this->alertWindowService->showErrorMessage(exc.what());
    }
}
开发者ID:aminbenarieb,项目名称:oop_lab3,代码行数:12,代码来源:facade.cpp


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