Georges Basile Stavracas Neto 647415ec4f libobs-opengl: Factor out GLX winsys
Move the GLX-related code to gl-x11-glx, and introduce gl-nix as
a winsys-agnostic abstraction layer. gl-nix serves as the runtime
selector of which winsys going to be used. Only the X11/GLX winsys
is available now, but later commits will introduce the X11/EGL
winsys as well.

The gl-nix code was originally written by Jason Francis <cycl0ps@tuta.io>
2021-02-01 19:03:14 -03:00

54 lines
1.8 KiB
C

/******************************************************************************
Copyright (C) 2019 by Jason Francis <cycl0ps@tuta.io>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#pragma once
#include "gl-subsystem.h"
struct gl_winsys_vtable {
struct gl_windowinfo *(*windowinfo_create)(
const struct gs_init_data *info);
void (*windowinfo_destroy)(struct gl_windowinfo *info);
struct gl_platform *(*platform_create)(gs_device_t *device,
uint32_t adapter);
void (*platform_destroy)(struct gl_platform *plat);
bool (*platform_init_swapchain)(struct gs_swap_chain *swap);
void (*platform_cleanup_swapchain)(struct gs_swap_chain *swap);
void (*device_enter_context)(gs_device_t *device);
void (*device_leave_context)(gs_device_t *device);
void *(*device_get_device_obj)(gs_device_t *device);
void (*getclientsize)(const struct gs_swap_chain *swap, uint32_t *width,
uint32_t *height);
void (*clear_context)(gs_device_t *device);
void (*update)(gs_device_t *device);
void (*device_load_swapchain)(gs_device_t *device,
gs_swapchain_t *swap);
void (*device_present)(gs_device_t *device);
};