maug
Quick and dirty C mini-augmentation library.
Loading...
Searching...
No Matches
retroglu.h File Reference

Library of tools for working with RetroFlat and OpenGL. More...

Go to the source code of this file.

Data Structures

struct  RETROGLU_SPRITE_PARMS
 If draw lists are disabled, this struct holds a list of params for retroglu_set_sprite_clip() so that the sprite can be drawn without a list. More...
 
struct  RETROGLU_SPRITE
 
struct  RETROGLU_TILE
 

Macros

#define MAUG_CONST   const
 
#define RETROGLU_TRACE_LVL   0
 
#define RETROGLU_SPRITE_TEX_FRAMES_SZ   10
 
#define glShininessf(side, light, f)
 
#define RETROGLU_SPRITE_X   0
 
#define RETROGLU_SPRITE_Y   1
 
#define RETROGLU_SPRITE_LIST_SZ_MAX   10
 
#define retroglu_enable_lightning()
 
#define retroglu_disable_lightning()
 
#define retroglu_pop_overlay()
 Restore projection modelview previously pushed using retroglu_push().
 
#define retroglu_tex_px_x_to_f(px, sprite)
 
#define retroglu_tex_px_y_to_f(px, sprite)
 
#define retroglu_scr_px_x_to_f(px)
 
#define retroglu_scr_px_y_to_f(py)
 
#define retroglu_set_sprite_tex(sprite, texture_id, bmp_w, bmp_h)
 
#define retroglu_set_sprite_color(sprite, color_in)
 
#define RETROFLAT_COLOR_TABLE_GL(idx, name_l, name_u, r, g, b, cgac, cgad)
 

Typedefs

typedef float RETROGLU_COLOR[4]
 

Functions

void retroglu_set_tile_clip (struct RETROGLU_TILE *tile, uint32_t px, uint32_t py, uint32_t pw, uint32_t ph, uint8_t flags)
 
void retroglu_set_sprite_clip (struct RETROGLU_SPRITE *sprite, uint32_t front_px, uint32_t front_py, uint32_t back_px, uint32_t back_py, uint32_t pw, uint32_t ph, uint8_t flags)
 
void retroglu_init_sprite_vertices (struct RETROGLU_SPRITE *sprite)
 Setup the sprite vertices for the poly the sprite will be drawn on. This should be called once when the sprite is initialized, but calling it again later shouldn't hurt.
 
void retroglu_init_sprite_vertices_scale (struct RETROGLU_SPRITE *sprite, float scale)
 
void retroglu_set_sprite_pos (struct RETROGLU_SPRITE *sprite, uint32_t px, uint32_t py)
 
void retroglu_tsrot_sprite (struct RETROGLU_SPRITE *sprite)
 
void retroglu_draw_sprite (struct RETROGLU_SPRITE *sprite)
 Draw the given sprite. This function never uses a list, and can therefore be used to create a draw list.
 
void retroglu_prerender_sprite (struct RETROGLU_SPRITE *sprite, int list_idx, uint32_t front_px, uint32_t front_py, uint32_t back_px, uint32_t back_py, uint32_t pw, uint32_t ph, uint8_t flags)
 If lists are enabled, prerender the sprite to a list using the given params to retroglu_set_sprite_clip().
 
void retroglu_jitrender_sprite (struct RETROGLU_SPRITE *sprite, int list_idx)
 If lists are enabled, render the sprite list at list_idx. Otherwise, draw the sprite using retroglu_draw_sprite().
 
void retroglu_free_sprite (struct RETROGLU_SPRITE *sprite)
 
MERROR_RETVAL retroglu_init_glyph_tex ()
 
void retroglu_destroy_glyph_tex ()
 
void retroglu_string (float x, float y, float z, const RETROGLU_COLOR color, const char *str, size_t str_sz, const char *font_str, uint8_t flags)
 
MERROR_RETVAL retroglu_check_errors (const char *desc)
 
int retroglu_draw_release (struct RETROFLAT_BITMAP *bmp)
 
MERROR_RETVAL retroglu_blit_bitmap (struct RETROFLAT_BITMAP *target, struct RETROFLAT_BITMAP *src, size_t s_x, size_t s_y, size_t d_x, size_t d_y, size_t w, size_t h, int16_t instance)
 
void retroglu_px (struct RETROFLAT_BITMAP *target, const RETROFLAT_COLOR color_idx, size_t x, size_t y, uint8_t flags)
 

Detailed Description

Library of tools for working with RetroFlat and OpenGL.