1
0
Fork 0

Platform/PlatformApplication: Adding createWindow()

This commit is contained in:
Henrik Hautakoski 2023-08-23 15:06:54 +02:00
parent 2ac3b5b8cc
commit a8f65e54ac
5 changed files with 17 additions and 6 deletions

View file

@ -7,6 +7,9 @@
namespace sp {
class Window;
class PlatformWindow;
class PlatformInput;
class PlatformDisplay;
@ -19,7 +22,7 @@ public :
virtual void shutdown() = 0;
//virtual PlatformDisplay& getDisplay() = 0;
virtual PlatformWindow* createWindow(Window* window) = 0;
virtual PlatformInput& getInput() = 0;

View file

@ -1,4 +1,5 @@
#include "X11Window.h"
#include "UnixApplication.h"
#include "Xlib.h"
@ -14,6 +15,11 @@ void UnixApplication::shutdown()
Xlib::shutdown();
}
PlatformWindow* UnixApplication::createWindow(Window* window)
{
return new X11Window(window);
}
PlatformInput& UnixApplication::getInput()
{
return m_input;

View file

@ -15,6 +15,8 @@ public :
virtual void shutdown();
virtual PlatformWindow* createWindow(Window* window);
virtual PlatformInput& getInput();
protected :

View file

@ -1,4 +1,5 @@
#include "Win32Window.h"
#include "Win32Application.h"
namespace sp {
@ -11,11 +12,10 @@ void Win32Application::shutdown()
{
}
/*
PlatformDisplay& Win32Application::getDisplay()
PlatformWindow* Win32Application::createWindow(Window* window)
{
return m_display;
} */
return new Win32Window(window);
}
PlatformInput& Win32Application::getInput()
{

View file

@ -18,7 +18,7 @@ public :
virtual void shutdown();
//virtual PlatformDisplay& getDisplay();
virtual PlatformWindow* createWindow(Window* window);
virtual PlatformInput& getInput();