1 |
5 |
maiden |
/*
|
2 |
|
|
Enhanced Bare metal OpenCores GFX IP driver for Wishbone bus.
|
3 |
|
|
|
4 |
|
|
This driver provides more functionality than orgfx.h
|
5 |
|
|
|
6 |
|
|
Anton Fosselius, Per Lenander 2012
|
7 |
|
|
*/
|
8 |
|
|
|
9 |
|
|
#ifndef ORGFX_PLUS_H
|
10 |
|
|
#define ORGFX_PLUS_H
|
11 |
|
|
|
12 |
|
|
// Initialize gfx (use this instead of the orgfx version). Return value is the screen id, use it in bind render target
|
13 |
|
|
int orgfxplus_init(unsigned int width, unsigned int height, unsigned char bpp, unsigned char doubleBuffering, unsigned char zbuffer);
|
14 |
|
|
|
15 |
|
|
// Loads an image into a surface
|
16 |
|
|
int orgfxplus_init_surface(unsigned int width, unsigned int height, unsigned int mem[]);
|
17 |
|
|
void orgfxplus_bind_rendertarget(int surface);
|
18 |
|
|
void orgfxplus_bind_tex0(int surface);
|
19 |
|
|
|
20 |
|
|
// Swap active frame buffers
|
21 |
|
|
void orgfxplus_flip();
|
22 |
|
|
|
23 |
|
|
// Set the clip rect. Nothing outside this area will be rendered. This is reset every time you change render target
|
24 |
|
|
inline void orgfxplus_clip(unsigned int x0, unsigned int y0, unsigned int x1, unsigned int y1, unsigned int enable);
|
25 |
|
|
|
26 |
|
|
// Fill an area with a color
|
27 |
|
|
void orgfxplus_fill(int x0, int y0, int x1, int y1, unsigned int color);
|
28 |
|
|
|
29 |
|
|
// Draw a line with a color
|
30 |
|
|
void orgfxplus_line(int x0, int y0, int x1, int y1, unsigned int color);
|
31 |
|
|
|
32 |
|
|
// Draw a triangle with a color
|
33 |
|
|
void orgfxplus_triangle(int x0, int y0, int x1, int y1, int x2, int y2, unsigned int color);
|
34 |
|
|
|
35 |
|
|
// Bezier curve
|
36 |
|
|
void orgfxplus_curve(int x0, int y0, int x1, int y1, int x2, int y2, unsigned int inside, unsigned int color);
|
37 |
|
|
|
38 |
|
|
// Draw a surface to the current render target
|
39 |
|
|
void orgfxplus_draw_surface(int x0, int y0, unsigned int surface);
|
40 |
|
|
// Draw a section of a surface (between scrx0,srcy0 and srcx1,srcy1) to the current render target
|
41 |
|
|
void orgfxplus_draw_surface_section(int x0, int y0, unsigned int srcx0, unsigned int srcy0, unsigned int srcx1, unsigned int srcy1, unsigned int surface);
|
42 |
|
|
|
43 |
|
|
// set the colorkey and enable colorkey
|
44 |
|
|
inline void orgfxplus_colorkey(unsigned int colorkey, unsigned int enable);
|
45 |
|
|
|
46 |
|
|
// set the alpha value
|
47 |
|
|
inline void orgfxplus_alpha(unsigned int alpha, unsigned int enable);
|
48 |
|
|
|
49 |
|
|
#endif
|
50 |
|
|
|