#include "sio2.h"

Functions | |
| SIO2font * | sio2FontInit (const char *_name) |
| SIO2font * | sio2FontFree (SIO2font *_SIO2font) |
| void | sio2FontCreate (SIO2font *_SIO2font, SIO2material *_SIO2material, unsigned char _n_char, unsigned char _c_offset, float _size, float _space) |
| void | sio2FontBuild (SIO2font *_SIO2font) |
| unsigned char | sio2FontPrint (SIO2font *_SIO2font, unsigned char _matrixtype, const char *_fmt,...) |
| void | sio2FontReset (void) |
| void sio2FontBuild | ( | SIO2font * | _SIO2font | ) |
Calculate the map that should be used for rendering the SIO2font. This function will build vertex data and texture data to be able to render the SIO2font based on the ASCII characters that are passed to the sio2FontRender function. In addition this function should be called once for every SIO2font that you create.
_SIO2font: A valid SIO2font pointer.
References SIO2material::_SIO2image, SIO2font::_SIO2material, SIO2font::boffset, SIO2image::height, SIO2font::n_char, SIO2_MATERIAL_CHANNEL0, sio2FontReset(), SIO2font::size, SIO2font::vbo, and SIO2image::width.
Referenced by sio2FontCreate().

| void sio2FontCreate | ( | SIO2font * | _SIO2font, | |
| SIO2material * | _SIO2material, | |||
| unsigned char | _n_char, | |||
| unsigned char | _c_offset, | |||
| float | _size, | |||
| float | _space | |||
| ) |
This is a help function that allows you to create an SIO2font. The function gather all the necessary information to generate a ready to use SIO2font.
_SIO2font: A valid SIO2font pointer.
_SIO2material: A valid SIO2material pointer, that contains the font texture on the first channel of the material.
_n_char: Number of characters per row that are held in the font texture.
_c_offset: The first ASCII value that should offset all the rest of the characters.
_size: The width and heigh of every cell, every cell representing one character.
_space: The number of space in pixels that should be used between each characters when they get printed on screen.
References SIO2font::_SIO2material, SIO2font::c_offset, SIO2font::n_char, sio2FontBuild(), SIO2font::size, and SIO2font::space.

Free a previously initialized SIO2font structure from the memory. The SIO2font will be removed from the global sio2 SIO2resource handle.
_SIO2font: The SIO2font handle to remove.
return a NULL SIO2font pointer.
References SIO2::_SIO2resource, sio2, SIO2_FONT, sio2ResourceDel(), and SIO2font::vbo.
Referenced by sio2ResourceUnload().

Initialize a new SIO2font structure. This new SIO2font will be added to the global sio2 SIO2resource handle.
_name: The name to use for the new SIO2font.
return a new SIO2font structure pointer.
References SIO2::_SIO2resource, SIO2font::_SIO2transform, SIO2font::name, sio2, SIO2_FONT, sio2ResourceAdd(), sio2StringCpy(), and sio2TransformLoadIdentity().

| unsigned char sio2FontPrint | ( | SIO2font * | _SIO2font, | |
| unsigned char | _matrixtype, | |||
| const char * | _fmt, | |||
| ... | ||||
| ) |
Render a previous initialized SIO2font on screen. Depending on the mode that you are using the font can be either render in 2D or 3D. The SIO2transform information should be updated accordingly depending on the way you are rendering it.
_SIO2font: A valid SIO2font pointer.
_matrixtype: The type of SIO2transform function that should be used when rendering the SIO2font it can be one of the two following values:
SIO2_TRANSFORM_MATRIX_BIND
SIO2_TRANSFORM_MATRIX_APPLY
_fmt: A valid C format. (similar as printf).
...: The trailing variables to be analyzed by the format (_fmt).
return the number of lines (determined by the ASCII #13) that was printed on screen.
References SIO2::_SIO2font, SIO2font::_SIO2material, SIO2::_SIO2state, SIO2font::_SIO2transform, SIO2font::boffset, SIO2font::c_offset, SIO2font::line, sio2, SIO2_BUFFER_OFFSET, SIO2_MAX_PATH, SIO2_TEXTURE_COORD_ARRAY0, SIO2_TRANSFORM_MATRIX_APPLY, SIO2_TRANSFORM_MATRIX_BIND, sio2MaterialRender(), sio2StateEnable(), sio2StringLen(), sio2TransformApply(), sio2TransformRender(), SIO2font::size, SIO2font::space, and SIO2font::vbo.

| void sio2FontReset | ( | void | ) |
Reset the OpenGL and SIO2 state that was used to render the SIO2font.
References SIO2::_SIO2font, and sio2.
Referenced by sio2FontBuild().
1.5.6