NVIDIA DRIVE 5.0 Linux SDK API Reference

5.0.10.3 Release

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nvtexfont.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003 - 2012 NVIDIA Corporation. All rights reserved.
3  *
4  * NVIDIA Corporation and its licensors retain all intellectual property
5  * and proprietary rights in and to this software, related documentation
6  * and any modifications thereto. Any use, reproduction, disclosure or
7  * distribution of this software and related documentation without an express
8  * license agreement from NVIDIA Corporation is strictly prohibited.
9  *
10  * This software is based upon texfont, with consent from Mark J. Kilgard,
11  * provided under the following terms:
12  *
13  * Copyright (c) Mark J. Kilgard, 1997.
14  *
15  * This program is freely distributable without licensing fees and is
16  * provided without guarantee or warrantee expressed or implied. This
17  * program is -not- in the public domain.
18  */
19 
20 #ifndef __NV_TEXFONT_H__
21 #define __NV_TEXFONT_H__
22 
23 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 //
55 // Public data types
56 //
57 
58 #define TXF_FORMAT_BYTE 0
59 #define TXF_FORMAT_BITMAP 1
60 
61 typedef void * NVTexfontContext;
62 
63 typedef enum {
67 
68 typedef enum {
72 
73 typedef struct _NVTexfontRasterFont NVTexfontRasterFont;
74 typedef struct _NVTexfontVectorFont NVTexfontVectorFont;
75 
76 //
77 // General functions
78 //
79 
80 extern char*
82 
87 extern NVTexfontContext
89 
93 extern void
95  NVTexfontContext tfc);
96 
104 extern void
106  NVTexfontContext tfc,
107  float x,
108  float y);
109 
117 extern void
119  NVTexfontContext tfc,
120  float scaleX,
121  float scaleY);
122 
123 extern void
125  NVTexfontContext tfc,
126  float r,
127  float g,
128  float b);
129 
130 // TODO: Raster and vector font structures/functions should be merged
131 // TODO: so that we initialize a font object as one or the other and
132 // TODO: then use the same set of top level functions for rendering.
133 
138 
139 extern int
141  NVTexfontRasterFont *txf,
142  int c);
157 extern NVTexfontRasterFont*
160  GLuint texobj,
161  GLboolean setupMipmaps,
162  GLenum minFilter,
163  GLenum magFilter);
164 
170 extern void
172  NVTexfontRasterFont *txf);
173 
195 extern void
197  NVTexfontRasterFont *txf,
198  char *string,
199  float x,
200  float y,
201  float scaleX,
202  float scaleY,
203  float r,
204  float g,
205  float b);
206 
217 extern void
219  NVTexfontRasterFont *txf,
220  NVTexfontContext tfc,
221  char *string,
222  float x,
223  float y);
224 
225 extern void
227  NVTexfontRasterFont *txf,
228  NVTexfontContext tfc,
229  char *string);
230 
231 extern void
233  NVTexfontRasterFont *txf,
234  char *string,
235  int len,
236  int *width,
237  int *max_ascent,
238  int *max_descent);
239 
245 
246 extern int
248  NVTexfontVectorFont *vtf,
249  int c);
250 
263 extern NVTexfontVectorFont*
266  GLboolean antialias,
267  GLboolean use_vbo);
268 
274 extern void
276  NVTexfontVectorFont *vtf);
277 
295 extern void
297  NVTexfontVectorFont *vtf,
298  char *string,
299  float x,
300  float y,
301  float scaleX,
302  float scaleY,
303  float r,
304  float g,
305  float b);
306 
317 extern void
319  NVTexfontVectorFont *vtf,
320  NVTexfontContext tfc,
321  char *string,
322  float x,
323  float y);
324 
333 extern void
335  NVTexfontVectorFont *vtf,
336  NVTexfontContext tfc,
337  char *string);
338 
341 #ifdef __cplusplus
342 }
343 #endif
344 
346 #endif /* __NV_TEXFONT_H__ */
347 
void nvtexfontSetContextPos(NVTexfontContext tfc, float x, float y)
Sets the x,y attributes for the NVTexfont context tfc.
NVTexfontContext nvtexfontAllocContext(void)
Allocates a handle for an NVTexfont context.
int uint32_t width
NVTexfontVectorFont * nvtexfontInitVectorFont(NVTexfontVectorFontName font, GLboolean antialias, GLboolean use_vbo)
Initialize an NVTexfontVectorFont.
void nvtexfontFreeContext(NVTexfontContext tfc)
Frees the specified NVTexfont context handle.
struct _NVTexfontRasterFont NVTexfontRasterFont
Definition: nvtexfont.h:73
NVTexfontVectorFontName
Definition: nvtexfont.h:68
void nvtexfontRenderVecString_All(NVTexfontVectorFont *vtf, char *string, float x, float y, float scaleX, float scaleY, float r, float g, float b)
Renders the specified null-terminated string by using the NVTexfontVectorFont vtf.
NVTexfontRasterFontName
Definition: nvtexfont.h:63
void nvtexfontSetContextColor(NVTexfontContext tfc, float r, float g, float b)
void nvtexfontSetContextScale(NVTexfontContext tfc, float scaleX, float scaleY)
Sets the x,y attributes for the NVTexfont context tfc.
NVTexfontRasterFont * nvtexfontInitRasterFont(NVTexfontRasterFontName font, GLuint texobj, GLboolean setupMipmaps, GLenum minFilter, GLenum magFilter)
Initializes an NVTexfontRasterFont.
void nvtexfontUnloadRasterFont(NVTexfontRasterFont *txf)
Frees textures used by the font txf.
struct _NVTexfontVectorFont NVTexfontVectorFont
Definition: nvtexfont.h:74
void nvtexfontRenderVecString(NVTexfontVectorFont *vtf, NVTexfontContext tfc, char *string)
Renders the specified null-terminated string as above but uses the position/scale/color from the NVTe...
void nvtexfontRenderVecString_Pos(NVTexfontVectorFont *vtf, NVTexfontContext tfc, char *string, float x, float y)
Renders the specified null-terminated string as above but uses the position/scale/color from the NVTe...
void nvtexfontRenderString_Pos(NVTexfontRasterFont *txf, NVTexfontContext tfc, char *string, float x, float y)
Renders the specified null-terminated string as above but uses the position/scale/color from the NVTe...
int nvtexfontInRasterFont(NVTexfontRasterFont *txf, int c)
void nvtexfontRenderString_All(NVTexfontRasterFont *txf, char *string, float x, float y, float scaleX, float scaleY, float r, float g, float b)
Renders the specified null-terminated string by using the NVTexfont txf.
int nvtexfontInVectorFont(NVTexfontVectorFont *vtf, int c)
void * NVTexfontContext
Definition: nvtexfont.h:61
void nvtexfontRenderString(NVTexfontRasterFont *txf, NVTexfontContext tfc, char *string)
void nvtexfontGetStringMetrics(NVTexfontRasterFont *txf, char *string, int len, int *width, int *max_ascent, int *max_descent)
void nvtexfontUnloadVectorFont(NVTexfontVectorFont *vtf)
Frees resources used by the vector font vtf, including the VBO if used.
char * nvtexfontErrorString(void)