• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ drawScene函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: displayCallback

void displayCallback()
{
    // update scene
    updateScene();

    // draw frame
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    
    drawScene();
    
    glutSwapBuffers();
}
开发者ID:LukasBanana,项目名称:GeometronLib,代码行数:12,代码来源:Test3_MeshGen.cpp


示例17: updateGLSettings

///// paintGL /////////////////////////////////////////////////////////////////
void GLView::paintGL()
/// Overridden from QGlWidget::paintGL(). Does the drawing of the OpenGL scene.
{
  if(staticUpdateIndex != updateIndex)
    updateGLSettings();

  ///// build a quaternion from the user's changes
  Quaternion<float> changeQuaternion(xRot, yRot, zRot);
  ///// multiply it with the current quaternion
  Quaternion<float> tempQuaternion = *orientationQuaternion;
  *orientationQuaternion = tempQuaternion*changeQuaternion;  // no *= operator implemented yet => calling default constructor?
  ///// generate an axis-angle representation for OpenGL
  Vector3D<float> axis;
  float angle;
  orientationQuaternion->getAxisAngle(axis, angle);

  if(!animation)
  {
    ///// reset the changes
    xRot = 0.0f;
    yRot = 0.0f;
    zRot = 0.0f;
  }

  //if(baseParameters.antialias)
  //{
  //  glClear(GL_COLOR_BUFFER_BIT);
  //}
  //else
  //{
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  //}

  glLoadIdentity();
  //qDebug("GlView::xPos = %f, yPos = %f, zPos = %f", xPos, yPos, zPos);
  //qDebug("GlView::orientationQuaternion = (%f, %f, %f, %f)",orientationQuaternion->x(),orientationQuaternion->y(),orientationQuaternion->z(),orientationQuaternion->w());
  ///// camera setup
  if(baseParameters.perspectiveProjection)
    gluLookAt(0.0f, 0.0f, zPos, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
  else
    resizeGL(width(), height());
  glPushMatrix();
  glTranslatef(xPos, yPos, 0.0f);
  glRotatef(angle, axis.x(), axis.y(), axis.z());

  drawScene(); // pure virtual

  glPopMatrix();
  glFlush(); // drawing is complete => send for execution
  if(animation)
    timer->start(redrawWait);
}
开发者ID:steabert,项目名称:brabosphere,代码行数:53,代码来源:glview.cpp


示例18: draw

   void draw() const
   {
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

      glMatrixMode(GL_PROJECTION);
      glLoadIdentity();
      gluPerspective(80.0f, (float)getWidth()/(float)getHeight(), 0.01f, 500.0f);

      glMatrixMode(GL_MODELVIEW);
      glLoadIdentity();

      // Redraw the current blur texture
      glPushAttrib(GL_VIEWPORT_BIT);
         glViewport(0, 0, mBlurTexture->getTexWidth(), mBlurTexture->getTexHeight());
         drawMotionBlur();
         drawScene();

         // Copy the contents of the frame buffer into our blur texture
         mBlurTexture->bind();
         glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0,
                          mBlurTexture->getTexWidth(), mBlurTexture->getTexHeight(),
                          0);
         mBlurTexture->unbind();

         // Clear the frame buffer again
         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
      glPopAttrib();
      glViewport(0, 0, getWidth(), getHeight());

      // Blend in the motion blur with the background color
      drawMotionBlur();

      drawScene();

      if (glGetError() != GL_NO_ERROR)
      {
         std::cerr << "I fucked up my GL State." << std::endl;
      }
   }
开发者ID:chadaustin,项目名称:isugamedev,代码行数:39,代码来源:main.cpp


示例19: updateFrameBuffers

// Draw the scene
void Viewer::draw()
{
	// - update les FrameBuffers
	updateFrameBuffers();

	drawScene();	
	
	// Dessine la camera attaché à la lumière
	if (qgl_cam_light.frame()->isManipulated())
		drawLightCamera( 0.75f );
	else if ( PARAM(bool, light_camera.draw) ) 
		drawLightCamera();
	else
开发者ID:yoyonel,项目名称:bablib_projects,代码行数:14,代码来源:viewer_shadow.cpp


示例20: glClear

void Scene::paintGL(void) {
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);              /* чистим буфер изображения и буфер глубины */
    glMatrixMode(GL_PROJECTION);                                     /* устанавливаем матрицу */
    glLoadIdentity();                                                /* загружаем матрицу */
    gluOrtho2D(0, nWidth, 0, nHeight);                               /* подготавливаем плоскости для матрицы */

    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

    drowField();

    drawScene();
}
开发者ID:aleandr100,项目名称:Snake,代码行数:13,代码来源:scene.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ drawSphere函数代码示例发布时间:2022-05-30
下一篇:
C++ drawRectangle函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap