ASCII-GFX
2.0
|
#include <ncurses.h>
#include <math.h>
#include <ctype.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include "math2d.h"
#include "util.h"
Go to the source code of this file.
Functions | |
void | init_gfx () |
init ASCII GFX More... | |
void | init_color () |
init ASCII GFX color display More... | |
void | exit_gfx () |
exit ASCII GFX More... | |
void | set_window (WINDOW *w) |
set the drawing window More... | |
void | use_color (int index=1) |
use indexed color pair for foreground/background colors of characters More... | |
void | use_attr_bold () |
use attribute bold More... | |
void | use_attr_blink () |
use attribute blink More... | |
void | use_attr_reverse () |
use attribute reverse More... | |
void | use_attr_normal () |
use attribute normal More... | |
void | draw_text (int y, int x, const char *format,...) |
draw a formatted text at position (x, y) More... | |
void | draw_sprite (int y, int x, const char *text) |
draw a sprite at barycenter position (x, y) More... | |
void | draw_area (int y, int x, int sy, int sx, const int *data) |
draw a screen area at top-left position (x, y) with size (sx, sy) More... | |
void | draw_grid_text (int y, int x, const char *text) |
draw a text string with grid font characters at top-left position (x, y) More... | |
void | draw_line (int y1, int x1, int y2, int x2, int ch=-1, bool background=false) |
draw a line from position (x1, y1) to (x2, y2) More... | |
void | draw_frame (int y1, int x1, int y2, int x2, int ch=-1) |
draw a frame from position (y1, x1) to (y2, x2) More... | |
void | draw_circle (int yc, int xc, int r, int ch=-1, double aspect=2) |
draw a circle at center position (xc, yc) with radius r More... | |
void | draw_ellipse (int yc, int xc, int ay, int ax, int ch=-1, double aspect=2) |
draw a ellipse at center position (xc, yc) with principle axis ax and ay More... | |
int | peek (int y, int x) |
peek at location (y, x) and return the displayed character More... | |
int | get_keycode () |
return wide keycode More... | |
void | cursor_keycode (int keycode, int *dx, unsigned int *dy) |
decode wide keycode More... | |
int * | convert_char_text (const char *text, int sx, int sy, int ch=-1, bool interprete=false) |
helper for converting a text string into an ASCII data buffer More... | |
char * | get_string_buffer (int n) |
helper for allocating a temporarily used string buffer More... | |
int* convert_char_text | ( | const char * | text, |
int | sx, | ||
int | sy, | ||
int | ch = -1 , |
||
bool | interprete = false |
||
) |
helper for converting a text string into an ASCII data buffer
void cursor_keycode | ( | int | keycode, |
int * | dx, | ||
unsigned int * | dy | ||
) |
decode wide keycode
void draw_area | ( | int | y, |
int | x, | ||
int | sy, | ||
int | sx, | ||
const int * | data | ||
) |
draw a screen area at top-left position (x, y) with size (sx, sy)
void draw_circle | ( | int | yc, |
int | xc, | ||
int | r, | ||
int | ch = -1 , |
||
double | aspect = 2 |
||
) |
draw a circle at center position (xc, yc) with radius r
void draw_ellipse | ( | int | yc, |
int | xc, | ||
int | ay, | ||
int | ax, | ||
int | ch = -1 , |
||
double | aspect = 2 |
||
) |
draw a ellipse at center position (xc, yc) with principle axis ax and ay
void draw_frame | ( | int | y1, |
int | x1, | ||
int | y2, | ||
int | x2, | ||
int | ch = -1 |
||
) |
draw a frame from position (y1, x1) to (y2, x2)
void draw_grid_text | ( | int | y, |
int | x, | ||
const char * | text | ||
) |
draw a text string with grid font characters at top-left position (x, y)
void draw_line | ( | int | y1, |
int | x1, | ||
int | y2, | ||
int | x2, | ||
int | ch = -1 , |
||
bool | background = false |
||
) |
draw a line from position (x1, y1) to (x2, y2)
void draw_sprite | ( | int | y, |
int | x, | ||
const char * | text | ||
) |
draw a sprite at barycenter position (x, y)
void draw_text | ( | int | y, |
int | x, | ||
const char * | format, | ||
... | |||
) |
draw a formatted text at position (x, y)
void exit_gfx | ( | ) |
exit ASCII GFX
int get_keycode | ( | ) |
return wide keycode
char* get_string_buffer | ( | int | n | ) |
helper for allocating a temporarily used string buffer
void init_color | ( | ) |
init ASCII GFX color display
void init_gfx | ( | ) |
init ASCII GFX
int peek | ( | int | y, |
int | x | ||
) |
peek at location (y, x) and return the displayed character
void set_window | ( | WINDOW * | w | ) |
set the drawing window
void use_attr_blink | ( | ) |
use attribute blink
void use_attr_bold | ( | ) |
use attribute bold
void use_attr_normal | ( | ) |
use attribute normal
void use_attr_reverse | ( | ) |
use attribute reverse
void use_color | ( | int | index = 1 | ) |
use indexed color pair for foreground/background colors of characters