本文整理汇总了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());
}
示例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();
}
示例3: update
/// <summary>
/// シーンの更新と描画を行います。
/// </summary>
/// <returns>
/// シーンの更新に成功した場合 true, それ以外の場合は false
/// </returns>
bool update()
{
if (!updateScene())
{
return false;
}
drawScene();
return true;
}
示例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();
}
示例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);
}
示例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();
}
}
示例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();
}
示例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);
}
示例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);
}
示例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( );
}
示例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");
}
示例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();
}
示例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();
}
示例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;
}
示例15: drawScene
void Facade::drawScene()
{
try
{
DrawScene drawScene(this->action);
drawScene.execute();
}
catch(BaseException& exc)
{
this->alertWindowService->showErrorMessage(exc.what());
}
}