diff options
author | David Robillard <d@drobilla.net> | 2014-08-27 07:09:58 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-08-27 07:09:58 +0000 |
commit | b4dbb3616865cd236cda4f2e4ac806b3b4840b29 (patch) | |
tree | 4a78f8298e42b95a074844e44d69a2446cb5eea3 /pugl/pugl.h | |
parent | f25f829a3038db39c83ad8cc92dd5fdc4876751b (diff) | |
download | pugl-b4dbb3616865cd236cda4f2e4ac806b3b4840b29.tar.gz pugl-b4dbb3616865cd236cda4f2e4ac806b3b4840b29.tar.bz2 pugl-b4dbb3616865cd236cda4f2e4ac806b3b4840b29.zip |
Cairo support on X11.
Diffstat (limited to 'pugl/pugl.h')
-rw-r--r-- | pugl/pugl.h | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/pugl/pugl.h b/pugl/pugl.h index 360f8e8..8cd8afb 100644 --- a/pugl/pugl.h +++ b/pugl/pugl.h @@ -23,20 +23,6 @@ #include <stdint.h> -/* - This API is pure portable C and contains no platform specific elements, or - even a GL dependency. However, unfortunately GL includes vary across - platforms so they are included here to allow for pure portable programs. -*/ -#ifdef __APPLE__ -# include "OpenGL/gl.h" -#else -# ifdef _WIN32 -# include <windows.h> /* Broken Windows GL headers require this */ -# endif -# include "GL/gl.h" -#endif - #ifdef PUGL_SHARED # ifdef _WIN32 # define PUGL_LIB_IMPORT __declspec(dllimport) @@ -88,6 +74,14 @@ typedef enum { } PuglStatus; /** + Drawing context type. +*/ +typedef enum { + PUGL_GL, + PUGL_CAIRO +} PuglContextType; + +/** Convenience symbols for ASCII control characters. */ typedef enum { @@ -247,6 +241,12 @@ PUGL_API void puglInitResizable(PuglView* view, bool resizable); /** + Set the context type before creating a window. +*/ +PUGL_API void +puglInitContextType(PuglView* view, PuglContextType type); + +/** Create a window with the settings given by the various puglInit functions. @return 1 (pugl does not currently support multiple windows). @@ -285,6 +285,15 @@ PUGL_API PuglHandle puglGetHandle(PuglView* view); /** + Get the drawing context. + + For PUGL_GL contexts, this is unused and returns NULL. + For PUGL_CAIRO contexts, this returns a pointer to a cairo_t. +*/ +PUGL_API void* +puglGetContext(PuglView* view); + +/** Return the timestamp (if any) of the currently-processing event. */ PUGL_API uint32_t |