-
Notifications
You must be signed in to change notification settings - Fork 0
/
draw.h
30 lines (27 loc) · 1.33 KB
/
draw.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef DRAW_H
#define DRAW_H
#include "engine.h"
#include "tileset.h"
// API_CALL clear_screen
#define clear_screen() SDL_RenderClear(glob_renderer);
// API_CALL draw_line INT INT INT INT
#define draw_line(x1, y1, x2, y2) SDL_RenderDrawLine(glob_renderer, x1, y1, x2, y2)
// API_CALL draw_point INT INT
#define draw_point(x, y) SDL_RenderDrawPoint(glob_renderer, x, y)
// API_CALL draw_color INT INT INT INT
#define draw_color(r, g, b, a) SDL_SetRenderDrawColor(glob_renderer, r, g, b, a)
// API_CALL draw_rect RECT
#define draw_rect(rect) SDL_RenderDrawRect(glob_renderer, rect)
// API_CALL draw_rect4 INT INT INT INT
#define draw_rect4(x,y,w,h) SDL_RenderDrawRect(glob_renderer, &(SDL_Rect){x, y, w ,h})
// API_CALL draw_fill_rect RECT
#define draw_fill_rect(rect) SDL_RenderFillRect(glob_renderer, rect)
// API_CALL draw_fill_rect4 INT INT INT INT
#define draw_fill_rect4(x,y,w,h) SDL_RenderFillRect(glob_renderer, &(SDL_Rect){x, y, w ,h})
#define draw_clip_rect(rect) SDL_RenderSetClipRect(glob_renderer, rect)
#define draw_clip_null() SDL_RenderSetClipRect(glob_renderer, NULL)
#define draw_clip_rect4(x,y,w,h) SDL_RenderSetClipRect(glob_renderer, &(SDL_Rect){x, y, w,h})
void draw_frame_ex(int x, int y, struct frame *frame, double rotation, int flags);
// API_CALL draw_frame INT INT FRAME
void draw_frame(int x, int y, struct frame *frame);
#endif