SGCT master (487fac4)
Simple Graphics Cluster Toolkit
Loading...
Searching...
No Matches
opengl.h
Go to the documentation of this file.
1/*****************************************************************************************
2 * SGCT *
3 * Simple Graphics Cluster Toolkit *
4 * *
5 * Copyright (c) 2012-2026 *
6 * For conditions of distribution and use, see copyright notice in LICENSE.md *
7 ****************************************************************************************/
8
9#ifndef __SGCT__OPENGL_H__
10#define __SGCT__OPENGL_H__
11
12// Workaround for APIENTRY macro redefinition
13// Problem: glad.h will define APIENTRY if it is not defined. But if windows.h is included
14// after glad.h it will also unconditionally set APIENTRY and we get a macro redefinition
15// warning.
16// Solution: We manually define APIENTRY before including glad.h and keep track of if we
17// did to be able to undefine it if we did define it.
18#if defined(_WIN32)
19#if !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
20#define APIENTRY __stdcall
21#define SCGT_GLAD_APIENTRY_DEFINED
22#endif // !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
23#endif // WIN32
24
25#include <glad/glad.h>
26
27#ifndef GL_NONE_BIT
28#define GL_NONE_BIT 0
29#endif // GL_NONE_BIT
30
31#ifdef SCGT_GLAD_APIENTRY_DEFINED
32#undef APIENTRY
33#undef SCGT_GLAD_APIENTRY_DEFINED
34#endif // SCGT_GLAD_APIENTRY_DEFINED
35
36#endif // __SGCT__OPENGL_H__