当前位置:主页   - 电脑 - 程序设计 - C/C++
《基于MFC的OpenGL编程》Part 13 Creating 2D and 3D Text
来源:网络   作者:   更新时间:2011-01-22
收藏此页】    【字号    】    【打印】    【关闭

  wglUseFontBitmaps函数

  The wglUseFontBitmaps() function creates a set of bitmap display lists based on the glyphs in the currently selected font in the current DC for use in the current OpenGL RC. It basically creates a series of sequential display lists which can be executed using the function glCallLists. The function takes care of aligning the raster positions of subsequent bitmaps once we specify the raster position for the first bitmap. We use the glRasterPos function to set the current raster position, where the bitmapped text would start appearing.

  The glRasterPos function works exactly the same way as glVertex function, the only difference being that the position is being transformed and not the object. Thus when we use wglUseFontBitmaps to generate display lists and then call them, the resulting text is displayed, starting at the current raster position, and the bitmaps are copied to the raster buffer, giving the effect of always having the text positioned in the xy plane of the screen.

  Thus we would use wglUseFontBitmaps when we need the text to be visible to the user and that the size of the text relative to its distance from the viewpoint doesn't matter.

  wglUseFontOutlines函数

  The wglUseFontOutlines function creates a set of 3D polygon or line based primitive display lists, based on the glyphs in the currently selected TrueType font in the current DC for use in the current OpenGL RC. Stroke and Raster fonts are not supported. These objects can then be used to draw 3D characters. This function also has additional arguments that control the extrusion of the 3D characters in the +Z direction, the deviation of the generated primitive vertices from the design outline of the font, whether to generated filled polygons or a wireframe primitives and an array of structures to hold the metrics of each of the generated characters.

其它资源
来源声明

版权与免责声明
1、本站所发布的文章仅供技术交流参考,本站不主张将其做为决策的依据,浏览者可自愿选择采信与否,本站不对因采信这些信息所产生的任何问题负责。
2、本站部分文章来源于网络,其版权为原权利人所有。由于来源之故,有的文章未能获得作者姓名,署“未知”或“佚名”。对于这些文章,有知悉作者姓名的请告知本站,以便及时署名。如果作者要求删除,我们将予以删除。除此之外本站不再承担其它责任。
3、本站部分文章来源于本站原创,本站拥有所有权利。
4、如对本站发布的信息有异议,请联系我们,经本站确认后,将在三个工作日内做出修改或删除处理。
请参阅权责声明