#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
#include <assert.h>
#include "gfxcore.h"
#include "ztimer.h"
#include "misc.h"
#include "sysfont.cpp"
Go to the source code of this file.
Functions | |
void | GFX_Init (Graphics *gfx, Bitmap *bm) |
Initialize a graphics structure. | |
void | GFX_Init (Graphics *gfx, Graphics *gfx2) |
Copy a graphics context structure. | |
void | GFX_SetFont (Graphics *gfx, Font *font) |
Set the current font. | |
void | GFX_SetFillStyle (Graphics *gfx, char *style) |
Set the current fillStyle. | |
void | GFX_SetColor (Graphics *gfx, int color) |
void | GFX_SetBlitMode (Graphics *gfx, int mode) |
void | GFX_MoveTo (Graphics *gfx, int x, int y) |
Set the current position to (x,y). | |
void | GFX_MoveRel (Graphics *gfx, int dx, int dy) |
Move the current position by (dx,dy). | |
void | GFX_HLine (Graphics *gfx, int x, int y, int w) |
Draw a horizontal line. | |
void | GFX_VLine (Graphics *gfx, int x, int y, int h) |
Draw a vertical line. | |
void | GFX_Line (Graphics *gfx, int x1, int y1, int x2, int y2) |
Draw a line using the bresenham algorithm. | |
void | GFX_LineRel (Graphics *gfx, int dx, int dy) |
Draw a line relative from the current position. | |
void | GFX_LineTo (Graphics *gfx, int x, int y) |
Draw a line from the current position to (x,y) and set (x,y) to be the new current position. | |
void | GFX_Rectangle (Graphics *gfx, int x, int y, int w, int h) |
Draws a rectangle with upper left corner at (x,y) and with width w and height h. | |
void | GFX_Circle (Graphics *gfx, int xc, int yc, int r) |
Draw a circle. | |
void | GFX_FillRect (Graphics *gfx, int x, int y, int w, int h) |
Draw a filled rectangle. | |
Variables | |
struct { | |
Bitmap bitmap | |
char bmBits [GFX_SCRATCH_SIZE] | |
} | scratch |
Bitmap * | _gfx_scratch = (Bitmap*)&scratch |
Font * | _gfx_defaultFont = NULL |
char | emptyFill [] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } |
fillStyles | |
char | solidFill [] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } |
char | lineFill [] = { 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 } |
char | ltSlashFill [] = { 0x88, 0x44, 0x22, 0x11, 0x88, 0x44, 0x22, 0x11 } |
char | slashFill [] = { 0x99, 0xcc, 0x66, 0x33, 0x99, 0xcc, 0x66, 0x33 } |
char | bkSlashFill [] = { 0x33, 0x66, 0xcc, 0x99, 0x33, 0x66, 0xcc, 0x99 } |
char | ltBkSlashFill [] = { 0x11, 0x22, 0x44, 0x88, 0x11, 0x22, 0x44, 0x88 } |
char | hatchFill [] = { 0xff, 0x55, 0xff, 0x55, 0xff, 0x55, 0xff, 0x55 } |
char | xHatchFill [] = { 0x55, 0x22, 0x55, 0x88, 0x55, 0x22, 0x55, 0x88 } |
char | xLeaveFill [] = { 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa } |
char | wDotFill [] = { 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44 } |
char | cDotFill [] = { 0x11, 0x44, 0x88, 0x22, 0x11, 0x44, 0x88, 0x22 } |
|
Draw a circle.
Definition at line 416 of file gfxcore.cpp. References Graphics::bitmap, BM_PutPixel(), and Graphics::color. |
|
Draw a filled rectangle.
Definition at line 449 of file gfxcore.cpp. References Graphics::bitmap, Graphics::blitMode, BM_FastBlit(), Bitmap::bmBits, Graphics::fillStyle, Bitmap::height, src, and Bitmap::width. Referenced by GFX_ProgressBar(). |
|
Draw a horizontal line.
Definition at line 150 of file gfxcore.cpp. References Graphics::bitmap, Bitmap::bmBits, Graphics::color, Bitmap::height, and Bitmap::width. Referenced by GFX_Line(), GFX_Rectangle(), and GFX_RoundRect(). |
|
Copy a graphics context structure. This function is quite useful for creating a temporary context inside a drawing function. So You can change drawing modes without modifying the original context. Definition at line 81 of file gfxcore.cpp. Referenced by GFX_ProgressBar(), and gfxTest(). |
|
Initialize a graphics structure. All settings of the graphics contexts are reset to their default values. Definition at line 61 of file gfxcore.cpp. References _font_sysfont, Graphics::bitmap, Graphics::blitMode, BLT_OR, Graphics::color, Graphics::fillStyle, Graphics::font, and solidFill. |
|
Draw a line using the bresenham algorithm.
Definition at line 318 of file gfxcore.cpp. References Graphics::bitmap, BM_PutPixel(), Graphics::color, GFX_HLine(), and GFX_VLine(). Referenced by GFX_LineRel(), GFX_LineTo(), and GFX_RoundRect(). |
|
Draw a line relative from the current position.
Definition at line 366 of file gfxcore.cpp. References GFX_Line(), Graphics::x, and Graphics::y. |
|
Draw a line from the current position to (x,y) and set (x,y) to be the new current position.
Definition at line 381 of file gfxcore.cpp. References GFX_Line(), Graphics::x, and Graphics::y. |
|
Move the current position by (dx,dy).
Definition at line 137 of file gfxcore.cpp. References Graphics::x, and Graphics::y. |
|
Set the current position to (x,y).
Definition at line 126 of file gfxcore.cpp. References Graphics::x, and Graphics::y. |
|
Draws a rectangle with upper left corner at (x,y) and with width w and height h.
Definition at line 398 of file gfxcore.cpp. References GFX_HLine(), and GFX_VLine(). Referenced by GFX_ProgressBar(). |
|
Definition at line 116 of file gfxcore.cpp. References Graphics::blitMode. Referenced by GFX_ProgressBar(). |
|
Definition at line 110 of file gfxcore.cpp. References Graphics::color. |
|
Set the current fillStyle.
Definition at line 104 of file gfxcore.cpp. References Graphics::fillStyle. Referenced by GFX_ProgressBar(). |
|
Set the current font. If font is NULL, the default font is set. Definition at line 92 of file gfxcore.cpp. References _font_sysfont, font, and Graphics::font. Referenced by gfxTest(). |
|
Draw a vertical line.
Definition at line 227 of file gfxcore.cpp. References Graphics::bitmap, Bitmap::bmBits, Graphics::color, fbm, Bitmap::height, lbm, pages, and Bitmap::width. Referenced by GFX_Line(), GFX_Rectangle(), and GFX_RoundRect(). |
|
Definition at line 35 of file gfxcore.cpp. |
|
Definition at line 34 of file gfxcore.cpp. |
|
Definition at line 30 of file gfxcore.cpp. |
|
Definition at line 44 of file gfxcore.cpp. |
|
Definition at line 31 of file gfxcore.cpp. Referenced by printScratch(). |
|
Definition at line 50 of file gfxcore.cpp. |
|
fillStyles
Definition at line 39 of file gfxcore.cpp. |
|
Definition at line 46 of file gfxcore.cpp. |
|
Definition at line 41 of file gfxcore.cpp. |
|
Definition at line 45 of file gfxcore.cpp. |
|
Definition at line 42 of file gfxcore.cpp. |
|
|
|
Definition at line 43 of file gfxcore.cpp. |
|
Definition at line 40 of file gfxcore.cpp. Referenced by GFX_Init(). |
|
Definition at line 49 of file gfxcore.cpp. |
|
Definition at line 47 of file gfxcore.cpp. |
|
Definition at line 48 of file gfxcore.cpp. |