예제 #1
0
// the main render routine.
// 1. set the animation transform
// 2. if visible, paint
// 3. reset the animation transform
void CGUIControl::DoRender()
{
  if (IsVisible())
  {
    bool hasStereo = m_stereo != 0.0
                  && g_graphicsContext.GetStereoMode() != RENDER_STEREO_MODE_MONO
                  && g_graphicsContext.GetStereoMode() != RENDER_STEREO_MODE_OFF;

    g_graphicsContext.SetTransform(m_cachedTransform);
    if (m_hasCamera)
      g_graphicsContext.SetCameraPosition(m_camera);
    if (hasStereo)
      g_graphicsContext.SetStereoFactor(m_stereo);

    GUIPROFILER_RENDER_BEGIN(this);
    Render();
    GUIPROFILER_RENDER_END(this);

    if (hasStereo)
      g_graphicsContext.RestoreStereoFactor();
    if (m_hasCamera)
      g_graphicsContext.RestoreCameraPosition();
    g_graphicsContext.RemoveTransform();
  }
}
예제 #2
0
// the main render routine.
// 1. set the animation transform
// 2. if visible, paint
// 3. reset the animation transform
void CGUIControl::DoRender()
{
  if (IsVisible())
  {
    bool hasStereo = m_stereo != 0.0
                  && g_graphicsContext.GetStereoMode() != RENDER_STEREO_MODE_MONO
                  && g_graphicsContext.GetStereoMode() != RENDER_STEREO_MODE_OFF;

    g_graphicsContext.SetTransform(m_cachedTransform);
    if (m_hasCamera)
      g_graphicsContext.SetCameraPosition(m_camera);
    if (hasStereo)
      g_graphicsContext.SetStereoFactor(m_stereo);

    GUIPROFILER_RENDER_BEGIN(this);

    if (m_hitColor != 0xffffffff)
    {
      color_t color = g_graphicsContext.MergeAlpha(m_hitColor);
      CGUITexture::DrawQuad(g_graphicsContext.generateAABB(m_hitRect), color);
    }

    Render();

    GUIPROFILER_RENDER_END(this);

    if (hasStereo)
      g_graphicsContext.RestoreStereoFactor();
    if (m_hasCamera)
      g_graphicsContext.RestoreCameraPosition();
    g_graphicsContext.RemoveTransform();
  }
}