Context-based graphics library.
All graphics library commands now take a gfx_context_t pointer, which
points to a simple datastructure describing a rendering context (width,
height, depth, total size, front buffer, backbuffer; where backbuffer =
front buffer when not in double-buffering mode, thus we always render to
backbuffer except on a flip). This may have caused a minor speed
reduction, but I don't really care as it's far more important that we
support multiple graphics contexts.
TODO:
- Shared Memory Fonts library (there are a couple of apps that use these
so-called "shmem fonts" on their own; we need a dedicated library for
them)
- Break off "TTK" GUI toolkit into its own library. Since it's just a
callback-based button framework, this shouldn't be too hard right now.
Also, with the previous tick, I'll be able to put labels on controls
and start using text in more places.
2012-04-17 22:21:34 +04:00
|
|
|
#ifndef SHMEMFONTS_H
|
|
|
|
#define SHMEMFONTS_H
|
|
|
|
|
|
|
|
#include "graphics.h"
|
|
|
|
#include "window.h"
|
|
|
|
|
2012-04-17 22:46:46 +04:00
|
|
|
void init_shmemfonts();
|
|
|
|
void draw_string(gfx_context_t * ctx, int x, int y, uint32_t fg, char * string);
|
2012-04-17 22:55:54 +04:00
|
|
|
uint32_t draw_string_width(char * string);
|
2012-10-17 06:05:58 +04:00
|
|
|
void draw_string_shadow(gfx_context_t * ctx, int x, int y, uint32_t fg, char * string, uint32_t shadow_color, int darkness, int offset_x, int offset_y, double radius);
|
2012-09-13 09:10:10 +04:00
|
|
|
void set_font_size(int size);
|
2012-11-19 07:35:17 +04:00
|
|
|
void set_font_face(int face_num);
|
2012-12-13 10:42:48 +04:00
|
|
|
char * shmem_font_name(int i);
|
2012-11-19 07:35:17 +04:00
|
|
|
|
|
|
|
#define FONT_SANS_SERIF 0
|
|
|
|
#define FONT_SANS_SERIF_BOLD 1
|
|
|
|
#define FONT_SANS_SERIF_ITALIC 2
|
|
|
|
#define FONT_SANS_SERIF_BOLD_ITALIC 3
|
|
|
|
#define FONT_MONOSPACE 4
|
|
|
|
#define FONT_MONOSPACE_BOLD 5
|
|
|
|
#define FONT_MONOSPACE_ITALIC 6
|
|
|
|
#define FONT_MONOSPACE_BOLD_ITALIC 7
|
2012-11-19 08:14:57 +04:00
|
|
|
#define FONT_JAPANESE 8
|
2012-11-19 07:35:17 +04:00
|
|
|
|
2012-11-19 08:14:57 +04:00
|
|
|
#define FONTS_TOTAL 9
|
2012-04-17 22:46:46 +04:00
|
|
|
|
Context-based graphics library.
All graphics library commands now take a gfx_context_t pointer, which
points to a simple datastructure describing a rendering context (width,
height, depth, total size, front buffer, backbuffer; where backbuffer =
front buffer when not in double-buffering mode, thus we always render to
backbuffer except on a flip). This may have caused a minor speed
reduction, but I don't really care as it's far more important that we
support multiple graphics contexts.
TODO:
- Shared Memory Fonts library (there are a couple of apps that use these
so-called "shmem fonts" on their own; we need a dedicated library for
them)
- Break off "TTK" GUI toolkit into its own library. Since it's just a
callback-based button framework, this shouldn't be too hard right now.
Also, with the previous tick, I'll be able to put labels on controls
and start using text in more places.
2012-04-17 22:21:34 +04:00
|
|
|
#endif
|