Jump to content

  • Log In with Google      Sign In   
  • Create Account


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


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.

  • You cannot reply to this topic
9 replies to this topic

#1 QIZI94   Members   -  Reputation: 116

Like
0Likes
Like

Posted 24 March 2013 - 11:03 AM

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.
 


Sponsor:

#2 slicer4ever   Crossbones+   -  Reputation: 3219

Like
1Likes
Like

Posted 24 March 2013 - 12:11 PM

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.

#3 QIZI94   Members   -  Reputation: 116

Like
0Likes
Like

Posted 24 March 2013 - 01:07 PM

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.



#4 radioteeth   Prime Members   -  Reputation: 918

Like
0Likes
Like

Posted 24 March 2013 - 01:22 PM

 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.



#5 slicer4ever   Crossbones+   -  Reputation: 3219

Like
0Likes
Like

Posted 24 March 2013 - 01:23 PM

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.

#6 QIZI94   Members   -  Reputation: 116

Like
0Likes
Like

Posted 24 March 2013 - 02:13 PM

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.

 



#7 slicer4ever   Crossbones+   -  Reputation: 3219

Like
1Likes
Like

Posted 24 March 2013 - 02:34 PM


 


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


Edited by slicer4ever, 24 March 2013 - 02:34 PM.

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

#8 QIZI94   Members   -  Reputation: 116

Like
0Likes
Like

Posted 24 March 2013 - 03:39 PM

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.



#9 Erik Rufelt   Crossbones+   -  Reputation: 3102

Like
0Likes
Like

Posted 25 March 2013 - 03:59 AM

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

Has Linux GLX code for download at the bottom.



#10 BitMaster   Crossbones+   -  Reputation: 3662

Like
0Likes
Like

Posted 25 March 2013 - 04:30 AM


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.

Edited by BitMaster, 25 March 2013 - 04:31 AM.





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.



PARTNERS