comparison DPF-Prymula-audioplugins/dpf/dgl/OpenGL-include.hpp @ 3:84e66ea83026

DPF-Prymula-audioplugins-0.231015-2
author prymula <prymula76@outlook.com>
date Mon, 16 Oct 2023 21:53:34 +0200
parents
children
comparison
equal deleted inserted replaced
2:cf2cb71d31dd 3:84e66ea83026
1 /*
2 * DISTRHO Plugin Framework (DPF)
3 * Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com>
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any purpose with
6 * or without fee is hereby granted, provided that the above copyright notice and this
7 * permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
10 * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
11 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
12 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17 #ifndef DGL_OPENGL_INCLUDE_HPP_INCLUDED
18 #define DGL_OPENGL_INCLUDE_HPP_INCLUDED
19
20 #include "../distrho/src/DistrhoDefines.h"
21
22 // --------------------------------------------------------------------------------------------------------------------
23 // Fix OpenGL includes for Windows, based on glfw code (part 1)
24
25 #undef DGL_WINGDIAPI_DEFINED
26
27 #ifdef DISTRHO_OS_WINDOWS
28
29 #ifndef WINAPI
30 # define WINAPI __stdcall
31 #endif
32
33 #ifndef APIENTRY
34 # define APIENTRY WINAPI
35 #endif // APIENTRY
36
37 /* We need WINGDIAPI defined */
38 #ifndef WINGDIAPI
39 # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__)
40 # define WINGDIAPI __declspec(dllimport)
41 # elif defined(__LCC__)
42 # define WINGDIAPI __stdcall
43 # else
44 # define WINGDIAPI extern
45 # endif
46 # define DGL_WINGDIAPI_DEFINED
47 #endif // WINGDIAPI
48
49 #endif // DISTRHO_OS_WINDOWS
50
51 // --------------------------------------------------------------------------------------------------------------------
52 // OpenGL includes
53
54 #ifdef DISTRHO_OS_MAC
55 # ifdef DGL_USE_OPENGL3
56 # include <OpenGL/gl3.h>
57 # include <OpenGL/gl3ext.h>
58 # else
59 # include <OpenGL/gl.h>
60 # endif
61 #else
62 # ifndef DISTRHO_OS_WINDOWS
63 # define GL_GLEXT_PROTOTYPES
64 # endif
65 # ifndef __GLEW_H__
66 # include <GL/gl.h>
67 # include <GL/glext.h>
68 # endif
69 #endif
70
71 // --------------------------------------------------------------------------------------------------------------------
72 // Missing OpenGL defines
73
74 #if defined(GL_BGR_EXT) && !defined(GL_BGR)
75 # define GL_BGR GL_BGR_EXT
76 #endif
77
78 #if defined(GL_BGRA_EXT) && !defined(GL_BGRA)
79 # define GL_BGRA GL_BGRA_EXT
80 #endif
81
82 #ifndef GL_CLAMP_TO_BORDER
83 # define GL_CLAMP_TO_BORDER 0x812D
84 #endif
85
86 // --------------------------------------------------------------------------------------------------------------------
87 // Fix OpenGL includes for Windows, based on glfw code (part 2)
88
89 #ifdef DGL_WINGDIAPI_DEFINED
90 # undef WINGDIAPI
91 # undef DGL_WINGDIAPI_DEFINED
92 #endif
93
94 // --------------------------------------------------------------------------------------------------------------------
95
96 #endif