Drawing a 2d Text without using glut or SDL libs and dll-s

Started by
8 comments, last by BitMaster 11 years ago
Hello guys,
I need some header library to drawing 2d-text in opengl, I can't use any libs what requesting a .dll file(because I want use it in linux too).
It is for school project and I am running out of time, then if you have some usefull links or your's own solutions, post they here please.
Advertisement

Hello guys,
I need some header library to drawing 2d-text in opengl, I can't use any libs what requesting a .dll file(because I want use it in linux too).

link against static librarys?

personally, I use libfreetype to create a large texture with all the letters i want to use, and get all the glyph offsets, combined with kerning. then just draw a bunch of rectangles using this information.

Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

Yes it's good idea, but I don't have that much skill in this case, I can use it only if you post some script, to understanding.

Use texturemapped quads.. I made an app that generates a header file out of a TGA file that you can use to compile your text font into your executable, so that you don't need to have any external files or exe-bloating resources. The TGA data is heavily packed, reduced to monochrome and each texel is only 2-bits (4 shades of gray).

http://www.van-noland.com/files/fontpack.zip

there is a compiled exe of the fontpacking util (along with source, example, readme) that might make some browsers cautious, just recompile the fontpack.cpp file as a typical console app if you're scared of strange exe's (I usually am). there are also two usable font header files in there if you want to just use them instead.

Yes it's good idea, but I don't have that much skill in this case, I can use it only if you post some script, to understanding.

honestly, it sounds more like you don't understand how librarys work under linux(or in particular gcc/g++ compiler). SFML/SDL/etc are cross platform librarys and all have text rendering functions, you just need to know how to link the appropriate library's.

Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

SFML/SDL/etc are cross platform librarys and all have text rendering functions, you just need to know how to link the appropriate library's.

I say otherwise, I personaly don't want use SDL,GLUT,AUX etc. because I am using winapi (and x11 in linux ofcourse) and because I don't want have .dll file with .exe

it sounds more like you don't understand how librarys work under linux(or in particular gcc/g++ compiler)

I will not react on that because I do not want to start guessing.



SFML/SDL/etc are cross platform librarys and all have text rendering functions, you just need to know how to link the appropriate library's.

I say otherwise, I personaly don't want use SDL,GLUT,AUX etc. because I am using winapi (and x11 in linux ofcourse) and because I don't want have .dll file with .exe


/>

>

it sounds more like you don't understand how librarys work under linux(or in particular gcc/g++ compiler)

I will not react on that because I do not want to start guessing.

if you don't want to learn how to compile sdl, sfml, etc on linux, then you need to start googling how to load fonts, and how to use the glyph information to draw a string of text.

since you don't want to use librarys, than using freetype is probably out of the question for generating the font texture on demand. so, you'll want a bitmap font creator(such as: http://angelcode.com/products/bmfont/ which also appears to have some tutorials linked to using the tool.)

Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

if you don't want to learn how to compile sdl, sfml, etc on linux

You probably don't understand, I know how to compile SDL,GLUT,aux etc. on linux, I always uses SDL or glut, but now I want to create an "StandAlone" application what do not use any special libraries what to need be install, it should only use OS defaults(GL.h,GL.u,maybe glx.h).

http://angelcode.com/products/bmfont/

And that link you posted is very usefull but I don't have time to understand and be able to use it.
I need some more simple solution for this, when I was "googling" I found this opengl turorial what using a glBitmap()

http://fly.cc.fer.hr/~unreal/theredbook/chapter08.html

It's simpliest solution but, ist's not working for me now, my 3d scene is drawing, but text isn't and before you ask, yes I create new projection under scene, I realy need help with this.

http://nehe.gamedev.net/tutorial/bitmap_fonts/17002/

Has Linux GLX code for download at the bottom.


if you don't want to learn how to compile sdl, sfml, etc on linux

You probably don't understand, I know how to compile SDL,GLUT,aux etc. on linux, I always uses SDL or glut, but now I want to create an "StandAlone" application what do not use any special libraries what to need be install, it should only use OS defaults(GL.h,GL.u,maybe glx.h).


If you knew how to compile libraries you would not be here asking that question. I have personally built SFML, GLFW and GLEW to link completely statically on Windows so that the resulting executable had exactly zero dependencies on any other file (except of course everything you have to link dynamically like OpenGL or access to the OS kernel). Depending on the library it requires some minor changes (compile to static library instead of dynamic library, pick the static runtime) but hardly anything really difficult.

This topic is closed to new replies.

Advertisement