static bool glx_platform_make_current(struct wcore_platform *wc_self, struct wcore_display *wc_dpy, struct wcore_window *wc_window, struct wcore_context *wc_ctx) { return wrapped_glXMakeCurrent(glx_display(wc_dpy)->x11.xlib, wc_window ? glx_window(wc_window)->x11.xcb : 0, wc_ctx ? glx_context(wc_ctx)->glx : NULL); }
bool glx_window_swap_buffers(struct wcore_window *wc_self) { struct glx_window *self = glx_window(wc_self); struct glx_display *dpy = glx_display(wc_self->display); struct glx_platform *plat = glx_platform(wc_self->display->platform); wrapped_glXSwapBuffers(plat, dpy->x11.xlib, self->x11.xcb); return true; }
bool glx_window_destroy(struct wcore_window *wc_self) { struct glx_window *self = glx_window(wc_self); bool ok = true; if (!wc_self) return ok; ok &= x11_window_teardown(&self->x11); ok &= wcore_window_teardown(wc_self); free(self); return ok; }
union waffle_native_window* glx_window_get_native(struct wcore_window *wc_self) { struct glx_window *self = glx_window(wc_self); struct glx_display *dpy = glx_display(wc_self->display); union waffle_native_window *n_window; WCORE_CREATE_NATIVE_UNION(n_window, glx); if (!n_window) return NULL; n_window->glx->xlib_display = dpy->x11.xlib; n_window->glx->xlib_window = self->x11.xcb; return n_window; }
static bool glx_platform_make_current(struct wcore_platform *wc_self, struct wcore_display *wc_dpy, struct wcore_window *wc_window, struct wcore_context *wc_ctx) { struct glx_platform *self = glx_platform(wc_self); Display *dpy = glx_display(wc_dpy)->x11.xlib; GLXDrawable win = wc_window ? glx_window(wc_window)->x11.xcb : 0; GLXContext ctx = wc_ctx ? glx_context(wc_ctx)->glx : NULL; bool ok; ok = wrapped_glXMakeCurrent(self, dpy, win, ctx); if (!ok) { wcore_errorf(WAFFLE_ERROR_UNKNOWN, "glXMakeCurrent failed"); } return ok; }
bool glx_window_show(struct wcore_window *wc_self) { return x11_window_show(&glx_window(wc_self)->x11); }
bool glx_window_resize(struct wcore_window *wc_self, int32_t width, int32_t height) { return x11_window_resize(&glx_window(wc_self)->x11, width, height); }