* - Window compositor
*/
#include <video.hpp>
-#include <compositor.hpp>
#include <CCompositor.hpp>
+#include <cassert>
namespace AxWin {
//
}
-CWindow* CCompositor::CreateWindow(CClient& client)
+CWindow* CCompositor::CreateWindow(CClient& client, const ::std::string& name)
{
- return new CWindow(client, "TODO");
+ return new CWindow(*this, client, name);
+}
+
+bool CCompositor::GetScreenDims(unsigned int ScreenID, unsigned int* W, unsigned int* H)
+{
+ assert(W && H);
+ if( ScreenID != 0 )
+ {
+ *W = 0;
+ *H = 0;
+ return false;
+ }
+ else
+ {
+ m_video.GetDims(*W, *H);
+ return true;
+ }
}
void CCompositor::Redraw()
// For all windows, check for intersection with damage rects
for( auto rect : m_damageRects )
{
+ // window list should be sorted by draw order (lowest first)
for( auto window : m_windows )
{
if( rect.HasIntersection( window->m_surface.m_rect ) )
//window->Repaint( rel_rect );
}
}
+
+ // TODO: Blit from windows to a local surface, then blit from there to screen here
}
m_damageRects.clear();
+ m_video.Flush();
}
void CCompositor::DamageArea(const CRect& area)
{
+ m_damageRects.push_back( area );
// 1. Locate intersection with any existing damaged areas
// 2. Append after removing intersections
}