added license GPL
[winnie] / src / gfx.h
1 /*
2 winnie - an experimental window system
3
4 Copyright (C) 2013 Eleni Maria Stea
5
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
19 Author: Eleni Maria Stea <elene.mst@gmail.com>
20 */
21
22 #ifndef GFX_H_
23 #define GFX_H_
24
25 #include "geom.h"
26 #include "pixmap.h"
27
28 bool init_gfx();
29 void destroy_gfx();
30
31 unsigned char *get_framebuffer();
32 Pixmap *get_framebuffer_pixmap();
33
34 Rect get_screen_size();
35 int get_color_depth();
36
37 void set_clipping_rect(const Rect &clip_rect);
38 const Rect &get_clipping_rect();
39
40 void clear_screen(int r, int g, int b);
41 void fill_rect(const Rect &rect, int r, int g, int b);
42
43 void set_cursor_visibility(bool visible);
44
45 void blit(unsigned char *src_img, const Rect &src_rect, unsigned char* dest_img,
46                 const Rect &dest_rect, int dest_x, int dest_y);
47
48 void blit_key(unsigned char *src_img, const Rect &src_rect, unsigned char* dest_img,
49                 const Rect &dest_rect, int dest_x, int dest_y, int key_r, int key_g, int key_b);
50
51 void gfx_update(const Rect &rect);
52
53 void wait_vsync(); // vertical synchronization
54
55 void get_rgb_order(int *r, int *g, int *b);
56
57 #endif //GFX_H_