• Create Account

## NeHe FreeTypeFont tutorial - blank screen

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

6 replies to this topic

### #1Acharis  Members

5852
Like
0Likes
Like

Posted 29 December 2012 - 11:08 AM

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, 29 December 2012 - 11:08 AM.

Working on an Emperor focused, no micromanagement, asymmetric, 4X, space empire builder:

### #2Acharis  Members

5852
Like
0Likes
Like

Posted 02 January 2013 - 03:54 PM

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

Working on an Emperor focused, no micromanagement, asymmetric, 4X, space empire builder:

### #3__SKYe  Members

1584
Like
1Likes
Like

Posted 03 January 2013 - 04:45 AM

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.

### #4Acharis  Members

5852
Like
0Likes
Like

Posted 03 January 2013 - 03:19 PM

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.

Working on an Emperor focused, no micromanagement, asymmetric, 4X, space empire builder:

### #5__SKYe  Members

1584
Like
1Likes
Like

Posted 04 January 2013 - 01:50 AM

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.

### #6Acharis  Members

5852
Like
0Likes
Like

Posted 05 January 2013 - 10:30 AM

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).

Working on an Emperor focused, no micromanagement, asymmetric, 4X, space empire builder:

### #7__SKYe  Members

1584
Like
1Likes
Like

Posted 05 January 2013 - 11:04 AM

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.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.