Merged
This commit is contained in:
commit
8cf62ac298
121 changed files with 579 additions and 22715 deletions
|
@ -1739,11 +1739,13 @@ int SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh)
|
|||
|
||||
CHECK_TEXTURE_MAGIC(texture, -1);
|
||||
renderer = texture->renderer;
|
||||
if (renderer && renderer->GL_BindTexture) {
|
||||
if (texture->native) {
|
||||
return SDL_GL_BindTexture(texture->native, texw, texh);
|
||||
} else if (renderer && renderer->GL_BindTexture) {
|
||||
return renderer->GL_BindTexture(renderer, texture, texw, texh);
|
||||
} else {
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
int SDL_GL_UnbindTexture(SDL_Texture *texture)
|
||||
|
|
|
@ -118,6 +118,7 @@ SW_ActivateRenderer(SDL_Renderer * renderer)
|
|||
renderer->viewport.h = surface->h;
|
||||
|
||||
SW_UpdateViewport(renderer);
|
||||
SW_UpdateClipRect(renderer);
|
||||
}
|
||||
}
|
||||
return data->surface;
|
||||
|
@ -346,13 +347,16 @@ SW_UpdateViewport(SDL_Renderer * renderer)
|
|||
static int
|
||||
SW_UpdateClipRect(SDL_Renderer * renderer)
|
||||
{
|
||||
SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
|
||||
SDL_Surface *surface = data->surface;
|
||||
const SDL_Rect *rect = &renderer->clip_rect;
|
||||
SDL_Surface* framebuffer = (SDL_Surface *) renderer->driverdata;
|
||||
|
||||
if (!SDL_RectEmpty(rect)) {
|
||||
SDL_SetClipRect(framebuffer, rect);
|
||||
} else {
|
||||
SDL_SetClipRect(framebuffer, NULL);
|
||||
if (surface) {
|
||||
if (!SDL_RectEmpty(rect)) {
|
||||
SDL_SetClipRect(surface, rect);
|
||||
} else {
|
||||
SDL_SetClipRect(surface, NULL);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue