Rename Display to Window.
It makes more sense to be consistent and always call it window.
This commit is contained in:
parent
416a71f744
commit
24da7f45e0
33 changed files with 257 additions and 255 deletions
93
include/Spectre/Window/Window.h
Normal file
93
include/Spectre/Window/Window.h
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
|
||||
#ifndef SPECTRE_WINDOW_WINDOW_H
|
||||
#define SPECTRE_WINDOW_WINDOW_H
|
||||
|
||||
#include "DisplayMode.h"
|
||||
#include "WindowDescription.h"
|
||||
#include <Spectre/Math/Vector2.h>
|
||||
#include <Spectre/Window/GLContext.h>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
namespace sp {
|
||||
|
||||
class PlatformWindow;
|
||||
class GLContext;
|
||||
|
||||
class Window
|
||||
{
|
||||
friend class PlatformWindow;
|
||||
public :
|
||||
enum Mode {
|
||||
WINDOWED = 0,
|
||||
FULLSCREEN = 1,
|
||||
WINDOWEDFULLSCREEN = 2,
|
||||
};
|
||||
|
||||
public :
|
||||
Window();
|
||||
virtual ~Window();
|
||||
|
||||
bool create(WindowDescription decription);
|
||||
|
||||
void destroy();
|
||||
|
||||
void setSize(unsigned int width, unsigned int height);
|
||||
|
||||
sp::Vector2u getSize() const;
|
||||
|
||||
void setCaption(const std::string& title);
|
||||
|
||||
const std::string& getCaption() const;
|
||||
|
||||
void setIcon(const std::string& filename);
|
||||
|
||||
void setIcon(unsigned int width, unsigned int height, const uint8_t *pixels);
|
||||
|
||||
void setDisplayMode(const DisplayMode& mode);
|
||||
|
||||
const DisplayMode& getDisplayMode() const;
|
||||
|
||||
void setVideoMode(Mode mode);
|
||||
|
||||
enum Mode getVideoMode() const;
|
||||
|
||||
void setVisible(bool visible);
|
||||
|
||||
void showCursor(bool value);
|
||||
|
||||
void grabCursor(bool value);
|
||||
|
||||
bool activate(bool value);
|
||||
|
||||
// Enable/Disable Vertical Sync.
|
||||
bool enableVSync(bool value);
|
||||
|
||||
void swapBuffers();
|
||||
|
||||
protected :
|
||||
|
||||
void init();
|
||||
|
||||
void onReshape(int width, int height);
|
||||
|
||||
protected :
|
||||
enum Mode m_fmode;
|
||||
|
||||
// Cache window position when entering fullscreen
|
||||
// So it can be restored when returning to window mode.
|
||||
Vector2u m_cachePos;
|
||||
|
||||
WindowDescription m_description;
|
||||
WindowDescription m_cacheDesc;
|
||||
|
||||
std::string m_caption;
|
||||
|
||||
PlatformWindow* m_impl;
|
||||
|
||||
GLContext* m_context;
|
||||
};
|
||||
|
||||
} // namepsace sp
|
||||
|
||||
#endif /* SPECTRE_WINDOW_WINDOW_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue