NXEngine v1.0.0.5
[NXEngine.git] / graphics / graphics.h
blob6c1404d1da669a4353ed9dc432a2bb0f848e5838
2 #ifndef _GRAPHICS_H
3 #define _GRAPHICS_H
5 #include "nxsurface.h"
6 // (unscaled) screen size/video mode
7 #define SCREEN_WIDTH 320
8 #define SCREEN_HEIGHT 240
10 extern NXSurface *screen;
11 extern const NXColor DK_BLUE;
12 extern const NXColor BLACK;
13 extern const NXColor CLEAR;
14 extern bool use_palette;
16 namespace Graphics
18 bool init(int resolution);
19 void close();
21 bool InitVideo();
22 void SetFullscreen(bool enable);
23 bool SetResolution(int factor, bool restoreOnFailure=true);
24 const char **GetResolutions();
25 bool FlushAll();
27 // ---------------------------------------
29 void CopySpriteToTile(int spr, int tileno, int offset_x, int offset_y);
30 void ShowLoadingScreen();
32 void BlitSurface(NXSurface *src, NXRect *srcrect, NXSurface *dst, NXRect *dstrect);
34 // these are all just convenience wrappers around the equivalent
35 // NXSurface member functions, most of which are set to target the screen.
36 void DrawSurface(NXSurface *src, int x, int y);
37 void DrawSurface(NXSurface *src, int dstx, int dsty, int srcx, int srcy, int wd, int ht);
39 void BlitPatternAcross(NXSurface *sfc, int x_dst, int y_dst, int y_src, int height);
42 void ClearScreen(NXColor color);
43 void ClearScreen(uint8_t r, uint8_t g, uint8_t b);
46 void DrawRect(int x1, int y1, int x2, int y2, NXColor color);
47 void FillRect(int x1, int y1, int x2, int y2, NXColor color);
48 void DrawPixel(int x, int y, NXColor color);
50 void DrawRect(int x1, int y1, int x2, int y2, uint8_t r, uint8_t g, uint8_t b);
51 void FillRect(int x1, int y1, int x2, int y2, uint8_t r, uint8_t g, uint8_t b);
52 void DrawPixel(int x, int y, uint8_t r, uint8_t g, uint8_t b);
54 void set_clip_rect(int x, int y, int w, int h);
55 void set_clip_rect(NXRect *rect);
56 void clear_clip_rect();
58 void SetDrawTarget(NXSurface *surface);
61 #endif