Mercurial > hg > pub > prymula > com
comparison DPF-Prymula-audioplugins/dpf/dgl/src/pugl-upstream/include/pugl/gl.h @ 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 // Copyright 2012-2020 David Robillard <d@drobilla.net> | |
2 // SPDX-License-Identifier: ISC | |
3 | |
4 #ifndef PUGL_GL_H | |
5 #define PUGL_GL_H | |
6 | |
7 #include "pugl/pugl.h" | |
8 | |
9 // IWYU pragma: begin_exports | |
10 | |
11 /* Unfortunately, GL includes vary across platforms, so include them here to | |
12 enable pure portable programs. */ | |
13 | |
14 #ifndef PUGL_NO_INCLUDE_GL_H | |
15 # ifdef __APPLE__ | |
16 # include <OpenGL/gl.h> | |
17 # else | |
18 # ifdef _WIN32 | |
19 # include <windows.h> | |
20 # endif | |
21 # include <GL/gl.h> | |
22 # endif | |
23 #endif | |
24 | |
25 #ifndef PUGL_NO_INCLUDE_GLU_H | |
26 # ifdef __APPLE__ | |
27 # include <OpenGL/glu.h> | |
28 # else | |
29 # ifdef _WIN32 | |
30 # include <windows.h> | |
31 # endif | |
32 # include <GL/glu.h> | |
33 # endif | |
34 #endif | |
35 | |
36 // IWYU pragma: end_exports | |
37 | |
38 PUGL_BEGIN_DECLS | |
39 | |
40 /** | |
41 @defgroup gl OpenGL | |
42 OpenGL graphics support. | |
43 @ingroup pugl | |
44 @{ | |
45 */ | |
46 | |
47 /** | |
48 OpenGL extension function. | |
49 */ | |
50 typedef void (*PuglGlFunc)(void); | |
51 | |
52 /** | |
53 Return the address of an OpenGL extension function. | |
54 */ | |
55 PUGL_API | |
56 PuglGlFunc | |
57 puglGetProcAddress(const char* name); | |
58 | |
59 /** | |
60 Enter the OpenGL context. | |
61 | |
62 This can be used to enter the graphics context in unusual situations, for | |
63 doing things like loading textures. Note that this must not be used for | |
64 drawing, which may only be done while processing an expose event. | |
65 */ | |
66 PUGL_API | |
67 PuglStatus | |
68 puglEnterContext(PuglView* view); | |
69 | |
70 /** | |
71 Leave the OpenGL context. | |
72 | |
73 This must only be called after puglEnterContext(). | |
74 */ | |
75 PUGL_API | |
76 PuglStatus | |
77 puglLeaveContext(PuglView* view); | |
78 | |
79 /** | |
80 OpenGL graphics backend. | |
81 | |
82 Pass the returned value to puglSetBackend() to draw to a view with OpenGL. | |
83 */ | |
84 PUGL_CONST_API | |
85 const PuglBackend* | |
86 puglGlBackend(void); | |
87 | |
88 PUGL_END_DECLS | |
89 | |
90 /** | |
91 @} | |
92 */ | |
93 | |
94 #endif // PUGL_GL_H |