Commit f7904211 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Make the adapter responsible for creating GL contexts.

parent b722bae9
......@@ -4178,6 +4178,11 @@ static DWORD get_max_gl_version(const struct wined3d_gl_info *gl_info, DWORD fla
return wined3d_settings.max_gl_version;
}
static const struct wined3d_adapter_ops wined3d_adapter_opengl_ops =
{
wined3d_adapter_opengl_create_context,
};
BOOL wined3d_adapter_opengl_init(struct wined3d_adapter *adapter, DWORD wined3d_creation_flags)
{
static const DWORD supported_gl_versions[] =
......@@ -4285,6 +4290,7 @@ BOOL wined3d_adapter_opengl_init(struct wined3d_adapter *adapter, DWORD wined3d_
wined3d_caps_gl_ctx_destroy(&caps_gl_ctx);
wined3d_adapter_init_ffp_attrib_ops(adapter);
adapter->adapter_ops = &wined3d_adapter_opengl_ops;
return TRUE;
}
......@@ -2456,6 +2456,17 @@ HRESULT CDECL wined3d_device_create(struct wined3d *wined3d, UINT adapter_idx, e
return WINED3D_OK;
}
static BOOL wined3d_adapter_no3d_create_context(struct wined3d_context *context,
struct wined3d_texture *target, const struct wined3d_format *ds_format)
{
return TRUE;
}
static const struct wined3d_adapter_ops wined3d_adapter_no3d_ops =
{
wined3d_adapter_no3d_create_context,
};
static BOOL wined3d_adapter_no3d_init(struct wined3d_adapter *adapter)
{
TRACE("adapter %p.\n", adapter);
......@@ -2473,6 +2484,7 @@ static BOOL wined3d_adapter_no3d_init(struct wined3d_adapter *adapter)
adapter->vertex_pipe = &none_vertex_pipe;
adapter->fragment_pipe = &none_fragment_pipe;
adapter->shader_backend = &none_shader_backend;
adapter->adapter_ops = &wined3d_adapter_no3d_ops;
return TRUE;
}
......
......@@ -2653,6 +2653,15 @@ struct wined3d_driver_info
void wined3d_driver_info_init(struct wined3d_driver_info *driver_info,
const struct wined3d_gpu_description *gpu_description, UINT64 vram_bytes) DECLSPEC_HIDDEN;
struct wined3d_adapter_ops
{
BOOL (*adapter_create_context)(struct wined3d_context *context,
struct wined3d_texture *target, const struct wined3d_format *ds_format);
};
BOOL wined3d_adapter_opengl_create_context(struct wined3d_context *context,
struct wined3d_texture *target, const struct wined3d_format *ds_format) DECLSPEC_HIDDEN;
/* The adapter structure */
struct wined3d_adapter
{
......@@ -2673,6 +2682,7 @@ struct wined3d_adapter
const struct wined3d_vertex_pipe_ops *vertex_pipe;
const struct fragment_pipeline *fragment_pipe;
const struct wined3d_shader_backend_ops *shader_backend;
const struct wined3d_adapter_ops *adapter_ops;
};
BOOL wined3d_adapter_opengl_init(struct wined3d_adapter *adapter, DWORD wined3d_creation_flags) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment