本文整理汇总了C++中GuiCanvas::getPlatformWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ GuiCanvas::getPlatformWindow方法的具体用法?C++ GuiCanvas::getPlatformWindow怎么用?C++ GuiCanvas::getPlatformWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GuiCanvas
的用法示例。
在下文中一共展示了GuiCanvas::getPlatformWindow方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getRoot
void GuiDecalEditorCtrl::get3DCursor( GuiCursor *&cursor,
bool &visible,
const Gui3DMouseEvent &event_ )
{
cursor = NULL;
visible = false;
GuiCanvas *root = getRoot();
if ( !root )
return;
S32 currCursor = PlatformCursorController::curArrow;
if ( root->mCursorChanged == currCursor )
return;
PlatformWindow *window = root->getPlatformWindow();
PlatformCursorController *controller = window->getCursorController();
// We've already changed the cursor,
// so set it back before we change it again.
if( root->mCursorChanged != -1)
controller->popCursor();
// Now change the cursor shape
controller->pushCursor(currCursor);
root->mCursorChanged = currCursor;
}
示例2: Init
bool VolumetricFogRTManager::Init()
{
if (mIsInitialized)
{
Con::errorf("VolumetricFogRTManager allready initialized!!");
return true;
}
GuiCanvas* cv = dynamic_cast<GuiCanvas*>(Sim::findObject("Canvas"));
if (cv == NULL)
{
Con::errorf("VolumetricFogRTManager::Init() - Canvas not found!!");
return false;
}
mPlatformWindow = cv->getPlatformWindow();
mPlatformWindow->getScreenResChangeSignal().notify(this,&VolumetricFogRTManager::ResizeRT);
if (mTargetScale < 1 || GFX->getAdapterType() == Direct3D11)
mTargetScale = 1;
mWidth = mFloor(mPlatformWindow->getClientExtent().x / mTargetScale);
mHeight = mFloor(mPlatformWindow->getClientExtent().y / mTargetScale);
mDepthBuffer = GFXTexHandle(mWidth, mHeight, GFXFormatR32F,
&GFXRenderTargetProfile, avar("%s() - mDepthBuffer (line %d)", __FUNCTION__, __LINE__));
if (!mDepthBuffer.isValid())
{
Con::errorf("VolumetricFogRTManager Fatal Error: Unable to create Depthbuffer");
return false;
}
if (!mDepthTarget.registerWithName("volfogdepth"))
{
Con::errorf("VolumetricFogRTManager Fatal Error : Unable to register Depthbuffer");
return false;
}
mDepthTarget.setTexture(mDepthBuffer);
mFrontBuffer = GFXTexHandle(mWidth, mHeight, GFXFormatR32F,
&GFXRenderTargetProfile, avar("%s() - mFrontBuffer (line %d)", __FUNCTION__, __LINE__));
if (!mFrontBuffer.isValid())
{
Con::errorf("VolumetricFogRTManager Fatal Error: Unable to create front buffer");
return false;
}
if (!mFrontTarget.registerWithName("volfogfront"))
{
Con::errorf("VolumetricFogRTManager Fatal Error : Unable to register Frontbuffer");
return false;
}
mFrontTarget.setTexture(mFrontBuffer);
Con::setVariable("$VolumetricFog::density", "0.0");
mIsInitialized = true;
return true;
}
示例3: onSleep
void ForestEditorCtrl::onSleep()
{
// Pop our default cursor off.
GuiCanvas *root = getRoot();
if ( root )
{
PlatformWindow *window = root->getPlatformWindow();
PlatformCursorController *controller = window->getCursorController();
controller->popCursor();
}
Parent::onSleep();
}
示例4: onWake
bool ForestEditorCtrl::onWake()
{
if ( !Parent::onWake() )
return false;
// Push our default cursor on here once.
GuiCanvas *root = getRoot();
if ( root )
{
S32 currCursor = PlatformCursorController::curArrow;
PlatformWindow *window = root->getPlatformWindow();
PlatformCursorController *controller = window->getCursorController();
controller->pushCursor( currCursor );
}
return true;
}