Prep for image support in windows.

This commit is contained in:
James Grogan 2022-11-11 15:51:37 +00:00
parent 53c98a227d
commit e7683cd94e
13 changed files with 172 additions and 135 deletions

View file

@ -5,6 +5,8 @@
#include "MouseEvent.h"
#include "VisualLayer.h"
#include "KeyboardEvent.h"
#include "Image.h"
#include "Screen.h"
namespace mt
{
@ -12,6 +14,7 @@ namespace mt
Window::Window()
:mWidth(800),
mHeight(600),
mBackingImage(std::make_unique<Image>(mWidth, mHeight)),
mWidget(Widget::Create())
{
mWidget->setBounds(mWidth, mHeight);
@ -93,4 +96,41 @@ void Window::SetPlatformWindow(IPlatformWindowPtr window)
mPlatformWindow = std::move(window);
}
Image* Window::getBackingImage() const
{
return mBackingImage.get();
}
void Window::map()
{
if (mPlatformWindow)
{
mPlatformWindow->map();
}
}
void Window::show()
{
if (mPlatformWindow)
{
mPlatformWindow->show();
}
}
void Window::doPaint(mt::Screen* screen)
{
if (mPlatformWindow)
{
mPlatformWindow->paint(screen);
}
}
void Window::clear()
{
if (mPlatformWindow)
{
mPlatformWindow->clear();
}
}
}