diff --git a/include/CGLXContext.hpp b/include/CGLXContext.hpp new file mode 100644 index 0000000..676c331 --- /dev/null +++ b/include/CGLXContext.hpp @@ -0,0 +1,27 @@ +#ifndef CGLXCONTEXT_HPP +#define CGLXCONTEXT_HPP + +#include + +#include + +class CGLXContext final : public IContext +{ +public: + CGLXContext(); + virtual ~CGLXContext() {} + + const std::string version() const override; + const std::string name() const override; + int depthSize() const override; + int redDepth() const override; + int greenDepth() const override; + int blueDepth() const override; +private: + int m_minVersion; + int m_majVersion; +}; + + + +#endif // CGLXCONTEXT_HPP diff --git a/include/IContext.hpp b/include/IContext.hpp new file mode 100644 index 0000000..27b032e --- /dev/null +++ b/include/IContext.hpp @@ -0,0 +1,22 @@ +#ifndef ICONTEXT_HPP +#define ICONTEXT_HPP + +#include + +class IContext +{ +public: + virtual ~IContext() {} + + virtual void setMinVersion (const int& min)=0; + virtual void setMajorVersion(const int& maj)=0; + virtual void create(); + virtual const std::string version() const=0; + virtual const std::string name() const=0; + virtual int depthSize() const=0; + virtual int redDepth() const=0; + virtual int greenDepth() const=0; + virtual int blueDepth() const=0; +}; + +#endif // ICONTEXT_HPP diff --git a/libBoo.pro b/libBoo.pro index 81532a4..70c6354 100644 --- a/libBoo.pro +++ b/libBoo.pro @@ -1,5 +1,9 @@ +CONFIG -= Qt +CONFIG += app c++11 + HEADERS += \ - IContext.hpp + include/IContext.hpp \ + include/CGLXContext.hpp SOURCES += \ - IContext.cpp + src/CGLXContext.cpp diff --git a/src/CGLXContext.cpp b/src/CGLXContext.cpp new file mode 100644 index 0000000..59fed1b --- /dev/null +++ b/src/CGLXContext.cpp @@ -0,0 +1,37 @@ +#include "CGLXContext.hpp" +#include + +CGLXContext::CGLXContext() +{ + std::cout << "Hello from GLX" << std::endl; +} + +const std::string CGLXContext::version() const +{ + return "Invalid version"; +} + +const std::string CGLXContext::name() const +{ + return "GLX Context"; +} + +int CGLXContext::depthSize() const +{ + return -1; +} + +int CGLXContext::redDepth() const +{ + return -1; +} + +int CGLXContext::greenDepth() const +{ + return -1; +} + +int CGLXContext::blueDepth() const +{ + return -1; +}