Conflicts:
	include/IContext.hpp
	test/main.cpp
This commit is contained in:
Jack Andersen 2015-04-18 13:43:07 -10:00
commit 6e766bfe5e
6 changed files with 40 additions and 11 deletions

View File

@ -11,6 +11,9 @@ public:
CGLXContext(); CGLXContext();
virtual ~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 version() const override;
const std::string name() const override; const std::string name() const override;
int depthSize() const override; int depthSize() const override;
@ -18,8 +21,10 @@ public:
int greenDepth() const override; int greenDepth() const override;
int blueDepth() const override; int blueDepth() const override;
private: private:
int m_minVersion;
int m_majVersion; int m_majVersion;
int m_minVersion;
Display* m_display;
}; };

View File

@ -6,10 +6,11 @@
class IContext class IContext
{ {
public: public:
virtual ~IContext() {}
virtual void setMinVersion (const int& min)=0; virtual void setMinVersion (const int& min)=0;
virtual void setMajorVersion(const int& maj)=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 version() const=0;
virtual const std::string name() const=0; virtual const std::string name() const=0;
virtual int depthSize() const=0; virtual int depthSize() const=0;
@ -18,4 +19,4 @@ public:
virtual int blueDepth() const=0; virtual int blueDepth() const=0;
}; };
#endif // ICONTEXT_HPP #endif // ICONTEXT_HPP

View File

@ -1,3 +1,5 @@
!contains(CONFIG,c++11):CONFIG += C++11
HEADERS += \ HEADERS += \
$$PWD/include/boo.hpp \ $$PWD/include/boo.hpp \
$$PWD/include/IContext.hpp \ $$PWD/include/IContext.hpp \
@ -15,12 +17,6 @@ mac:HEADERS += \
win32:HEADERS += \ win32:HEADERS += \
$$PWD/include/CWGLContext.hpp \ $$PWD/include/CWGLContext.hpp \
SOURCES += \
$$PWD/src/CSurface.cpp \
$$PWD/src/CCGLContext.cpp \
$$PWD/src/CRetraceWaiter.cpp
unix:SOURCES += \ unix:SOURCES += \
$$PWD/src/CGLXContext.cpp \ $$PWD/src/CGLXContext.cpp \

View File

@ -1,5 +1,8 @@
CONFIG -= Qt CONFIG -= Qt
CONFIG += app c++11 CONFIG += app c++11
unix:CONFIG += link_pkgconfig
unix:PKGCONFIG += x11
include(libBoo.pri) include(libBoo.pri)
include(test/test.pri) include(test/test.pri)

View File

@ -2,10 +2,28 @@
#include <iostream> #include <iostream>
CGLXContext::CGLXContext() CGLXContext::CGLXContext()
: m_majVersion(3),
m_minVersion(3),
m_display(nullptr)
{ {
std::cout << "Hello from GLX" << std::endl; 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 const std::string CGLXContext::version() const
{ {
return "Invalid version"; return "Invalid version";

View File

@ -4,6 +4,12 @@
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
IContext* ctx = new CContext;
if (ctx->create())
{
}
delete ctx;
return 0; return 0;
} }