diff options
author | David Robillard <d@drobilla.net> | 2020-10-03 19:38:53 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-10-04 12:51:32 +0200 |
commit | cc5c38b1aaf93157f5558df95383491a6163cc5a (patch) | |
tree | a1b858c00ad84a0479b98247f84e608ac0d62866 /pugl/detail/x11.h | |
parent | 6ca124d3787a901129252a2e26c091da1c1ff455 (diff) | |
download | pugl-cc5c38b1aaf93157f5558df95383491a6163cc5a.tar.gz pugl-cc5c38b1aaf93157f5558df95383491a6163cc5a.tar.bz2 pugl-cc5c38b1aaf93157f5558df95383491a6163cc5a.zip |
Add puglGetViewHint()
This allows retrieving properties of the view that may be needed, such as the
actual bit depth (which may vary from the suggested depth provided as a hint).
Diffstat (limited to 'pugl/detail/x11.h')
-rw-r--r-- | pugl/detail/x11.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pugl/detail/x11.h b/pugl/detail/x11.h index cf647ed..4b0109d 100644 --- a/pugl/detail/x11.h +++ b/pugl/detail/x11.h @@ -83,5 +83,10 @@ puglX11StubConfigure(PuglView* view) pat.screen = impl->screen; impl->vi = XGetVisualInfo(impl->display, VisualScreenMask, &pat, &n); + view->hints[PUGL_RED_BITS] = impl->vi->bits_per_rgb; + view->hints[PUGL_GREEN_BITS] = impl->vi->bits_per_rgb; + view->hints[PUGL_BLUE_BITS] = impl->vi->bits_per_rgb; + view->hints[PUGL_ALPHA_BITS] = 0; + return PUGL_SUCCESS; } |