74 lines
1.4 KiB
C++
74 lines
1.4 KiB
C++
|
|
#ifndef SPECTRE_PLATFORM_WINDOW_H
|
|
#define SPECTRE_PLATFORM_WINDOW_H
|
|
|
|
#include <Spectre/Math/Vector2.h>
|
|
#include <Spectre/Window/WindowDescription.h>
|
|
#include <Spectre/Window/DisplayMode.h>
|
|
#include <string>
|
|
#include <cstdint>
|
|
|
|
// Low-level platform dependant API.
|
|
|
|
namespace sp {
|
|
|
|
class Window;
|
|
|
|
class PlatformWindow
|
|
{
|
|
public :
|
|
// Factory method.
|
|
static PlatformWindow* make(Window* owner);
|
|
|
|
virtual ~PlatformWindow();
|
|
|
|
virtual bool create(WindowDescription description) = 0;
|
|
|
|
virtual void destroy() = 0;
|
|
|
|
virtual void* getHandle() const = 0;
|
|
|
|
virtual bool isValid() = 0;
|
|
|
|
virtual void setSize(unsigned int width, unsigned int height) = 0;
|
|
|
|
virtual Vector2u getSize() const = 0;
|
|
|
|
virtual void setPosition(unsigned int x, unsigned int y) = 0;
|
|
|
|
virtual Vector2u getPosition() const = 0;
|
|
|
|
virtual void setVisible(bool visible) = 0;
|
|
|
|
virtual void setDecoration(unsigned decoration) = 0;
|
|
|
|
virtual void minimize() = 0;
|
|
|
|
virtual void maximize() = 0;
|
|
|
|
virtual void enterFullscreen(DisplayMode mode) = 0;
|
|
|
|
virtual void exitFullscreen() = 0;
|
|
|
|
virtual void setCaption(const std::string& caption) = 0;
|
|
|
|
virtual void setIcon(unsigned int width, unsigned int height, const uint8_t *pixels) = 0;
|
|
|
|
virtual void showCursor(bool value) = 0;
|
|
|
|
virtual void grabCursor(bool value) = 0;
|
|
|
|
protected :
|
|
|
|
PlatformWindow();
|
|
|
|
void onReshape(int width, int height);
|
|
|
|
private :
|
|
|
|
Window * m_owner;
|
|
};
|
|
|
|
} // namespace sp
|
|
|
|
#endif /* SPECTRE_PLATFORM_DISPLAY_H */
|