Prep for image support in windows.
This commit is contained in:
parent
53c98a227d
commit
e7683cd94e
13 changed files with 172 additions and 135 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue