* Platform guards

This commit is contained in:
Phillip Stephens 2015-04-18 17:37:52 -07:00
parent 34599a0c15
commit 460d3875f5
7 changed files with 24 additions and 5 deletions

View File

@ -6,10 +6,10 @@
#if defined(_WIN32)
#error "No support for WGL"
#elif defined(__APPLE__)
#include "CCGLContext.hpp"
#include "mac/CCGLContext.hpp"
typedef CCGLContext CGraphicsContext;
#elif __linux__
#include "CGLXContext.hpp"
#elif defined(__GNUC__) || defined(__clang__)
#include "x11/CGLXContext.hpp"
typedef CGLXContext CGraphicsContext;
#endif

View File

@ -1,6 +1,7 @@
#ifndef CCGLCONTEXT_HPP
#define CCGLCONTEXT_HPP
#ifdef __APPLE__
#include "IGraphicsContext.hpp"
#include <OpenGL/OpenGL.h>
@ -24,4 +25,5 @@ private:
int m_majVersion;
};
#endif // __APPLE__
#endif // CCGLCONTEXT_HPP

View File

@ -0,0 +1,8 @@
#ifndef CWGLCONTEXT_HPP
#define CWGLCONTEXT_HPP
#ifdef _WIN32
#endif // _WIN32
#endif // CWGLCONTEXT_HPP

View File

@ -1,6 +1,7 @@
#ifndef CGLXCONTEXT_HPP
#define CGLXCONTEXT_HPP
#if !defined(__APPLE__) && (defined(__linux__) || defined(BSD))
#include <GL/glx.h>
#include <IGraphicsContext.hpp>
@ -28,5 +29,5 @@ private:
};
#endif // !defined(__APPLE__) && (defined(__linux__) || defined(BSD))
#endif // CGLXCONTEXT_HPP

View File

@ -1,3 +1,4 @@
#ifdef __APPLE__
#include "CCGLContext.hpp"
#include <iostream>

View File

@ -0,0 +1,4 @@
#ifdef _WIN32
#include "win/CWGLContext.hpp"
#endif

View File

@ -1,4 +1,5 @@
#include "CGLXContext.hpp"
#if !defined(__APPLE__) && (defined(__linux__) || defined(BSD))
#include "x11/CGLXContext.hpp"
#include <iostream>
CGLXContext::CGLXContext()
@ -53,3 +54,5 @@ int CGLXContext::blueDepth() const
{
return -1;
}
#endif // !defined(__APPLE__) && (defined(__linux__) || defined(BSD))