# OpenGL NeHe FreeTypeFont tutorial - blank screen

This topic is 2111 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm trying to make the NeHe freetypefont tutorial to work, but I get a blank screen for some reason...

What I did:
- got precompiled Windows binaries of freetype (freetype-2.3.5-1-bin)
- made a project in Code::Blocks (SDL+OpenGL+FreeType lib included)
- downloaded the source code from http://nehe.gamedev.net/tutorial/freetype_fonts_in_opengl/24001/ (the Linux/SDL Code For This Lesson. ( Conversion by Aaron Graves) version) and I have not forgotten about the font either :)

So, I have built it and run and... I'm getting a blank screen. I added a standard "OpenGL triangle code" and it is displayed properly, so I assume OpenGl + SDL works as it should. I got no errors of any kind.

I don't know how to bite it. Is it because the tutorial is broken? Or I downloaded a broken version of it? Or I got a wrong/broken/incompatible version of FT library? Or something else?

Does anyone got this tutorial working? Edited by Acharis

##### Share on other sites

OK, maybe I should ask another question. Do you know of any working FreeTypeFont OpenGL rendering tutorial?

##### Share on other sites

First of all i never downloaded the code, i just read the tutorial (and understood it), and rewrote it myself, and it did work with me. And i also did it on windows.

And the Freetype library is correct, this tutorial uses freetype 2.

You say you downloaded the FreeType windows binaries, and the Linux/SDL code? It doesn't make sense.

If you have windows, then download the windows code, if you have linux, i believe the windows freetype binaries won't help.

##### Share on other sites

Windows

But the sources were for SDL, it's supposed to run on absolutelly everything...

Anyway, I can't use the VC++ source codes because these use glaux, which is not included in code::blocks.

##### Share on other sites

http://nehe.gamedev.net/tutorial/lesson_06_texturing_update/47002/

EDIT: Or if you want to use glaux, download the files here http://mycodelog.com/2010/05/15/gllibs/, place the files in their correct folders (you only need the glaux.h and glaux.lib), and see if the program works.

And keep in mind that this tutorial is deprecated in various ways.

Display lists, GL_LUMINANCE_ALPHA, drawing using glBegin()...glEnd(), glaux, etc are all deprecated in modern OpenGL (along with the way the freetype headera are included).

Also, i just downloaded the VC++ code, compiled it and it works for me EXCEPT you must change the following bit:



for(const char *c=text;*c;c++) {

to



const char *c=text;

for(;*c;c++) {

or an error will occur.

See if it works, and let me know.

##### Share on other sites

OK, maybe something easier first. Where can I get prebuild libraries of FreeType for Windows? Includes+lib+dlls, all that are guaranteed to be compatible and work together (doeas not matter which version, as long as all of these files are compatible).

I noticed the one I was using is kind of strange and does not look like the others (it has freetype2/freetype directory structure instead of freetype like all tutorials require, I manually changed it but... it's still suspicious, so maybe I just have some broken version of TTF library).

I tried the package from the official freetype site (http://download.savannah.gnu.org/releases/freetype/) but it has no prebuild libraries (and I definitely want to avoid building these myself now, I would then be completely in blind at which step I made a mistake if it does not work).

##### Share on other sites

Unzip the files, and you will have the include, lib, and dll files

You just need the freetype6.dll and freetype.lib.

The include file directory has the following structure

copy that same structure to your IDE include folder, but remove the 'freetype2' folder in between (it should become ...include\freetype\<the freetype headers>)

then link your project with the freetype.lib, and run it. It should work (i hope).

If you have doubts, or it doesn't work then post again.

1. 1
2. 2
3. 3
Rutin
22
4. 4
5. 5

• 16
• 14
• 9
• 9
• 9
• ### Forum Statistics

• Total Topics
632928
• Total Posts
3009265
• ### Who's Online (See full list)

There are no registered users currently online

×