wined3d: Get rid of last_device.
This commit is contained in:
parent
401e99b0c0
commit
9253bbcb05
|
@ -29,19 +29,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||||
|
|
||||||
#define GLINFO_LOCATION (*gl_info)
|
#define GLINFO_LOCATION (*gl_info)
|
||||||
|
|
||||||
/* The last used device.
|
|
||||||
*
|
|
||||||
* If the application creates multiple devices and switches between them, ActivateContext has to
|
|
||||||
* change the opengl context. This flag allows to keep track which device is active
|
|
||||||
*/
|
|
||||||
static IWineD3DDeviceImpl *last_device;
|
|
||||||
static DWORD wined3d_context_tls_idx;
|
static DWORD wined3d_context_tls_idx;
|
||||||
|
|
||||||
void context_set_last_device(IWineD3DDeviceImpl *device)
|
|
||||||
{
|
|
||||||
last_device = device;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* FBO helper functions */
|
/* FBO helper functions */
|
||||||
|
|
||||||
/* GL locking is done by the caller */
|
/* GL locking is done by the caller */
|
||||||
|
@ -1193,7 +1182,6 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar
|
||||||
}
|
}
|
||||||
LEAVE_GL();
|
LEAVE_GL();
|
||||||
|
|
||||||
context_set_last_device(This);
|
|
||||||
This->frag_pipe->enable_extension((IWineD3DDevice *) This, TRUE);
|
This->frag_pipe->enable_extension((IWineD3DDevice *) This, TRUE);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1283,8 +1271,6 @@ void DestroyContext(IWineD3DDeviceImpl *This, WineD3DContext *context)
|
||||||
context_destroy_gl_resources(context);
|
context_destroy_gl_resources(context);
|
||||||
destroy = TRUE;
|
destroy = TRUE;
|
||||||
|
|
||||||
context_set_last_device(NULL);
|
|
||||||
|
|
||||||
if (This->activeContext == context)
|
if (This->activeContext == context)
|
||||||
{
|
{
|
||||||
This->activeContext = NULL;
|
This->activeContext = NULL;
|
||||||
|
@ -1840,7 +1826,6 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
This->activeContext = context;
|
This->activeContext = context;
|
||||||
context_set_last_device(This);
|
|
||||||
|
|
||||||
switch (usage) {
|
switch (usage) {
|
||||||
case CTXUSAGE_CLEAR:
|
case CTXUSAGE_CLEAR:
|
||||||
|
|
|
@ -284,7 +284,6 @@ static BOOL WineD3D_CreateFakeGLContext(struct wined3d_fake_gl_ctx *ctx)
|
||||||
ERR_(d3d_caps)("Failed to make fake GL context current.\n");
|
ERR_(d3d_caps)("Failed to make fake GL context current.\n");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
context_set_last_device(NULL);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
|
|
@ -1271,7 +1271,6 @@ void context_attach_depth_stencil_fbo(struct WineD3DContext *context,
|
||||||
GLenum fbo_target, IWineD3DSurface *depth_stencil, BOOL use_render_buffer);
|
GLenum fbo_target, IWineD3DSurface *depth_stencil, BOOL use_render_buffer);
|
||||||
void context_attach_surface_fbo(const struct WineD3DContext *context,
|
void context_attach_surface_fbo(const struct WineD3DContext *context,
|
||||||
GLenum fbo_target, DWORD idx, IWineD3DSurface *surface);
|
GLenum fbo_target, DWORD idx, IWineD3DSurface *surface);
|
||||||
void context_set_last_device(IWineD3DDeviceImpl *device);
|
|
||||||
struct WineD3DContext *context_get_current(void);
|
struct WineD3DContext *context_get_current(void);
|
||||||
DWORD context_get_tls_idx(void);
|
DWORD context_get_tls_idx(void);
|
||||||
BOOL context_set_current(struct WineD3DContext *ctx);
|
BOOL context_set_current(struct WineD3DContext *ctx);
|
||||||
|
|
Loading…
Reference in New Issue