~brandontschaefer/nux/xim-tests

« back to all changes in this revision

Viewing changes to Nux/WindowCompositor.cpp

  • Committer: Brandon Schaefer
  • Date: 2012-12-02 23:52:34 UTC
  • mfrom: (637.2.89 trunk)
  • Revision ID: brandon.schaefer@canonical.com-20121202235234-zqkbxyj5n7vgwvu5
* Merged trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
    on_menu_closure_continue_with_event_ = false;
62
62
    _mouse_position_on_owner = Point(0, 0);
63
63
 
 
64
    platform_support_for_depth_texture_ = GetGraphicsDisplay()->GetGpuDevice()->GetGpuInfo().Support_Depth_Buffer();
 
65
 
64
66
    m_FrameBufferObject = GetGraphicsDisplay()->GetGpuDevice()->CreateFrameBufferObject();
65
67
    // Do not leave the Fbo binded. Deactivate it.
66
68
    m_FrameBufferObject->Deactivate();
68
70
    // At this stage, the size of the window may not be known yet.
69
71
    // FormatRenderTargets will be called the first time runtime gets into WindowThread::ExecutionLoop
70
72
    m_MainColorRT = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture(2, 2, 1, BITFMT_R8G8B8A8, NUX_TRACKER_LOCATION);
71
 
    m_MainDepthRT = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture(2, 2, 1, BITFMT_D24S8, NUX_TRACKER_LOCATION);
 
73
 
 
74
    if (platform_support_for_depth_texture_)
 
75
    {
 
76
      m_MainDepthRT = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture(2, 2, 1, BITFMT_D24S8, NUX_TRACKER_LOCATION);
 
77
    }
72
78
 
73
79
#if !defined(NUX_MINIMAL)
74
80
    _mouse_over_menu_page       = NULL;
1625
1631
    buffer_width = window_thread_->GetGraphicsEngine().GetWindowWidth();
1626
1632
    buffer_height = window_thread_->GetGraphicsEngine().GetWindowHeight();
1627
1633
 
1628
 
    if ((!m_MainColorRT.IsValid()) || (!m_MainDepthRT.IsValid()) || (m_MainColorRT->GetWidth() != buffer_width) || (m_MainColorRT->GetHeight() != buffer_height))
 
1634
    if ((!m_MainColorRT.IsValid()) || (m_MainColorRT->GetWidth() != buffer_width) || (m_MainColorRT->GetHeight() != buffer_height))
1629
1635
    {
1630
1636
      m_MainColorRT = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture(buffer_width, buffer_height, 1, BITFMT_R8G8B8A8, NUX_TRACKER_LOCATION);
1631
 
      m_MainDepthRT = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture(buffer_width, buffer_height, 1, BITFMT_D24S8, NUX_TRACKER_LOCATION);
 
1637
    }
 
1638
 
 
1639
    if (platform_support_for_depth_texture_)
 
1640
    {
 
1641
      if ((!m_MainDepthRT.IsValid()) || (m_MainDepthRT->GetWidth() != buffer_width) || (m_MainDepthRT->GetHeight() != buffer_height))
 
1642
      {
 
1643
        m_MainDepthRT = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture(buffer_width, buffer_height, 1, BITFMT_D24S8, NUX_TRACKER_LOCATION);
 
1644
      }
1632
1645
    }
1633
1646
 
1634
1647
    m_FrameBufferObject->FormatFrameBufferObject(buffer_width, buffer_height, BITFMT_R8G8B8A8);
2050
2063
    nuxAssert(buffer_height >= 1);
2051
2064
 
2052
2065
    m_MainColorRT = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture(buffer_width, buffer_height, 1, BITFMT_R8G8B8A8, NUX_TRACKER_LOCATION);
2053
 
    m_MainDepthRT = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture(buffer_width, buffer_height, 1, BITFMT_D24S8, NUX_TRACKER_LOCATION);
 
2066
    if (platform_support_for_depth_texture_)
 
2067
    {
 
2068
      m_MainDepthRT = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture(buffer_width, buffer_height, 1, BITFMT_D24S8, NUX_TRACKER_LOCATION);
 
2069
    }
2054
2070
 
2055
2071
    // Clear the buffer the first time...
2056
2072
    m_FrameBufferObject->FormatFrameBufferObject(buffer_width, buffer_height, BITFMT_R8G8B8A8);
2093
2109
      if ((rt.color_rt->GetWidth() != buffer_width) || (rt.color_rt->GetHeight() != buffer_height))
2094
2110
      {
2095
2111
        rt.color_rt = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture(buffer_width, buffer_height, 1, BITFMT_R8G8B8A8, NUX_TRACKER_LOCATION);
2096
 
        rt.depth_rt = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture(buffer_width, buffer_height, 1, BITFMT_D24S8, NUX_TRACKER_LOCATION);
 
2112
      }
 
2113
 
 
2114
      if (platform_support_for_depth_texture_)
 
2115
      {
 
2116
        if ((rt.depth_rt->GetWidth() != buffer_width) || (rt.depth_rt->GetHeight() != buffer_height))
 
2117
        {
 
2118
          rt.depth_rt = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture(buffer_width, buffer_height, 1, BITFMT_D24S8, NUX_TRACKER_LOCATION);
 
2119
        }
2097
2120
      }
2098
2121
 
2099
2122
      m_FrameBufferObject->FormatFrameBufferObject(buffer_width, buffer_height, BITFMT_R8G8B8A8);