Skip to content
Snippets Groups Projects
Select Git revision
  • e2b4d48ab49fb64ddb718c97850e0e9df2d00d94
  • master default protected
  • fix_Makefile.mingw#2
  • update_Makefile.mingw
  • fix_Makefile.mingw
  • fix_API_for_C_apps
  • fix_procinfo_mac
  • boinccmd_gpu_mode_always_until_sigterm
  • fgrp_osx_hotfix
  • fix_boinc_master@f8250782
  • eah_wrapper_improvements
  • diagnostics_win-hotfix
  • diagnostics_win-hotfix-old
  • current_fgrp_apps
  • testing_gw_apps
  • gw_app_darwin_15
  • current_brp_apps
  • current_brp_apps_android10
  • current_gfx_apps
  • current_server
  • current_gw_apps
  • previous_fgrp_apps
  • previous_gw_apps
  • testing_brp_apps
  • apps_FGRP3_1.07
  • apps_FGRP3_1.08
26 results

texfont.h

Blame
  • user avatar
    Charlie Fenton authored
    svn path=/trunk/boinc/; revision=9956
    a2d544d4
    History
    texfont.h 1.82 KiB
    // Copyright (c) Mark J. Kilgard, 1997. 
    // This program is freely distributable without licensing fees  and is
    // provided without guarantee or warrantee expressed or  implied. 
    // This program is -not- in the public domain. 
    
    #ifndef __TEXFONT_H__
    #define __TEXFONT_H__
    
    #include "boinc_gl.h"
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    #define TXF_FORMAT_BYTE		0
    #define TXF_FORMAT_BITMAP	1
    
    #define TXF_NUM_FONT	   28
    
    extern const char *font_names [];
    
    
    typedef struct {
    	unsigned short c;       // Potentially support 16-bit glyphs. 
    	unsigned char width;
    	unsigned char height;
    	signed char xoffset;
    	signed char yoffset;
    	signed char advance;
    	char dummy;             // Space holder for alignment reasons.
    	short x;
    	short y;
    } TexGlyphInfo;
    
    
    typedef struct {
    	GLfloat t0[2];
    	GLshort v0[2];
    	GLfloat t1[2];
    	GLshort v1[2];
    	GLfloat t2[2];
    	GLshort v2[2];
    	GLfloat t3[2];
    	GLshort v3[2];
    	GLfloat advance;
    } TexGlyphVertexInfo;
    
    
    typedef struct {
    	GLuint texobj;
    	int tex_width;
    	int tex_height;
    	int max_ascent;
    	int max_descent;
    	int num_glyphs;
    	int min_glyph;
    	int range;
    	unsigned char *teximage;
    	TexGlyphInfo *tgi;
    	TexGlyphVertexInfo *tgvi;
    	TexGlyphVertexInfo **lut;
    } TexFont;
    
    extern char *txfErrorString(void);
    
    extern TexFont *txfLoadFont(const char *filename);
    
    extern void txfUnloadFont(TexFont * txf);
    
    extern GLuint CreateTexFont(
    	TexFont * txf,
    	GLuint texobj,
    	GLboolean setupMipmaps);
    
    extern void txfBindFontTexture(TexFont * txf);
    
    extern void txfGetStringMetrics(
    	TexFont * txf,
    	char *string,
    	int len,
    	int *width,
    	int *max_ascent,
    	int *max_descent);
    
    extern void txfRenderGlyph(
    	TexFont * txf,
    	int c);
    
    extern void txfRenderString(
    	TexFont * txf,
    	char *string,
    	int len);
    
    extern void txfRenderFancyString(
    	TexFont * txf,
    	char *string,
    	int len);
    
    #ifdef __cplusplus
    } // extern "C"
    #endif
    
    #endif // __TEXFONT_H__