1
0
Fork 0

Platform/PlatformApplication: add createGLContext()

This commit is contained in:
Henrik Hautakoski 2023-08-23 19:43:22 +02:00
parent b1ccea1397
commit b300310239
5 changed files with 19 additions and 0 deletions

View file

@ -8,6 +8,7 @@
namespace sp {
class Window;
class GLContext;
class PlatformWindow;
class PlatformInput;
@ -24,6 +25,8 @@ public :
virtual PlatformWindow* createWindow(Window* window) = 0;
virtual GLContext* createGLContext() = 0;
virtual PlatformInput& getInput() = 0;
MessageQueue& getMessageQueue();

View file

@ -1,5 +1,6 @@
#include "X11Window.h"
#include "GLXContext.h"
#include "UnixApplication.h"
#include "Xlib.h"
@ -20,6 +21,11 @@ PlatformWindow* UnixApplication::createWindow(Window* window)
return new X11Window(window);
}
GLContext* UnixApplication::createGLContext()
{
return new GLXContext();
}
PlatformInput& UnixApplication::getInput()
{
return m_input;

View file

@ -17,6 +17,8 @@ public :
virtual PlatformWindow* createWindow(Window* window);
virtual GLContext* createGLContext();
virtual PlatformInput& getInput();
protected :

View file

@ -1,5 +1,6 @@
#include "Win32Window.h"
#include "Win32GLContext.h"
#include "Win32Application.h"
namespace sp {
@ -17,6 +18,11 @@ PlatformWindow* Win32Application::createWindow(Window* window)
return new Win32Window(window);
}
GLContext* Win32Application::createGLContext()
{
return new Win32GLContext();
}
PlatformInput& Win32Application::getInput()
{
return m_input;

View file

@ -20,6 +20,8 @@ public :
virtual PlatformWindow* createWindow(Window* window);
virtual GLContext* createGLContext();
virtual PlatformInput& getInput();
protected :