OpenGL-utility/include/core.hpp

58 lines
1,004 B
C++
Raw Normal View History

2021-01-21 14:30:48 +00:00
/*****************************************************************//**
* \file core.hpp
* \brief Core includes and defines
*
* \author Robert
* \date January 2021
*********************************************************************/
2021-01-19 18:25:46 +00:00
#ifndef CORE_HPP
#define CORE_HPP
2021-01-24 16:05:28 +00:00
#pragma warning(disable : 4251)
#include <memory>
2021-01-29 16:28:48 +00:00
#include <iostream>
2021-01-21 14:48:31 +00:00
#include <stdexcept>
#include <string>
2021-01-22 12:37:57 +00:00
2021-01-21 11:07:43 +00:00
#include <glad/glad.h>
2021-01-19 18:25:46 +00:00
#ifdef OGLU_WIN32
#ifdef OGLU_BUILD_DLL
#define OGLU_API __declspec(dllexport)
#else
#define OGLU_API __declspec(dllimport)
#endif //OGLU_BUILD_DLL
#else
#define OGLU_API
#endif //OGLU_WIN32
2021-01-29 16:28:48 +00:00
namespace oglu
{
class NullBuffer : public std::streambuf
{
public:
int overflow(int c) { return c; }
};
class NullStream : public std::ostream
{
public:
NullStream() : std::ostream(&buf) {}
private:
NullBuffer buf;
};
extern OGLU_API NullStream cnull;
}
#ifndef NDEBUG
#define OGLU_ERROR_STREAM std::cerr
#else
#define OGLU_ERROR_STREAM oglu::cnull
#endif
2021-01-19 18:25:46 +00:00
#endif