本文整理汇总了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);
}
示例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;
}
示例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();
}
}
}
}
}
}
}
示例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();
}
}
示例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);
}
示例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
示例7: pRenderContext
CPixelVisibilityQuery::CPixelVisibilityQuery()
{
CMatRenderContextPtr pRenderContext( materials );
SetView( 0xFFFF );
m_queryHandle = pRenderContext->CreateOcclusionQueryObject();
m_queryHandleCount = pRenderContext->CreateOcclusionQueryObject();
}
示例8: SetView
//////////////////////////////////////////////
// Definitions for the CContainOutput class
CContainOutput::CContainOutput()
{
SetView(m_ViewOutput);
SetDockCaption (_T("Output View - Docking container"));
SetTabText(_T("Output"));
SetTabIcon(IDI_TEXT);
}
示例9: GetApp
CMDIChildText::CMDIChildText()
{
HINSTANCE hResource = GetApp()->GetResourceHandle();
HMENU hChildMenu = LoadMenu(hResource, _T("MdiMenuText"));
SetHandles(hChildMenu, NULL);
SetView(m_TextView);
}
示例10: Test
ScrollBarTest::ScrollBarTest()
: Test("ScrollBar", NULL),
fScrollBar(new BScrollBar("scroll bar", NULL, 0, 100, B_HORIZONTAL)),
fOrientationRadioGroup(NULL)
{
SetView(fScrollBar);
}
示例11: SetView
void Pi::RequestTimeAccel(int s)
{
if (currentView == gameMenuView) {
SetView(worldView);
}
requestedTimeAccelIdx = s;
}
示例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();
}
}
示例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);
}
示例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 );
}
示例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);
}