74
if (GetWindowThread ()->GetWindow ().HasFrameBufferSupport ())
74
if (GetWindowThread()->GetWindow().HasFrameBufferSupport())
76
m_FrameBufferObject = GetGpuDevice ()->CreateFrameBufferObject ();
76
m_FrameBufferObject = GetGraphicsDisplay()->GetGpuDevice()->CreateFrameBufferObject ();
77
77
// Do not leave the Fbo binded. Deactivate it.
78
78
m_FrameBufferObject->Deactivate ();
81
81
// At this stage, the size of the window may not be known yet.
82
82
// FormatRenderTargets will be called the first time runtime gets into WindowThread::ExecutionLoop
83
m_MainColorRT = GetGpuDevice()->CreateSystemCapableDeviceTexture (2, 2, 1, BITFMT_R8G8B8A8);
84
m_MainDepthRT = GetGpuDevice()->CreateSystemCapableDeviceTexture (2, 2, 1, BITFMT_D24S8);
83
m_MainColorRT = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture (2, 2, 1, BITFMT_R8G8B8A8);
84
m_MainDepthRT = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture (2, 2, 1, BITFMT_D24S8);
86
86
m_MenuList = new std::list<MenuPage*>;
87
87
m_PopupRemoved = false;
168
168
// Don't size the texture to the dimension of the window yet. this will be done later.
169
169
if (GetWindowThread ()->GetWindow().HasFrameBufferSupport() )
171
rt.color_rt = GetGpuDevice()->CreateSystemCapableDeviceTexture (2, 2, 1, BITFMT_R8G8B8A8);
172
rt.depth_rt = GetGpuDevice()->CreateSystemCapableDeviceTexture (2, 2, 1, BITFMT_D24S8);
171
rt.color_rt = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture (2, 2, 1, BITFMT_R8G8B8A8);
172
rt.depth_rt = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture (2, 2, 1, BITFMT_D24S8);
175
175
_window_to_texture_map.insert ( std::map< BaseWindow*, RenderTargetTextures >::value_type ( window, rt) );
865
865
if (!GetWindowThread ()->IsEmbeddedWindow() )
866
866
RenderMainWindowComposition (true, true);
868
if (1 /*GetGpuDevice()->GetGraphicsBoardVendor() != BOARD_INTEL*/)
868
if (1 /*GetGraphicsDisplay()->GetGpuDevice()->GetGraphicsBoardVendor() != BOARD_INTEL*/)
870
870
RenderTopViews (true, _view_window_list, false, true);
871
871
RenderTopViews (true, _modal_view_window_list, true, true);
882
882
if (!GetWindowThread ()->IsEmbeddedWindow() )
883
883
RenderMainWindowComposition (false, true);
885
if (1 /*GetGpuDevice()->GetGraphicsBoardVendor() != BOARD_INTEL*/)
885
if (1 /*GetGraphicsDisplay()->GetGpuDevice()->GetGraphicsBoardVendor() != BOARD_INTEL*/)
887
887
RenderTopViews (false, _view_window_list, false, true);
888
888
RenderTopViews (false, _modal_view_window_list, true, true);
897
897
if (!GetWindowThread ()->IsEmbeddedWindow() )
898
898
RenderMainWindowComposition (false, true);
900
if (1 /*GetGpuDevice()->GetGraphicsBoardVendor() != BOARD_INTEL*/)
900
if (1 /*GetGraphicsDisplay()->GetGpuDevice()->GetGraphicsBoardVendor() != BOARD_INTEL*/)
902
902
RenderTopViews (false, _view_window_list, false, true);
903
903
RenderTopViews (false, _modal_view_window_list, true, true);
982
982
SetProcessingTopView (NULL);
985
// GetThreadGraphicsContext()->SetContext (0, 0,
985
// GetGraphicsDisplay()->GetGraphicsEngine()->SetContext (0, 0,
986
986
// GetWindowThread ()->GetGraphicsEngine().GetWindowWidth(),
987
987
// GetWindowThread ()->GetGraphicsEngine().GetWindowHeight() );
1009
1009
SetProcessingTopView (NULL);
1012
//GetThreadGraphicsContext()->SetContext (0, 0, buffer_width, buffer_height);
1012
//GetGraphicsDisplay()->GetGraphicsEngine()->SetContext (0, 0, buffer_width, buffer_height);
1015
1015
void WindowCompositor::DrawTooltip (bool force_draw)
1035
1035
//SetProcessingTopView(NULL);
1038
//GetThreadGraphicsContext()->SetContext (0, 0, buffer_width, buffer_height);
1038
//GetGraphicsDisplay()->GetGraphicsEngine()->SetContext (0, 0, buffer_width, buffer_height);
1041
1041
void WindowCompositor::RenderTopViewContent (BaseWindow *window, bool force_draw)
1084
1084
if ( (rt.color_rt->GetWidth() != buffer_width) || (rt.color_rt->GetHeight() != buffer_height) )
1086
rt.color_rt = GetGpuDevice()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_R8G8B8A8);
1087
rt.depth_rt = GetGpuDevice()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_D24S8);
1086
rt.color_rt = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_R8G8B8A8);
1087
rt.depth_rt = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_D24S8);
1090
1090
m_FrameBufferObject->FormatFrameBufferObject (buffer_width, buffer_height, BITFMT_R8G8B8A8);
1263
1263
if ( (!m_MainColorRT.IsValid() ) || (!m_MainDepthRT.IsValid() ) || (m_MainColorRT->GetWidth() != buffer_width) || (m_MainColorRT->GetHeight() != buffer_height) )
1265
m_MainColorRT = GetGpuDevice()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_R8G8B8A8);
1266
m_MainDepthRT = GetGpuDevice()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_D24S8);
1265
m_MainColorRT = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_R8G8B8A8);
1266
m_MainDepthRT = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_D24S8);
1269
1269
m_FrameBufferObject->FormatFrameBufferObject (buffer_width, buffer_height, BITFMT_R8G8B8A8);
1341
1341
if ( (!m_MainColorRT.IsValid() ) || (m_MainColorRT->GetWidth() != buffer_width) || (m_MainColorRT->GetHeight() != buffer_height) )
1343
m_MainColorRT = GetGpuDevice()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_R8G8B8A8);
1343
m_MainColorRT = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_R8G8B8A8);
1346
1346
// Setup the Composition Render Target
1369
1369
texxform.vscale = 1.0f;
1370
1370
texxform.uwrap = TEXWRAP_REPEAT;
1371
1371
texxform.vwrap = TEXWRAP_REPEAT;
1372
GetWindowThread ()->GetGraphicsEngine().QRP_1Tex (x, y, TexWidth, TexHeight, HWTexture, texxform, Colors::White);
1372
GetWindowThread ()->GetGraphicsEngine().QRP_1Tex (x, y, TexWidth, TexHeight, HWTexture, texxform, color::White);
1375
1375
void WindowCompositor::SetCompositionRT()
1381
1381
if ( (!m_CompositionRT.IsValid() ) || (m_CompositionRT->GetWidth() != buffer_width) || (m_CompositionRT->GetHeight() != buffer_height) )
1383
m_CompositionRT = GetGpuDevice()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_R8G8B8A8);
1383
m_CompositionRT = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_R8G8B8A8);
1386
1386
// Setup the Composition Render Target
1409
1409
texxform.vscale = 1.0f;
1410
1410
texxform.uwrap = TEXWRAP_REPEAT;
1411
1411
texxform.vwrap = TEXWRAP_REPEAT;
1412
GetWindowThread ()->GetGraphicsEngine().QRP_1Tex (x, y, TexWidth, TexHeight, HWTexture, texxform, Colors::White);
1412
GetWindowThread ()->GetGraphicsEngine().QRP_1Tex (x, y, TexWidth, TexHeight, HWTexture, texxform, color::White);
1415
1415
void WindowCompositor::PresentBufferToScreen (ObjectPtr<IOpenGLBaseTexture> HWTexture, int x, int y, bool RenderToMainTexture, bool BluredBackground, float opacity)
1458
1458
GetWindowThread ()->GetGraphicsEngine().GetRenderStates().SetBlend (true, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1461
GetThreadGraphicsContext()->QRP_1Tex (x, y, src_width, src_height, HWTexture, texxform0, Color (1.0f, 1.0f, 1.0f, opacity));
1461
GetGraphicsDisplay()->GetGraphicsEngine()->QRP_1Tex (x, y, src_width, src_height, HWTexture, texxform0, Color (1.0f, 1.0f, 1.0f, opacity));
1462
1462
GetWindowThread ()->GetGraphicsEngine().GetRenderStates().SetBlend (false);
1624
1624
Geometry geo = m_TooltipArea->GetGeometry();
1625
1625
geo.OffsetPosition(_tooltip_window->GetBaseX(), _tooltip_window->GetBaseY());
1627
return geo.IsPointInside(x, y);
1627
return geo.IsPointInside(x, y);
1630
1630
bool WindowCompositor::IsTooltipActive()
1770
1770
nuxAssert (buffer_width >= 1);
1771
1771
nuxAssert (buffer_height >= 1);
1773
m_MainColorRT = GetGpuDevice()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_R8G8B8A8);
1774
m_CompositionRT = GetGpuDevice()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_R8G8B8A8);
1775
m_MainDepthRT = GetGpuDevice()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_D24S8);
1773
m_MainColorRT = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_R8G8B8A8);
1774
m_CompositionRT = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_R8G8B8A8);
1775
m_MainDepthRT = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_D24S8);
1777
1777
// Clear the buffer the first time...
1778
1778
m_FrameBufferObject->FormatFrameBufferObject (buffer_width, buffer_height, BITFMT_R8G8B8A8);
1790
1790
CHECKGL ( glClearStencil (0) );
1791
1791
CHECKGL ( glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT) );
1793
// m_BlurTexture = GetGpuDevice()->CreateSystemCapableDeviceTexture (Max (buffer_width, 1), Max (buffer_height, 1), 1, BITFMT_R8G8B8A8);
1794
// m_FullSceneMip0 = GetGpuDevice()->CreateSystemCapableDeviceTexture (Max (buffer_width / 2, 1), Max (buffer_height / 2, 1), 1, BITFMT_R8G8B8A8);
1795
// m_FullSceneMip1 = GetGpuDevice()->CreateSystemCapableDeviceTexture (Max (buffer_width / 4, 1), Max (buffer_height / 4, 1), 1, BITFMT_R8G8B8A8);
1796
// m_FullSceneMip2 = GetGpuDevice()->CreateSystemCapableDeviceTexture (Max (buffer_width / 8, 1), Max (buffer_height / 8, 1), 1, BITFMT_R8G8B8A8);
1793
// m_BlurTexture = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture (Max (buffer_width, 1), Max (buffer_height, 1), 1, BITFMT_R8G8B8A8);
1794
// m_FullSceneMip0 = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture (Max (buffer_width / 2, 1), Max (buffer_height / 2, 1), 1, BITFMT_R8G8B8A8);
1795
// m_FullSceneMip1 = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture (Max (buffer_width / 4, 1), Max (buffer_height / 4, 1), 1, BITFMT_R8G8B8A8);
1796
// m_FullSceneMip2 = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture (Max (buffer_width / 8, 1), Max (buffer_height / 8, 1), 1, BITFMT_R8G8B8A8);
1799
1799
void WindowCompositor::RestoreRenderingSurface ()
1815
1815
if ((rt.color_rt->GetWidth () != buffer_width) || (rt.color_rt->GetHeight () != buffer_height))
1817
rt.color_rt = GetGpuDevice ()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_R8G8B8A8);
1818
rt.depth_rt = GetGpuDevice ()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_D24S8);
1817
rt.color_rt = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_R8G8B8A8);
1818
rt.depth_rt = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture (buffer_width, buffer_height, 1, BITFMT_D24S8);
1821
1821
m_FrameBufferObject->FormatFrameBufferObject (buffer_width, buffer_height, BITFMT_R8G8B8A8);