(API Change) libobs/graphics: Change gs_create param
(Non-compiling commit: windowless-context branch) Changes API from: --------------------- EXPORT int gs_create(graphics_t **graphics, const char *module, const struct gs_init_data *data); To: --------------------- EXPORT int gs_create(graphics_t **graphics, const char *module, uint32_t adapter); Summary: --------------------- Changes the gs_create function to use an adapter parameter instead of requiring a gs_init_data with window/color/etc information.master
parent
5c9325f3ea
commit
cf9f21e422
|
@ -29,7 +29,7 @@ EXPORT bool device_enum_adapters(
|
|||
bool (*callback)(void *param, const char *name, uint32_t id),
|
||||
void *param);
|
||||
EXPORT const char *device_preprocessor_name(void);
|
||||
EXPORT int device_create(gs_device_t **device, const struct gs_init_data *data);
|
||||
EXPORT int device_create(gs_device_t **device, uint32_t adapter);
|
||||
EXPORT void device_destroy(gs_device_t *device);
|
||||
EXPORT void device_enter_context(gs_device_t *device);
|
||||
EXPORT void device_leave_context(gs_device_t *device);
|
||||
|
|
|
@ -30,8 +30,7 @@ struct gs_exports {
|
|||
bool (*callback)(void*, const char*, uint32_t),
|
||||
void*);
|
||||
const char *(*device_preprocessor_name)(void);
|
||||
int (*device_create)(gs_device_t **device,
|
||||
const struct gs_init_data *data);
|
||||
int (*device_create)(gs_device_t **device, uint32_t adapter);
|
||||
void (*device_destroy)(gs_device_t *device);
|
||||
void (*device_enter_context)(gs_device_t *device);
|
||||
void (*device_leave_context)(gs_device_t *device);
|
||||
|
|
|
@ -139,19 +139,14 @@ static bool graphics_init(struct graphics_subsystem *graphics)
|
|||
return true;
|
||||
}
|
||||
|
||||
int gs_create(graphics_t **pgraphics, const char *module,
|
||||
const struct gs_init_data *data)
|
||||
int gs_create(graphics_t **pgraphics, const char *module, uint32_t adapter)
|
||||
{
|
||||
struct gs_init_data new_data = *data;
|
||||
int errcode = GS_ERROR_FAIL;
|
||||
|
||||
graphics_t *graphics = bzalloc(sizeof(struct graphics_subsystem));
|
||||
pthread_mutex_init_value(&graphics->mutex);
|
||||
pthread_mutex_init_value(&graphics->effect_mutex);
|
||||
|
||||
if (!new_data.num_backbuffers)
|
||||
new_data.num_backbuffers = 1;
|
||||
|
||||
graphics->module = os_dlopen(module);
|
||||
if (!graphics->module) {
|
||||
errcode = GS_ERROR_MODULE_NOT_FOUND;
|
||||
|
@ -162,7 +157,7 @@ int gs_create(graphics_t **pgraphics, const char *module,
|
|||
module))
|
||||
goto error;
|
||||
|
||||
errcode = graphics->exports.device_create(&graphics->device, &new_data);
|
||||
errcode = graphics->exports.device_create(&graphics->device, adapter);
|
||||
if (errcode != GS_SUCCESS)
|
||||
goto error;
|
||||
|
||||
|
|
|
@ -452,7 +452,7 @@ EXPORT void gs_enum_adapters(
|
|||
void *param);
|
||||
|
||||
EXPORT int gs_create(graphics_t **graphics, const char *module,
|
||||
const struct gs_init_data *data);
|
||||
uint32_t adapter);
|
||||
EXPORT void gs_destroy(graphics_t *graphics);
|
||||
|
||||
EXPORT void gs_enter_context(graphics_t *graphics);
|
||||
|
|
Loading…
Reference in New Issue