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


C++ SetView函数代码示例

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


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

示例1: renderScene

void renderScene(GLFWwindow *window, ShadowMap *shadowMap) {
    glUseProgram(ShadeProg);

    glUniform3f(h_uLightColor, 0.4, 0.4, 0.38);
    glUniform4f(h_uLightVec, 0.0, 1.0, 1.0, 0.0);

    // Render depth info from light's perspective
    shadowMap->BindFBO();
    glClear(GL_DEPTH_BUFFER_BIT);
    curView = SetView(); // CHANGE TO LIGHT'S PERSPECTIVE, NOT EYE
    curProj = SetOrthoProjectionMatrix();
    glUniform3f(h_uCamPos, 0.0, 1.0, 1.0);
    glfwDraw(window);

    // Render scene normally and draw
    shadowMap->UnbindFBO();
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    curView = SetView();
    curProj = SetProjectionMatrix();
    glUniform3f(h_uCamPos, GetEye().x, GetEye().y, GetEye().z);
    glfwDraw(window);

    // Disable the shaders
    glUseProgram(0);
    glfwSwapBuffers(window);
}
开发者ID:ThunderHawks,项目名称:The-Hook,代码行数:26,代码来源:Lab4.cpp

示例2: sizeof

HRESULT displayDevice::SetPipeline( const PIPELINE_INPUT_TYPE inType, const PIPELINE_OUTPUT_TYPE outType)
{
	HRESULT hr = S_OK;

	// Set input buffer
	UINT stride = sizeof(VERTEX);
	UINT offset = 0;
	switch (inType)
	{
	case SCENE:
		SetView(PERSPECTIVE);
		// select which vertex buffer to display
		devContext->IASetVertexBuffers(0, 1, &(sceneMeshBuffer.vx), &stride, &offset);
		devContext->PSSetShader(pxShader, 0, 0);
		// which index buffer
		devContext->IASetIndexBuffer(sceneMeshBuffer.ix, DXGI_FORMAT_R32_UINT, 0);
		break;

	case SCREEN_QUAD:
		// no shader
		SetView(NO_TRANSFORM);
		devContext->PSSetShader(pxShader2, 0, 0);
		// select which vertex buffer to display
		devContext->IASetVertexBuffers(0, 1, &(screenQuadBuffer.vx), &stride, &offset);
		// which index buffer
		devContext->IASetIndexBuffer(screenQuadBuffer.ix, DXGI_FORMAT_R32_UINT, 0);
		break;

	default:
		return S_FALSE;
		break;
	}
	
	// which primtive type we are using
	devContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);

	// Set output target
	switch (outType)
	{
	case TO_BACKBUFFER:
		// where to draw colors and depth/stencil
		devContext->OMSetRenderTargetsAndUnorderedAccessViews
			(1, &backBuffer, depthStencilView, 1, 1, &screenTextureUnorderedAccessView, NULL);
		break;

	case TO_SCREEN_QUAD:
		devContext->OMSetRenderTargetsAndUnorderedAccessViews
			(1, &screenTextureTargetView, depthStencilView, 1, 1, &screenTextureUnorderedAccessView, NULL);
		break;
		
	default:
		return S_FALSE;
		break;
	}

	return S_OK;
}
开发者ID:antoinenry,项目名称:learning-d3d11,代码行数:57,代码来源:d3dbasic.cpp

示例3: First

void FramesView::UpdateFrame(FrameView* curr, FrameView* prev,
			     int* curr_others, int num_curr_others,
			     int* prev_others, int num_prev_others) {
  Iterator i;
  First(i);
  FrameView* background = (FrameView*)GetView(i);
  
  if (curr != prev) {
    if (prev) {		
      if (prev != background) prev->Hide();
      prev->Desensitize();
      if (prev_others) {
	for (int np=0; np<num_prev_others; np++) {
	  SetView(prev, i);
	  if (prev_others[np]>0) 
	    for (int ii=0; ii<prev_others[np]; ii++) Next(i);
	  else 
	    for (int ii=0; ii>prev_others[np]; ii--) Prev(i);
	  if (!Done(i)) {
	    FrameView* frame = (FrameView*)GetView(i);
	    if (frame != background) {
	      frame->Hide();
	      frame->Sensitize();
	    }
	  }
	}
      }
    }
    if (curr) {
      if (curr != background) curr->Show();
      curr->Sensitize();
      if (curr_others) {
	for (int np=0; np<num_curr_others; np++) {
	  SetView(curr, i);
	  if (curr_others[np]>0) 
	    for (int ii=0; ii<curr_others[np]; ii++) Next(i);
	  else 
	    for (int ii=0; ii>curr_others[np]; ii--) Prev(i);
	  if (!Done(i)) {
	    FrameView* frame = (FrameView*)GetView(i);
	    if (frame != background) {
	      frame->Show();
	      frame->Desensitize();
	    }
	  }
	}
      }
    }
  }
}
开发者ID:barak,项目名称:ivtools-cvs,代码行数:50,代码来源:frameviews.c

示例4: wxPaintDC

/* OGLCanvas::onPaint
 * Called when the gfx canvas has to be redrawn
 *******************************************************************/
