From 66591c4bdb13d976cc9d0e61f42b1366e80f44f7 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sat, 18 Apr 2015 14:54:41 -0700 Subject: [PATCH] * Initial GLX stub --- include/CGLXContext.hpp | 27 +++++++++++++++++++++++++++ include/IContext.hpp | 22 ++++++++++++++++++++++ libBoo.pro | 8 ++++++-- src/CGLXContext.cpp | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 include/CGLXContext.hpp create mode 100644 include/IContext.hpp create mode 100644 src/CGLXContext.cpp 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; +}