Cleaning for opengl rendering prep.

This commit is contained in:
James Grogan 2022-11-14 11:19:51 +00:00
parent 402f381d10
commit 7c6a92f4ec
58 changed files with 570 additions and 533 deletions

View file

@ -1,7 +1,6 @@
#pragma once
#include "Widget.h"
#include "Image.h"
#include "DrawingSurface.h"
#include <memory>
#include <vector>
@ -10,7 +9,11 @@
class PaintEvent;
class MouseEvent;
class KeyboardEvent;
class VisualLayer;
class DrawingContext;
enum class DrawingMode;
class Widget;
using WidgetPtr = std::unique_ptr<Widget>;
class IPlatformWindow;
using IPlatformWindowPtr = std::unique_ptr<IPlatformWindow>;
@ -19,7 +22,7 @@ namespace mt
class Screen;
class Window
class Window : public DrawingSurface
{
public:
@ -30,29 +33,17 @@ public:
static std::unique_ptr<Window> Create();
void AddWidget(WidgetUPtr widget);
void setWidget(WidgetPtr widget);
Widget* GetWidget() const;
void onPaint(const PaintEvent* event);
std::vector<VisualLayer*> GetLayers();
void onMouseEvent(const MouseEvent* event);
unsigned GetWidth() const;
void onKeyboardEvent(const KeyboardEvent* event);
unsigned GetHeight() const;
IPlatformWindow* getPlatformWindow() const;
void SetSize(unsigned width, unsigned height);
void OnPaint(const PaintEvent* event);
void OnMouseEvent(const MouseEvent* event);
void OnKeyboardEvent(const KeyboardEvent* event);
IPlatformWindow* GetPlatformWindow() const;
void SetPlatformWindow(IPlatformWindowPtr window);
Image<uint8_t>* getBackingImage() const;
void setPlatformWindow(IPlatformWindowPtr window, DrawingMode drawingMode);
void map();
@ -65,12 +56,9 @@ public:
void clearPlatformWindow();
private:
int mHandle {-1};
WidgetUPtr mWidget {nullptr};
unsigned mWidth {800};
unsigned mHeight {600};
WidgetPtr mWidget {nullptr};
IPlatformWindowPtr mPlatformWindow {nullptr};
std::unique_ptr<Image<uint8_t> > mBackingImage;
std::unique_ptr<DrawingContext> mDrawingContext;
};
}