#pragma once
#include "ofConstants.h"
#include "glm/vec2.hpp"
enum ofWindowMode{
OF_WINDOW = 0,
OF_FULLSCREEN = 1,
OF_GAME_MODE = 2
};
enum ofOrientation: short{
OF_ORIENTATION_DEFAULT = 1,
OF_ORIENTATION_180 = 2,
OF_ORIENTATION_90_LEFT = 3,
OF_ORIENTATION_90_RIGHT = 4,
OF_ORIENTATION_UNKNOWN = 5
};
class ofWindowSettings{
public:
ofWindowSettings()
:windowMode(OF_WINDOW)
,width(1024)
,height(768)
,sizeSet(false)
,position(0,0)
,positionSet(false){}
virtual ~ofWindowSettings(){};
std::string title;
ofWindowMode windowMode;
void setPosition(const glm::vec2 & position) {
this->position = position;
this->positionSet = true;
}
void setSize(int width, int height) {
this->width = width;
this->height = height;
this->sizeSet = true;
}
bool isSizeSet() const {
return sizeSet;
}
int getWidth() const {
return width;
}
int getHeight() const {
return height;
}
const glm::vec2 & getPosition() const {
return position;
}
bool isPositionSet() const {
return positionSet;
}
protected:
int width;
int height;
bool sizeSet;
glm::vec2 position;
bool positionSet;
};
class ofGLWindowSettings: public ofWindowSettings{
public:
ofGLWindowSettings()
:glVersionMajor(2)
,glVersionMinor(1){}
ofGLWindowSettings(const ofWindowSettings & settings)
:ofWindowSettings(settings)
,glVersionMajor(2)
,glVersionMinor(1){
const ofGLWindowSettings * glSettings = dynamic_cast<const ofGLWindowSettings*>(&settings);
if(glSettings){
glVersionMajor = glSettings->glVersionMajor;
glVersionMinor = glSettings->glVersionMinor;
}
}
virtual ~ofGLWindowSettings(){};
void setGLVersion(int major, int minor){
glVersionMajor = major;
glVersionMinor = minor;
}
int glVersionMajor;
int glVersionMinor;
};
class ofGLESWindowSettings: public ofWindowSettings{
public:
ofGLESWindowSettings()
:glesVersion(1){}
ofGLESWindowSettings(const ofWindowSettings & settings)
:ofWindowSettings(settings), glesVersion(1) {
const ofGLESWindowSettings * glesSettings = dynamic_cast<const ofGLESWindowSettings*>(&settings);
if(glesSettings){
glesVersion = glesSettings->glesVersion;
}
}
virtual ~ofGLESWindowSettings(){};
void setGLESVersion(int version){
glesVersion = version;
}
int glesVersion;
};
Comments