Jump to content
  • Advertisement
Sign in to follow this  
supervlad

OpenGL need graphical console

This topic is 4415 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!