{
SDL_UpdateTexture(sdl_texture, NULL, screen->pixels, screen->pitch);
}
+
+ // clear render target buffer
SDL_RenderClear(sdl_renderer);
+
+ // copy backbuffer to render target buffer
SDL_RenderCopy(sdl_renderer, sdl_texture, NULL, NULL);
+
+ // copy global animations to render target buffer, if defined
+ if (gfx.draw_global_anim_function != NULL)
+ gfx.draw_global_anim_function();
+
+ // show render target buffer on screen
SDL_RenderPresent(sdl_renderer);
+
#else
+
if (rect)
SDL_UpdateWindowSurfaceRects(sdl_window, rect, 1);
else
#endif
}
+void SDLBlitTexture(Bitmap *bitmap,
+ int src_x, int src_y, int width, int height,
+ int dst_x, int dst_y, int mask_mode)
+{
+#if defined(TARGET_SDL2)
+#if USE_RENDERER
+ SDL_Texture *texture;
+ SDL_Rect src_rect;
+ SDL_Rect dst_rect;
+
+ texture =
+ (mask_mode == BLIT_MASKED ? bitmap->texture_masked : bitmap->texture);
+
+ if (texture == NULL)
+ return;
+
+ src_rect.x = src_x;
+ src_rect.y = src_y;
+ src_rect.w = width;
+ src_rect.h = height;
+
+ dst_rect.x = dst_x;
+ dst_rect.y = dst_y;
+ dst_rect.w = width;
+ dst_rect.h = height;
+
+ SDL_RenderCopy(sdl_renderer, texture, &src_rect, &dst_rect);
+#endif
+#endif
+}
+
void SDLFillRectangle(Bitmap *dst_bitmap, int x, int y, int width, int height,
Uint32 color)
{
void SDLCreateBitmapContent(Bitmap *, int, int, int);
void SDLFreeBitmapPointers(Bitmap *);
void SDLCopyArea(Bitmap *, Bitmap *, int, int, int, int, int, int, int);
+void SDLBlitTexture(Bitmap *, int, int, int, int, int, int, int);
void SDLFillRectangle(Bitmap *, int, int, int, int, Uint32);
void SDLFadeRectangle(Bitmap *, int, int, int, int, int, int, int,
void (*draw_border_function)(void));
dst_x, dst_y);
}
+void BlitTexture(Bitmap *bitmap,
+ int src_x, int src_y, int width, int height,
+ int dst_x, int dst_y)
+{
+ if (bitmap == NULL)
+ return;
+
+ SDLBlitTexture(bitmap, src_x, src_y, width, height, dst_x, dst_y,
+ BLIT_OPAQUE);
+}
+
+void BlitTextureMasked(Bitmap *bitmap,
+ int src_x, int src_y, int width, int height,
+ int dst_x, int dst_y)
+{
+ if (bitmap == NULL)
+ return;
+
+ SDLBlitTexture(bitmap, src_x, src_y, width, height, dst_x, dst_y,
+ BLIT_MASKED);
+}
+
void DrawSimpleBlackLine(Bitmap *bitmap, int from_x, int from_y,
int to_x, int to_y)
{
boolean DrawingOnBackground(int, int);
boolean DrawingAreaChanged();
void BlitBitmapOnBackground(Bitmap *, Bitmap *, int, int, int, int, int, int);
+void BlitTexture(Bitmap *, int, int, int, int, int, int);
+void BlitTextureMasked(Bitmap *, int, int, int, int, int, int);
void DrawSimpleBlackLine(Bitmap *, int, int, int, int);
void DrawSimpleWhiteLine(Bitmap *, int, int, int, int);
void DrawLines(Bitmap *, struct XY *, int, Pixel);