SourceForge.net Logo

Rendering commands

These are the commands that render characters to a GL render target. More...


Detailed Description

These are the commands that render characters to a GL render target.

Those commands gather glyph datas according to the parameters that has been set in the state machine of GLC, and issue GL commands to render the characters layout to the GL render target.

When it renders a character, GLC finds a font that maps the character code to a character such as LATIN CAPITAL LETTER A, then uses one or more glyphs from the font to create a graphical layout that represents the character. Finally, GLC issues a sequence of GL commands to draw the layout. Glyph coordinates are defined in EM units and are transformed during rendering to produce the desired mapping of the glyph shape into the GL window coordinate system.

If GLC cannot find a font that maps the character code in the list GLC_CURRENT_FONT_LIST, it attemps to produce an alternate rendering. If the value of the boolean variable GLC_AUTO_FONT is set to GL_TRUE, GLC searches for a font that has the character that maps the character code. If the search succeeds, the font's ID is appended to GLC_CURRENT_FONT_LIST and the character is rendered.

If there are fonts in the list GLC_CURRENT_FONT_LIST, but a match for the character code cannot be found in any of those fonts, GLC goes through these steps :

  1. If the value of the variable GLC_REPLACEMENT_CODE is nonzero, GLC finds a font that maps the replacement code, and renders the character that the replacement code is mapped to.
  2. If the variable GLC_REPLACEMENT_CODE is zero, or if the replacement code does not result in a match, GLC checks whether a callback function is defined. If a callback function is defined for GLC_OP_glcUnmappedCode, GLC calls the function. The callback function provides the character code to the user and allows loading of the appropriate font. After the callback returns, GLC tries to render the character code again.
  3. Otherwise, the command attemps to render the character sequence \<hexcode>, where \ is the character REVERSE SOLIDUS (U+5C), < is the character LESS-THAN SIGN (U+3C), > is the character GREATER-THAN SIGN (U+3E), and hexcode is the character code represented as a sequence of hexadecimal digits. The sequence has no leading zeros, and alphabetic digits are in upper case. The GLC measurement commands treat the sequence as a single character.

The rendering commands raise GLC_PARAMETER_ERROR if the callback function defined for GLC_OP_glcUnmappedCode is called and the current string type is GLC_UTF8_QSO.

Some rendering commands create and/or use display lists and/or textures. The IDs of those display lists and textures are stored in the current GLC context but the display lists and the textures themselves are managed by the current GL context. In order not to impact the performance of error-free programs, QuesoGLC does not check if the current GL context is the same than the one where the display lists and the textures were actually created. If the current GL context has changed meanwhile, the result of commands that refer to the corresponding display lists or textures is undefined.
As a reminder, the render commands may issue GL commands, hence a GL context must be bound to the current thread such that the GLC commands produce the desired result. It is the responsibility of the GLC client to set up the underlying GL implementation.

Function Documentation

void glcRenderChar ( GLint  inCode  ) 

This command renders the character that inCode is mapped to.

inCode The character to render
See also:





void glcRenderCountedString ( GLint  inCount,
const GLCchar *  inString 

This command is identical to the command glcRenderChar(), except that it renders a string of characters.

The string comprises the first inCount elements of the array inString, which need not be followed by a zero element.

The command raises GLC_PARAMETER_ERROR if inCount is less than zero.

inCount The number of elements in the string to be rendered
inString The array of characters from which to render inCount elements.
See also:


void glcRenderString ( const GLCchar *  inString  ) 

This command is identical to the command glcRenderCountedString(), except that inString is zero terminated, not counted.

inString A zero-terminated string of characters.
See also:


void glcRenderStyle ( GLCenum  inStyle  ) 

This command assigns the value inStyle to the variable GLC_RENDER_STYLE.

Legal values for inStyle are defined in the table below :

Rendering styles
Name Enumerant
GLC_LINE 0x0101
inStyle The value to assign to the variable GLC_RENDER_STYLE.
See also:
glcGeti() with argument GLC_RENDER_STYLE

void glcReplacementCode ( GLint  inCode  ) 

This command assigns the value inCode to the variable GLC_REPLACEMENT_CODE.

The replacement code is the code which is used whenever glcRenderChar() can not find a font that owns a character which the parameter inCode of glcRenderChar() maps to.

inCode An integer to assign to GLC_REPLACEMENT_CODE.
See also:
glcGeti() with argument GLC_REPLACEMENT_CODE


void glcResolution ( GLfloat  inVal  ) 

This command assigns the value inVal to the variable GLC_RESOLUTION.

It is used to compute the size of characters in pixels from the size in points.

The resolution is given in dpi (dots per inch). If inVal is zero, the resolution defaults to 72 dpi.

inVal A floating point number to be used as resolution.
See also:
glcGeti() with argument GLC_RESOLUTION

Valid HTML 4.01!
Valid CSS!

Generated on Sat Jan 20 20:11:49 2007 for QuesoGLC by doxygen 1.4.7 written by Dimitri van Heesch © 1997-2005