Advertisement

bitmap fonts and OOP basecode.

Started by December 18, 2004 06:09 AM
1 comment, last by hymerman 19 years, 11 months ago
right, i've been basing my game off the wonderful NeHe OOP basecode, and i've just come to add fonts to the engine. i tried using tutorial 43- the freetype library, but after days of fiddling around i really couldn't get it to work, and gave up. so then i tried using bitmap fonts, from lesson 17, but using the 'glFont.h' and 'glFont.cpp' files from lesson 44, which had them in a much nicer format, IMO. unfortunately, even though i've copied the files exactly, and set them up in the same way, i get the error: Unhandled exception at 0x6920a5c0 in NeHeGL.exe: 0xC0000005: Access violation reading location 0x0ccc0001. every time i run the code. when i set breakpoints throughout the part of code i think is making it break, i found that it was this line it had problems with: glTexImage2D(GL_TEXTURE_2D, 0, 3, BMP.bmWidth, BMP.bmHeight, 0, GL_BGR_EXT, GL_UNSIGNED_BYTE, BMP.bmBits); even though it works just fine in lesson 44! has anyone else encountered the same problem? if so, can you please help me, i've wasted so much time fiddling around, and all i want is a way of displaying text! thanks in advance, hymerman
what happens if you replace GL_BGR_EXT with GL_RGB?
Advertisement
that was one of the many things i tried :)

i believe that just changed the way colours are represented, and as such, it made no difference.

i solved the problem, but unfortunately i really don't know how. i just got the basecode again, got the glFont.h and glFont.cpp files, included everything, made exactly the same changes as before, and it worked fine. they really are exactly the same, character for character.

it's either that i mucked around with project settings, or it's just one of those things... bad things...

thanks for your help, anyway!

This topic is closed to new replies.

Advertisement