need graphical console

Started by
9 comments, last by Lord_Evil 17 years, 7 months ago
I'm developing an opengl application. I would like to have a graphical console in the application so that I can see messages as the application runs. Do you guys know where I can get a free console that I can plug into my application? The simpler the better. I checked out Crazy Eddie's Gui System, at www.cegui.org.uk, but it's too much for my needs. thanks for any help.
Advertisement
Have you considered writing one by yourself? It's pretty simple. Just writing text onto the screen. You can put everything in one or two classes and code it during one evening.
-- SirMike - http://www.sirmike.org
I'm fairly new to opengl. The idea was to put off writing my own console until a later time so that I can concentrate on other things. I guess I'm gonna have to do it myself. I really need one.

I can already output text. I figure I'll need to use scissor testing. Besides that, not sure what else I'll need.

What would be a good aproach to writing a console? Maybe some tips from you guys that have already made one.

Thanks
You could use some array or list that collects all the messages and then put them on your screen. For example, use a std::list, add new messages to the tail and remove from the head if you're out of space (lines you want to display).

Note, however, that using bitmap fonts is very slow, it would be faster to use texture mapped fonts but more difficult to implement.
If I was helpful, feel free to rate me up ;)If I wasn't and you feel to rate me down, please let me know why!
So basically: store the message lines in some kind of list, and then output the list to the screen using a scissors to clip where the output will be going. Got it.

I got my font building here code from here:
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=24

I guess they're bitmap fonts. I checked out he's texture-mapped fonts tutorial, but it's windows dependent. I'm using linux. That sucks.

thanks

Well, basically texture mapped fonts work as follows:

- Create a quad for every character you want to display (e.g. in a display list as you did with your bitmap font). The quads vertices are specified in screen coordinates (with z beeing 0 or at your near clip plane) and contain the texture coordinates for ech character.

- Bind the font texture.

- Set the projection matrix to identity so that no projection will be used.

- Set the modelview matrix to identiy to eliminate camera position

- Render each character by using the display list and moving the position with glTranslatef(...)

Make shure you have blending enabled. If you can't load texures with alpha channels, use a key color to set the alpha when loading. For example, using purple as key color, when loading the texture use a 4 component color format like GL_RGBA and set the alpha component to 0 for each purple pixel.
If I was helpful, feel free to rate me up ;)If I wasn't and you feel to rate me down, please let me know why!
I don't know enough to follow your mini-tutorial, yet. But I'm sure it will come in handy when I finally know enough to implement it.
Use glut for fonts.
I'm already using glut. Nice!
I didn't know glut did fonts.
Now you do! good luck! ;)

I use something like this:

void drawText(char* text, float x, float y){	//... do magic matrix stuff here	//go!	glRasterPos3f(x,y,0);	for(;*text!=0;text++)		glutBitmapCharacter(GLUT_BITMAP_8_BY_13,*text);	//... restore magic matrix stuff here}

This topic is closed to new replies.

Advertisement