38 lines
690 B
C++
38 lines
690 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* owner)
|
|
{
|
|
return new WindowType(owner);
|
|
}
|
|
|
|
PlatformWindow::PlatformWindow(Window* owner) :
|
|
m_owner (owner)
|
|
{
|
|
}
|
|
|
|
PlatformWindow::~PlatformWindow()
|
|
{
|
|
// Nothing to do.
|
|
}
|
|
|
|
void PlatformWindow::onReshape(int width, int height)
|
|
{
|
|
// Forward to parent.
|
|
m_owner->onReshape(width, height);
|
|
}
|
|
|
|
} // namespace sp
|