From 25168216b92aeadae38d288615ae32665abb69e4 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Sat, 18 Apr 2015 13:36:57 -1000 Subject: [PATCH] minor adjustments --- include/CCGLContext.hpp | 12 ++++++++++++ include/CSurface.hpp | 9 +++++++++ include/IContext.hpp | 3 +-- include/ISurface.hpp | 1 + libBoo.pri | 6 +++++- src/CCGLContext.cpp | 37 +++++++++++++++++++++++++++++++++++++ src/CSurface.cpp | 11 +++++++++++ test/main.cpp | 1 + 8 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 include/CSurface.hpp diff --git a/include/CCGLContext.hpp b/include/CCGLContext.hpp index 7cbdcd2..8834835 100644 --- a/include/CCGLContext.hpp +++ b/include/CCGLContext.hpp @@ -6,7 +6,19 @@ class CCGLContext final : public IContext { +public: + CCGLContext(); + virtual ~CCGLContext() {} + 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 // CCGLCONTEXT_HPP diff --git a/include/CSurface.hpp b/include/CSurface.hpp new file mode 100644 index 0000000..7360716 --- /dev/null +++ b/include/CSurface.hpp @@ -0,0 +1,9 @@ +#ifndef CSURFACE_HPP +#define CSURFACE_HPP + +#include "ISurface.hpp" + +ISurface* CSurfaceNewWindow(); +ISurface* CSurfaceNewQWidget(); + +#endif // CSURFACE_HPP diff --git a/include/IContext.hpp b/include/IContext.hpp index 95e3568..efbb9dd 100644 --- a/include/IContext.hpp +++ b/include/IContext.hpp @@ -6,11 +6,10 @@ class IContext { public: - virtual ~IContext() {} virtual void setMinVersion (const int& min)=0; virtual void setMajorVersion(const int& maj)=0; - virtual void create(); + virtual void create()=0; virtual const std::string version() const=0; virtual const std::string name() const=0; virtual int depthSize() const=0; diff --git a/include/ISurface.hpp b/include/ISurface.hpp index c6f2319..cdcdc5e 100644 --- a/include/ISurface.hpp +++ b/include/ISurface.hpp @@ -3,6 +3,7 @@ class ISurface { +public: }; diff --git a/libBoo.pri b/libBoo.pri index f8f9b4b..ba1a3bc 100644 --- a/libBoo.pri +++ b/libBoo.pri @@ -7,8 +7,10 @@ HEADERS += \ unix:HEADERS += \ $$PWD/include/CGLXContext.hpp \ +mac:HEADERS -= \ + $$PWD/include/CGLXContext.hpp mac:HEADERS += \ - $$PWD/include/CCGLContext.hpp \ + $$PWD/include/CCGLContext.hpp win32:HEADERS += \ $$PWD/include/CWGLContext.hpp \ @@ -22,6 +24,8 @@ SOURCES += \ unix:SOURCES += \ $$PWD/src/CGLXContext.cpp \ +mac:SOURCES -= \ + $$PWD/src/CGLXContext.cpp mac:OBJECTIVE_SOURCES += \ $$PWD/src/CCGLCocoaView.mm diff --git a/src/CCGLContext.cpp b/src/CCGLContext.cpp index e69de29..3a47616 100644 --- a/src/CCGLContext.cpp +++ b/src/CCGLContext.cpp @@ -0,0 +1,37 @@ +#include "CCGLContext.hpp" +#include + +CCGLContext::CCGLContext() +{ + std::cout << "Hello from CGL" << std::endl; +} + +const std::string CCGLContext::version() const +{ + return "Invalid version"; +} + +const std::string CCGLContext::name() const +{ + return "GLX Context"; +} + +int CCGLContext::depthSize() const +{ + return -1; +} + +int CCGLContext::redDepth() const +{ + return -1; +} + +int CCGLContext::greenDepth() const +{ + return -1; +} + +int CCGLContext::blueDepth() const +{ + return -1; +} diff --git a/src/CSurface.cpp b/src/CSurface.cpp index e69de29..c522c4d 100644 --- a/src/CSurface.cpp +++ b/src/CSurface.cpp @@ -0,0 +1,11 @@ +#include "CSurface.hpp" + +ISurface* CSurfaceNewWindow() +{ + +} + +ISurface* CSurfaceNewQWidget() +{ + +} diff --git a/test/main.cpp b/test/main.cpp index 295761d..5762bfd 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -4,5 +4,6 @@ int main(int argc, char** argv) { + return 0; }