Giter VIP home page Giter VIP logo

glfreetype's Introduction

glfreetype

Another OpenGL FreeType library

I needed to display text in OpenGL. Other libraries were simply too massive for my needs/there were no clear examples. I discovered FreeType and the following NeHe tutorial:

http://nehe.gamedev.net/tutorial/freetype_fonts_in_opengl/24001/

The repository here is basically a simple amalgamation of those ideas. The end result is that you can use arbitrary .ttf fonts, e.g. using Arial.ttf which on my mac is located under /Library/fonts/:

Image of test example

Assuming a cmake build system, clone or submodule this repository into your source tree and add the following lines to your CMakeLists.txt file:

ADD_SUBDIRECTORY(glfreetype)
include_directories(glfreetype/include)
target_link_libraries(yourProjectName glfreetype)

This will add this Project as a dependency of your Project/Executable/Library. If you use add_subdirectory(glfreetype), the test binary won't be built!.

Please check out the test binary (build from the source root with):

mkdir build
cd build
cmake ..
make

glfreetype's People

Contributors

benhj avatar c0d3-m4513r avatar

glfreetype's Issues

font_data::clean() throws error

in the function font_data::clean the Function glDeleteLists() somehow errors with a SIGABRT.
For an reliable example look at https://github.com/C0D3-M4513R/OpenGLGame/tree/development

The Following line gives the error:
glDeleteLists(list_base,128);
With the Following the error still occurs:
glDeleteLists(list_base+10,7);
If I move the first number up, or the second down, the error is another one!

This also works, if print was never called on the font_data object

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.