* Initial GLX stub

This commit is contained in:
Phillip Stephens 2015-04-18 14:54:41 -07:00
parent 52c73af8a6
commit 66591c4bdb
4 changed files with 92 additions and 2 deletions

27
include/CGLXContext.hpp Normal file
View File

@ -0,0 +1,27 @@
#ifndef CGLXCONTEXT_HPP
#define CGLXCONTEXT_HPP
#include <GL/glx.h>
#include <IContext.hpp>
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

22
include/IContext.hpp Normal file
View File

@ -0,0 +1,22 @@
#ifndef ICONTEXT_HPP
#define ICONTEXT_HPP
#include <string>
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

View File

@ -1,5 +1,9 @@
CONFIG -= Qt
CONFIG += app c++11
HEADERS += \ HEADERS += \
IContext.hpp include/IContext.hpp \
include/CGLXContext.hpp
SOURCES += \ SOURCES += \
IContext.cpp src/CGLXContext.cpp

37
src/CGLXContext.cpp Normal file
View File

@ -0,0 +1,37 @@
#include "CGLXContext.hpp"
#include <iostream>
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;
}