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


C++ GuiCanvas::getPlatformWindow方法代码示例

本文整理汇总了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;   
}
开发者ID:BadBehavior,项目名称:BadBehavior_T3D,代码行数:28,代码来源:guiDecalEditorCtrl.cpp

示例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;
}
开发者ID:nev7n,项目名称:Torque3D,代码行数:59,代码来源:VolumetricFogRTManager.cpp

示例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();
}
开发者ID:campadrenalin,项目名称:terminal-overload,代码行数:13,代码来源:forestEditorCtrl.cpp

示例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;
}
开发者ID:campadrenalin,项目名称:terminal-overload,代码行数:18,代码来源:forestEditorCtrl.cpp


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