Sign in to follow this  
Jesbass

OpenGL Drawing Text From A Font Texture

Recommended Posts

DISCLAIMER: I'm still quite new to C++. I'm a beginner. I'd like to draw text on the screen from a font page, rather than use a true type font. Can anyone point me towards a tutorial or an already working piece of code to do this? I found a tutorial but it was only for OpenGL.

Share this post


Link to post
Share on other sites
Hi there,

Thanks for the link. I downloaded the dhEngine, (haven't even got onto the dhFastFont yet), and there are a few errors. Firstly, the line of code in dhDrawableElement.h...

#include <dhEngine.h>


...resulted in this error...

Quote:
e:\Documents and Settings\David & Angela\Desktop\dhEngine\dhDrawableElement.h(4): fatal error C1083: Cannot open include file: 'dhEngine.h': No such file or directory


...even though that file was in the main directory of the project. This was fixed by changing the code to...

#include "dhEngine.h"


I then got the same error for the next include file, dhTypes, which was also fixed by replacing the angle brackets with quotation marks. But now I'm getting this error:

Quote:
dhEngine error PRJ0019: A tool returned an error code from "Performing Post-Build Event..."


I have a sneaking suspicion that the project should be able to work without me having to change those angle brackets into quotation marks, but can anyone else suggest what next step I should take?

Share this post


Link to post
Share on other sites
The angle brakets are used to include files located in one of the IDE's directories (usually set in the IDE's options). Quotes are used when including files relative to an actual directory. In this case, the header, 'dhEngine' was located in the same directory as the Current Working Directory and so no path needed to be specified.

The error you received was generated within the code of the engine. I.E. it was an error message created by good ol' Drunky using the '#error' directive. What it means I can't say but it's probably documented somewhere. If not, try asking him.

Share this post


Link to post
Share on other sites
G'day!

For some reason the DX9 version had the DX8 header, that would explain why nothing was working. Try downloading it again. The header should be called dhFastFont9.h.

The dhEngine is DX8 only, you don't need it. dhFastfont9 is completely stand-alone.

Share this post


Link to post
Share on other sites
I also updated the dhFastFont page to make things a little bit clearer. At some point, when I have free time (HA!), I want to rewrite it. And then there will be the inevitable .Net port...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this