zoukankan      html  css  js  c++  java
  • Freetype 与 OpenGL 合作显示中文(Unicode) Visual Studio

    受到下面这篇文章启发,但是在做的过程中遇到了一些bug,所以我重新整理一下实现步骤

    http://blog.csdn.net/aucaser/article/details/49963049?utm_source=itdadao&utm_medium=referral

    一 配置freetype 

    1. 在下面这个两个网站里下载 freetype-2.3.4和 ftgl-2.1.3-rc5

    http://download.savannah.gnu.org/releases/freetype/

    https://sourceforge.net/projects/ftgl/

    (里面有很多版本,但是哪个都可以啦)

    2. 在目录C:UsersDellDownloadsfreetype-2.3.4uildswin32visualc下,用visual studio打开freetype.sln(如果你用的是比较高的版本,比如我的是2015,它就会提示说这个版本不一啊,balabla的,不用管,就继续打开就好)

    打开之后,你就build一下,就会在目录C:UsersDellDownloadsfreetype-2.3.4objs下出现一个

    然后把它复制到这个目录下,也就是你visual studio的安装目录下C:Program Files (x86)Microsoft Visual Studio 14.0VClib

    再把这个目录下C:UsersDellDownloadsfreetype-2.3.4include 的该文件夹拷贝到C:Program Files (x86)Microsoft Visual Studio 14.0VCinclude

    3. 接下来来到ftgl了!

    在此目录下C:UsersDellDownloadsftgl-2.1.3~rc5msvcvc8打开

    再build一下之后,请来到C:UsersDellDownloadsftgl-2.1.3~rc5msvcBuild,在里面把and 拷贝到

    C:Program Files (x86)Microsoft Visual Studio 14.0VClib

    再来到C:UsersDellDownloadsftgl-2.1.3~rc5src下,把FTGL文件夹拷贝到C:Program Files (x86)Microsoft Visual Studio 14.0VCinclude

    以上!!就是我参考的文章之后做的行动。我也用了该篇文章提到的例子,但是接下来出现了一些编译错误。然后我进行了如下的行动。Follow me!


    我先自己创建了一个项目,叫ftgldemo.然后把我开篇提的文章里面的例子放进去了。

    接下来

    1. 点击Project----->ftgldemo Properties就来到了这个界面。然后请点击Linker---->Input. 注意观察Additional Dependencies这个地方

    请在里面添加: freetype234_D.lib;ftgl_D.lib; 这个很重要

    2. 请来到这里:C:UsersDellDownloadsftgl-2.1.3~rc5msvcBuild

    拷贝到C:WindowsSystem32

    你是32位系统就拷贝到System32,如果是64位系统就拷贝到SysWOW64

    3. 请把代码中的这部分,修改成 #include <FTGL/ftgl.h>

    二 配置OpenGL

    需要先下载库文件,这个网上都有。然后配置方法如下:(英文的原因是当时要给老板(外国人)写配置过程。很简单的,所以就不翻译了哈)

    1.create a new file "GL" in the path:C:Program Files (x86)Microsoft Visual Studio 14.0VCincludeGL
    then put glut.h in the GL file.
    2. Put glut32.lib int the path: C:Program Files (x86)Microsoft Visual Studio 14.0VClib
    3. Put glut32.dll int the path:C:WindowsSystem32

    最后,如果编译成功,运行之后的样子是:

  • 相关阅读:
    验证码生成程序
    会话技术Cookie&Session
    jsp基础、el技术、jstl标签、javaEE的开发模式
    js原生的Ajax
    java基础-反射
    hibernate 联合主键 composite-id
    在ubuntu18 安装nginx过程,以及遇到的错误!
    报错解决:error: this statement may fall through [-Werror=implicit-fallthrough=]
    nginx.conf中关于nginx-rtmp-module配置指令详解
    搭建Nginx+nginx-rtmp-module的hls流媒体服务器并用OBS进行推流
  • 原文地址:https://www.cnblogs.com/lws520/p/6757474.html
Copyright © 2011-2022 走看看