39 lines
708 B
C++
39 lines
708 B
C++
|
|
#include <Spectre/Window/Window.h>
|
|
#include "PlatformWindow.h"
|
|
|
|
#ifdef SPECTRE_PLATFORM_WIN
|
|
#include <Platform/Win32/Win32Window.h>
|
|
typedef sp::Win32Window WindowType;
|
|
#elif SPECTRE_PLATFORM_UNIX
|
|
#include <Platform/Unix/X11Window.h>
|
|
typedef sp::X11Window WindowType;
|
|
#else
|
|
#error "No Window implementation exists"
|
|
#endif
|
|
|
|
namespace sp {
|
|
|
|
PlatformWindow* PlatformWindow::make(Window* parent)
|
|
{
|
|
WindowType* disp = new WindowType();
|
|
disp->m_parent = parent;
|
|
return disp;
|
|
}
|
|
|
|
PlatformWindow::PlatformWindow()
|
|
{
|
|
}
|
|
|
|
PlatformWindow::~PlatformWindow()
|
|
{
|
|
// Nothing to do.
|
|
}
|
|
|
|
void PlatformWindow::onReshape(int width, int height)
|
|
{
|
|
// Forward to parent.
|
|
m_parent->onReshape(width, height);
|
|
}
|
|
|
|
} // namespace sp
|