]> git.r.bdr.sh - rbdr/pico-engine/blob - gfx.cpp
first commit
[rbdr/pico-engine] / gfx.cpp
1 #include "stdafx.h"
2
3 /*Draws a rectangular surface (specify only the x and y)*/
4 void Gfx::drawsurface(SDL_Surface *src, int dx, int dy, SDL_Surface *dst)
5 {
6 SDL_Rect dst_rect;
7
8 dst_rect.x = dx; dst_rect.y = dy;
9 SDL_BlitSurface(src, NULL, dst, &dst_rect);
10 }
11
12 /*Draws a rectangular surface from sx,sy of swxsh dimensions to dx, dy*/
13 void Gfx::drawsurface(int sx, int sy, int sw, int sh, SDL_Surface *src,
14 int dx, int dy, SDL_Surface *dst)
15 {
16 SDL_Rect src_rect, dst_rect;
17
18 src_rect.x = sx; src_rect.y = sy;
19 src_rect.w = sw; src_rect.h = sh;
20 dst_rect.x = dx; dst_rect.y = dy;
21 SDL_BlitSurface(src, &src_rect, dst, &dst_rect);
22
23
24 }