From Freeciv
/* These are window depths, to suggest which should
* be drawn over which others. */
#define DEPTH_MIN 0
#define DEPTH_MAX 100
enum fgl_attribute {
FGL_FPS, /* frames per second */
FGL_FULLSCREEN, /* fullscreen mode or not */
FGL_SWAP_CONTROL, /* vertical refresh synchronization */
FGL_DEBUG_MODE, /* output fgl debug data to terminal */
FGL_EDIT_MODE /* TODO */
};
enum fgl_pattern {
FGL_PATTERN_NONE,
FGL_PATTERN_DASHED
};
typedef unsigned long fgl_color;
typedef GLint fgl_sprite;
struct fgl_feature;
struct fgl_pixmap {
int w, h;
unsigned char *pixels;
};
/* Specify name of theme file */
bool fgl_init(const char *datapath, const char *themefile);
/* TODO. Change theme while playing */
/* void fgl_reinit(const char *theme); */
/* Free stuff and quit. Garbage collect our images. */
void fgl_quit(void);
/* Main loop */
void fgl_main(void);
/* TODO. Save current setup as a new theme */
/* void fgl_save(const char *theme); */
/* A screen may have any number of features. A feature
* can be anything that is specified in the configuration
* file. */
struct fgl_feature *fgl_add_feature(const char *name);
void fgl_remove_feature(const char *name);
/* Various configuration options and hints */
void fgl_set_attribute(enum fgl_attribute, int value);
int fgl_get_attribute(enum fgl_attribute);
/* Load an image into an image buffer. */
struct fgl_pixmap *fgl_new_pixmap(const char *filename);
void fgl_free_pixmap(struct fgl_pixmap *gfx);
/* Create a texture sprite out of an existing image pixmap. The
* sprite will be stored in video memory as one or more power of
* two size textures, padded with fully transparent pixels as
* necessary. */
fgl_sprite fgl_sprite(struct fgl_pixmap *gfx, int x, int y,
int width, int height);
/* Drawing primitives ... unsure about this part of the API still - Per */
void fgl_rectangle(int x1, int y1, int x2, int y2,
fgl_color color, int width, fgl_pattern pattern);
void fgl_line(int x1, int y1, int x2, int y2,
fgl_color color, int width, enum fgl_pattern pattern);
void fgl_pixmap(fgl_point pos, struct fgl_pixmap *gfx);
void fgl_drawing_end_func(void); /* private */