-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDGLGFX.H
More file actions
executable file
·52 lines (37 loc) · 1.14 KB
/
DGLGFX.H
File metadata and controls
executable file
·52 lines (37 loc) · 1.14 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef LIBDGL_DGLGFX_H
#define LIBDGL_DGLGFX_H
#include "dglcmn.h"
#include "dglrect.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
int width;
int height;
uint8 *pixels;
RECT clip_region;
uint32 flags;
} SURFACE;
#define SURFACE_FLAGS_ALIASED BIT_0
extern SURFACE *screen;
bool gfx_init(void);
bool gfx_shutdown(void);
bool gfx_is_initialized(void);
void wait_vsync(void);
SURFACE* surface_create(int width, int height);
void surface_free(SURFACE *surface);
void surface_clear(SURFACE *surface, uint8 color);
void surface_copy(const SURFACE *src, SURFACE *dest);
static int32 surface_offset(const SURFACE *surface, int x, int y);
static uint8* surface_pointer(const SURFACE *surface, int x, int y);
// --------------------------------------------------------------------------
static int32 surface_offset(const SURFACE *surface, int x, int y) {
return (surface->width * y) + x;
}
static uint8* surface_pointer(const SURFACE *surface, int x, int y) {
return surface->pixels + surface_offset(surface, x, y);
}
#ifdef __cplusplus
}
#endif
#endif