When writing the X11 (linux) implementation there was a problem with X11 defining a "Display" type and we also have a Display class in the engine. So to fix that problem and minimize the risk for running into other name conflicts. We move everything from global namespace.
80 lines
1.3 KiB
C++
80 lines
1.3 KiB
C++
|
|
#ifndef SPECTRE_DISPLAY_DISPLAY_H
|
|
#define SPECTRE_DISPLAY_DISPLAY_H
|
|
|
|
#include "DisplayMode.h"
|
|
#include "DisplayDescription.h"
|
|
#include <Spectre/Display/GLContext.h>
|
|
#include <Spectre/System/SystemEvent.h>
|
|
#include <string>
|
|
|
|
namespace sp {
|
|
|
|
class PlatformDisplay;
|
|
class GLContext;
|
|
|
|
class Display
|
|
{
|
|
friend class PlatformDisplay;
|
|
public :
|
|
enum Mode {
|
|
WINDOWED = 0,
|
|
FULLSCREEN = 1,
|
|
WINDOWEDFULLSCREEN = 2,
|
|
};
|
|
|
|
public :
|
|
Display();
|
|
virtual ~Display();
|
|
|
|
bool create(DisplayDescription decription);
|
|
|
|
void destroy();
|
|
|
|
void setSize(unsigned int width, unsigned int height);
|
|
|
|
void setCaption(const std::string& title);
|
|
|
|
const std::string& getCaption() const;
|
|
|
|
void setIcon(const std::string& filename);
|
|
|
|
void setDisplayMode(const DisplayMode& mode);
|
|
|
|
const DisplayMode& getDisplayMode() const;
|
|
|
|
void setVideoMode(Mode mode);
|
|
|
|
enum Mode getVideoMode() const;
|
|
|
|
void showCursor(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;
|
|
|
|
DisplayDescription m_description;
|
|
DisplayDescription m_cacheDesc;
|
|
|
|
std::string m_caption;
|
|
|
|
PlatformDisplay* m_impl;
|
|
|
|
GLContext* m_context;
|
|
};
|
|
|
|
} // namepsace sp
|
|
|
|
#endif /* SPECTRE_DISPLAY_DISPLAY_H */
|