void OGLCanvas::onPaint(wxPaintEvent& e) {
	wxPaintDC(this);

	if (IsShown()) {
		// Set context to this window
#ifdef USE_SFML_RENDERWINDOW
#if SFML_VERSION_MAJOR < 2
		sf::RenderWindow::SetActive();
		Drawing::setRenderTarget(this);
		SetView(sf::View(sf::FloatRect(0.0f, 0.0f, GetSize().x, GetSize().y)));
#else
		sf::RenderWindow::setActive();
		Drawing::setRenderTarget(this);
		setView(sf::View(sf::FloatRect(0.0f, 0.0f, GetSize().x, GetSize().y)));
#endif//SFML_VERSION_MAJOR
#else
		setContext();
#endif//USE_SFML_RENDERWINDOW

		// Init if needed
		if (!init_done)
			init();

		// Draw content
		draw();
	}
}
开发者ID:doomtech,项目名称:slade,代码行数:30,代码来源:OGLCanvas.cpp

示例5: m_vCameraPosition

Camera::Camera(
		glm::vec3& position, 
		glm::vec3& target, 
		glm::vec3& up, 
		GLfloat near, 
		GLfloat far, 
		GLfloat fieldOfView,
		unsigned int windowWidth, 
		unsigned int windowHeight,
		const char* cameraName)
	: m_vCameraPosition(position),
	m_vCameraTarget(target),
	m_vCameraUp(up),
	m_fNearClippingPlane(near),
	m_fFarClippingPlane(far),
	m_fFOV(fieldOfView)
{
	m_fHorizontalAngle = 0.0f;
	m_fVerticalAngle = 0.0f;

	CameraName = new char[strlen(cameraName) + 1];
	strcpy_s(CameraName, strlen(cameraName) + 1, cameraName);

	// Debug
	std::cout<<CameraName<<std::endl;

	SetView();
	SetProjection(m_fFOV, WINDOW_WIDTH, WINDOW_HEIGHT, m_fNearClippingPlane, m_fFarClippingPlane);

	// Set mouse position to the center of the screen
	glfwSetCursorPos(Core::Window, (double)WINDOW_WIDTH / 2, (double)WINDOW_HEIGHT / 2);
}
开发者ID:alexlup36,项目名称:N-body-Simulation,代码行数:32,代码来源:Camera.cpp

示例6: D3DXVECTOR4

//-- SetDefaults --------------------------------------------------------------
//
//-----------------------------------------------------------------------------
void Renderer::SetDefaults()
{
	for (;g_matrixStackLevel > 0; g_matrixStackLevel--)
	{
		g_matrixStack->Pop();
	}

	g_matrixStack->LoadIdentity();

	// Renderstates
	m_pD3DDevice->SetRenderState(D3DRS_LIGHTING, FALSE);
	//  d3dSetRenderState(D3DRS_CULLMODE, D3DCULL_CCW);
	m_pD3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
	m_pD3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE);
	m_pD3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESSEQUAL);
	m_pD3DDevice->SetRenderState(D3DRS_ZWRITEENABLE, TRUE);
	m_pD3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
	m_pD3DDevice->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE);
	m_pD3DDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATER);
	m_pD3DDevice->SetRenderState(D3DRS_ALPHAREF, 0);
	m_pD3DDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);

	m_pD3DDevice->SetRenderState(D3DRS_COLORWRITEENABLE, D3DCOLORWRITEENABLE_RED | D3DCOLORWRITEENABLE_GREEN | D3DCOLORWRITEENABLE_BLUE);

	m_pD3DDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
	m_pD3DDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );
	m_pD3DDevice->SetTextureStageState( 0, D3DTSS_COLOROP,   D3DTOP_MODULATE );
	m_pD3DDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP,   D3DTOP_MODULATE );
	m_pD3DDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
	m_pD3DDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE );

	for (int i = 0; i < 4; i++)
	{
		m_pD3DDevice->SetSamplerState( i, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);
		m_pD3DDevice->SetSamplerState( i, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP);
		m_pD3DDevice->SetSamplerState( i, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
		m_pD3DDevice->SetSamplerState( i, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
		m_pD3DDevice->SetTexture(i, NULL);
	}

	CurrentTextureStageMode = TSM_TEXTURE;
 	g_envMapSet = false;
 	g_textureSet = false;

	// Globals
	g_colour = 0xffffffff;
	g_fColour = D3DXVECTOR4(1.0f, 1.0f, 1.0f, 1.0f);
	g_aspect = g_defaultAspect;
	g_aspectValue = 1.0f;

	SetDrawMode3d();
	D3DXMATRIX matView;
	D3DXMatrixIdentity( &matView );
	SetView( matView );

	SetBlendMode( BLEND_OFF ); 

//	m_pD3DDevice->SetVertexDeclaration( g_pVertexDeclaration );

} // SetDefaults
开发者ID:SHPURDYdBurt,项目名称:https-github.com-xbmc-atv2,代码行数:63,代码来源:Renderer.cpp

示例7: pRenderContext

CPixelVisibilityQuery::CPixelVisibilityQuery()
{
	CMatRenderContextPtr pRenderContext( materials );
	SetView( 0xFFFF );
	m_queryHandle = pRenderContext->CreateOcclusionQueryObject();
	m_queryHandleCount = pRenderContext->CreateOcclusionQueryObject();
}
开发者ID:1n73rf4c3,项目名称:source-sdk-2013,代码行数:7,代码来源:c_pixel_visibility.cpp

示例8: SetView

//////////////////////////////////////////////
//  Definitions for the CContainOutput class
CContainOutput::CContainOutput() 
{
	SetView(m_ViewOutput); 
	SetDockCaption (_T("Output View - Docking container"));
	SetTabText(_T("Output"));
	SetTabIcon(IDI_TEXT);
} 
开发者ID:quinsmpang,项目名称:Tools,代码行数:9,代码来源:Output.cpp

示例9: GetApp

CMDIChildText::CMDIChildText()
{
	HINSTANCE hResource = GetApp()->GetResourceHandle();
	HMENU hChildMenu = LoadMenu(hResource, _T("MdiMenuText"));
	SetHandles(hChildMenu, NULL);
	SetView(m_TextView);
}
开发者ID:quinsmpang,项目名称:Tools,代码行数:7,代码来源:MDIChildText.cpp

示例10: Test

ScrollBarTest::ScrollBarTest()
	: Test("ScrollBar", NULL),
	  fScrollBar(new BScrollBar("scroll bar", NULL, 0, 100, B_HORIZONTAL)),
	  fOrientationRadioGroup(NULL)
{
	SetView(fScrollBar);
}
开发者ID:SummerSnail2014,项目名称:haiku,代码行数:7,代码来源:ScrollBarTest.cpp

示例11: SetView

void Pi::RequestTimeAccel(int s)
{
	if (currentView == gameMenuView) {
		SetView(worldView);
	}
	requestedTimeAccelIdx = s;
}
开发者ID:Snaar,项目名称:pioneer,代码行数:7,代码来源:Pi.cpp

示例12: GetViewIndex

void CDeviceUI::Remove(CDeviceView *pView)
{
	if (pView == NULL)
		return;

	int i = GetViewIndex(pView);
	if (i < 0 || i >= GetNumViews())
	{
		assert(0);
		return;
	}

	if (pView == m_pCurView)
		m_pCurView = NULL;

	if (m_arpView[i] != NULL)
	{
		m_arpView[i]->RemoveAll();
		delete m_arpView[i];
	}
	m_arpView[i] = NULL;

	m_arpView.RemoveAt(i);

	if (m_arpView.GetSize() < 1)
		RequireAtLeastOneView();
	else if (m_pCurView == NULL)
	{
		SetView(0);
		NumViewsChanged();
	}
}
开发者ID:grakidov,项目名称:Render3D,代码行数:32,代码来源:cdeviceui.cpp

示例13: SetButton

void TwoFieldDatePickerDialog::Init(
    /* [in] */ IContext* context,
    /* [in] */ Int32 theme,
    /* [in] */ OnValueSetListener* callBack,
    /* [in] */ Int32 year,
    /* [in] */ Int32 positionInYear,
    /* [in] */ Double minValue,
    /* [in] */ Double maxValue)
{
    AlertDialog::constructor(context, theme);

    mCallBack = callBack;

    AutoPtr<ICharSequence> setText;
    context->GetText(
             R::string::date_picker_dialog_set, (ICharSequence**)&setText);
    SetButton(BUTTON_POSITIVE, setText, this);
    AutoPtr<ICharSequence> cancelText;
    context->GetText(Elastos::Droid::R::string::cancel, (ICharSequence**)&cancelText);
    SetButton(BUTTON_NEGATIVE, cancelText,
             (IDialogInterfaceOnClickListener*) NULL);
    SetIcon(0);

    mPicker = CreatePicker(context, minValue, maxValue);
    SetView(IView::Probe(mPicker));
    mPicker->Init(year, positionInYear, this);
}
开发者ID:XilongPei,项目名称:Elastos5,代码行数:27,代码来源:TwoFieldDatePickerDialog.cpp

示例14: SetView

/// 월드좌표계의 *pv값의 위치로 카메라를 이동한다.
D3DXMATRIXA16* ZCamera::MoveTo( D3DXVECTOR3* pv )
{
    D3DXVECTOR3	dv = *pv - m_vEye;
    m_vEye = *pv;
    m_vLookat += dv;
    return SetView( &m_vEye, &m_vLookat, &m_vUp );
}
开发者ID:blastingzone,项目名称:ComputerGraphicsAdvenced,代码行数:8,代码来源:ZCamera.cpp

示例15: gamePadEvent

void QSFcanvas::OnUpdate()
{


    gamePadEvent();

    if(leftPressed)
        emit turnLeft();
    if(rightPressed)
        emit turnRight();


    Clear();

    SetView(view);
    carte.afficher(*this,"inf");


    DM.display(AM,*this);





}
开发者ID:AntipodGames,项目名称:Fly,代码行数:25,代码来源:qsfcanvas.cpp


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