static void context_apply_draw_buffer(struct wined3d_context *context, BOOL blit)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
- IWineD3DSurface *rt = context->current_rt;
+ IWineD3DSurfaceImpl *rt = (IWineD3DSurfaceImpl *)context->current_rt;
IWineD3DDeviceImpl *device;
- device = ((IWineD3DSurfaceImpl *)rt)->resource.device;
- if (!surface_is_offscreen((IWineD3DSurfaceImpl *)rt))
+ device = rt->resource.device;
+ if (!surface_is_offscreen(rt))
{
ENTER_GL();
glDrawBuffer(surface_get_gl_buffer(rt));
ENTER_GL();
context_bind_fbo(context, GL_FRAMEBUFFER, NULL);
- context_set_draw_buffer(context, surface_get_gl_buffer((IWineD3DSurface *)target));
+ context_set_draw_buffer(context, surface_get_gl_buffer(target));
LEAVE_GL();
}
else
context = context_acquire(This, surface, CTXUSAGE_RESOURCELOAD);
ENTER_GL();
context_bind_fbo(context, GL_FRAMEBUFFER, NULL);
- context_set_draw_buffer(context, surface_get_gl_buffer(surface));
+ context_set_draw_buffer(context, surface_get_gl_buffer((IWineD3DSurfaceImpl *)surface));
}
else
{
if (!surface_is_offscreen((IWineD3DSurfaceImpl *)src_surface))
{
- GLenum buffer = surface_get_gl_buffer(src_surface);
+ GLenum buffer = surface_get_gl_buffer((IWineD3DSurfaceImpl *)src_surface);
TRACE("Source surface %p is onscreen\n", src_surface);
/* Attach dst surface to dst fbo */
if (!surface_is_offscreen((IWineD3DSurfaceImpl *)dst_surface))
{
- GLenum buffer = surface_get_gl_buffer(dst_surface);
+ GLenum buffer = surface_get_gl_buffer((IWineD3DSurfaceImpl *)dst_surface);
TRACE("Destination surface %p is onscreen\n", dst_surface);
checkGLcall("set_compatible_renderbuffer");
}
-GLenum surface_get_gl_buffer(IWineD3DSurface *iface)
+GLenum surface_get_gl_buffer(IWineD3DSurfaceImpl *surface)
{
- IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
- IWineD3DSwapChainImpl *swapchain = (IWineD3DSwapChainImpl *)This->container;
+ IWineD3DSwapChainImpl *swapchain = (IWineD3DSwapChainImpl *)surface->container;
- TRACE("iface %p.\n", iface);
+ TRACE("surface %p.\n", surface);
- if (!(This->Flags & SFLAG_SWAPCHAIN))
+ if (!(surface->Flags & SFLAG_SWAPCHAIN))
{
- ERR("Surface %p is not on a swapchain.\n", iface);
+ ERR("Surface %p is not on a swapchain.\n", surface);
return GL_NONE;
}
- if (swapchain->backBuffer && swapchain->backBuffer[0] == iface)
+ if (swapchain->backBuffer && (IWineD3DSurfaceImpl *)swapchain->backBuffer[0] == surface)
{
if (swapchain->render_to_fbo)
{
TRACE("Returning GL_BACK\n");
return GL_BACK;
}
- else if (swapchain->frontBuffer == iface)
+ else if ((IWineD3DSurfaceImpl *)swapchain->frontBuffer == surface)
{
TRACE("Returning GL_FRONT\n");
return GL_FRONT;
else
{
/* Onscreen surfaces are always part of a swapchain */
- GLenum buffer = surface_get_gl_buffer((IWineD3DSurface *)This);
+ GLenum buffer = surface_get_gl_buffer(This);
TRACE("Locking %#x buffer\n", buffer);
glReadBuffer(buffer);
checkGLcall("glReadBuffer");
*/
if (!surface_is_offscreen(This))
{
- GLenum buffer = surface_get_gl_buffer((IWineD3DSurface *)This);
+ GLenum buffer = surface_get_gl_buffer(This);
TRACE("Locking %#x buffer\n", buffer);
ENTER_GL();
if (!surface_is_offscreen(This))
{
- GLenum buffer = surface_get_gl_buffer((IWineD3DSurface *)This);
+ GLenum buffer = surface_get_gl_buffer(This);
TRACE("Unlocking %#x buffer.\n", buffer);
context_set_draw_buffer(context, buffer);
}
}
else
{
- glReadBuffer(surface_get_gl_buffer(SrcSurface));
+ glReadBuffer(surface_get_gl_buffer(Src));
}
checkGLcall("glReadBuffer");
}
else
{
- glReadBuffer(surface_get_gl_buffer(SrcSurface));
+ glReadBuffer(surface_get_gl_buffer(Src));
}
/* TODO: Only back up the part that will be overwritten */
struct wined3d_context *context) DECLSPEC_HIDDEN;
void surface_add_dirty_rect(IWineD3DSurface *iface, const RECT *dirty_rect) DECLSPEC_HIDDEN;
-GLenum surface_get_gl_buffer(IWineD3DSurface *iface) DECLSPEC_HIDDEN;
+GLenum surface_get_gl_buffer(IWineD3DSurfaceImpl *surface) DECLSPEC_HIDDEN;
void surface_load_ds_location(IWineD3DSurfaceImpl *surface,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
void surface_modify_ds_location(IWineD3DSurfaceImpl *surface, DWORD location) DECLSPEC_HIDDEN;