diff --git a/include/CGLXContext.hpp b/include/CGLXContext.hpp index 676c331..b5209d4 100644 --- a/include/CGLXContext.hpp +++ b/include/CGLXContext.hpp @@ -11,6 +11,9 @@ public: CGLXContext(); virtual ~CGLXContext() {} + bool create(); + void setMajorVersion(const int& maj) override; + void setMinVersion(const int& min) override; const std::string version() const override; const std::string name() const override; int depthSize() const override; @@ -18,8 +21,10 @@ public: int greenDepth() const override; int blueDepth() const override; private: - int m_minVersion; int m_majVersion; + int m_minVersion; + + Display* m_display; }; diff --git a/include/IContext.hpp b/include/IContext.hpp index efbb9dd..fcc633c 100644 --- a/include/IContext.hpp +++ b/include/IContext.hpp @@ -6,10 +6,11 @@ class IContext { public: - + virtual ~IContext() {} + virtual void setMinVersion (const int& min)=0; virtual void setMajorVersion(const int& maj)=0; - virtual void create()=0; + virtual bool create()=0; virtual const std::string version() const=0; virtual const std::string name() const=0; virtual int depthSize() const=0; @@ -18,4 +19,4 @@ public: virtual int blueDepth() const=0; }; -#endif // ICONTEXT_HPP \ No newline at end of file +#endif // ICONTEXT_HPP diff --git a/libBoo.pri b/libBoo.pri index ba1a3bc..709d7f5 100644 --- a/libBoo.pri +++ b/libBoo.pri @@ -1,3 +1,5 @@ +!contains(CONFIG,c++11):CONFIG += C++11 + HEADERS += \ $$PWD/include/boo.hpp \ $$PWD/include/IContext.hpp \ @@ -15,12 +17,6 @@ mac:HEADERS += \ win32:HEADERS += \ $$PWD/include/CWGLContext.hpp \ - -SOURCES += \ - $$PWD/src/CSurface.cpp \ - $$PWD/src/CCGLContext.cpp \ - $$PWD/src/CRetraceWaiter.cpp - unix:SOURCES += \ $$PWD/src/CGLXContext.cpp \ diff --git a/libBoo.pro b/libBoo.pro index 363cfe8..394141e 100644 --- a/libBoo.pro +++ b/libBoo.pro @@ -1,5 +1,8 @@ CONFIG -= Qt CONFIG += app c++11 +unix:CONFIG += link_pkgconfig +unix:PKGCONFIG += x11 + include(libBoo.pri) include(test/test.pri) diff --git a/src/CGLXContext.cpp b/src/CGLXContext.cpp index 59fed1b..0e6a6d5 100644 --- a/src/CGLXContext.cpp +++ b/src/CGLXContext.cpp @@ -2,10 +2,28 @@ #include CGLXContext::CGLXContext() + : m_majVersion(3), + m_minVersion(3), + m_display(nullptr) { std::cout << "Hello from GLX" << std::endl; } +bool CGLXContext::create() +{ + return true; +} + +void CGLXContext::setMinVersion(const int& min) +{ + m_minVersion = min; +} + +void CGLXContext::setMajorVersion(const int& maj) +{ + m_majVersion = maj; +} + const std::string CGLXContext::version() const { return "Invalid version"; diff --git a/test/main.cpp b/test/main.cpp index 5762bfd..544d17f 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -4,6 +4,12 @@ int main(int argc, char** argv) { - + IContext* ctx = new CContext; + + if (ctx->create()) + { + } + + delete ctx; return 0; }