diff options
Diffstat (limited to 'src/x11.c')
-rw-r--r-- | src/x11.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -1451,3 +1451,23 @@ puglSetCursor(PuglView* const view, const PuglCursor cursor) return PUGL_FAILURE; #endif } + +// Semi-public platform API used by backends + +PuglStatus +puglX11Configure(PuglView* view) +{ + PuglInternals* const impl = view->impl; + XVisualInfo pat = {0}; + int n = 0; + + 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; +} |