1 // Copyright 2012-2020 David Robillard <d@drobilla.net>
2 // SPDX-License-Identifier: ISC
9 // IWYU pragma: begin_exports
11 /* Unfortunately, GL includes vary across platforms, so include them here to
12 enable pure portable programs. */
14 #ifndef PUGL_NO_INCLUDE_GL_H
16 # include <OpenGL/gl.h>
25 #ifndef PUGL_NO_INCLUDE_GLU_H
27 # include <OpenGL/glu.h>
36 // IWYU pragma: end_exports
42 OpenGL graphics support.
48 OpenGL extension function.
50 typedef void (*PuglGlFunc
)(void);
53 Return the address of an OpenGL extension function.
57 puglGetProcAddress(const char* name
);
60 Enter the OpenGL context.
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.
68 puglEnterContext(PuglView
* view
);
71 Leave the OpenGL context.
73 This must only be called after puglEnterContext().
77 puglLeaveContext(PuglView
* view
);
80 OpenGL graphics backend.
82 Pass the returned value to puglSetBackend() to draw to a view with OpenGL.