Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

ImARealist

Chat Window

This topic is 5334 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

If i have a fullscreen OpenGL window and i want to open a smaller, semi-transparent chat window on top of it, do i just make a child OpenGL window or is there another way to do it?

Share this post


Link to post
Share on other sites
Advertisement
What you need to do is write a class that renders the chat window on the screen using OpenGL drawing commands AFTER everything else has been rendered. Key presses should send ASCII characters to the class which get appeneded to an input buffer (character array). When the ENTER key is pressed, the line should be transmitted and the buffer cleared. If you want to display the last several lines that were transmitted or received, you'd want an array of character buffers that you render to the screen, one line after the other. When a new line has been sent, you'd copy the contents of the 2nd line in the array to the 1st line, you'd copy the third line to the 2nd line, and the 4th line to the 3rd line, until you've reached the last line. Then you overwrite that last line with the newly sent line. I'd recommend using memcpy or strncpy for this. The easiest way to render something like this is to draw a semi-transparent box with a quad. Then render the text over it.

[edited by - Expendable on January 12, 2004 1:47:43 PM]

Share this post


Link to post
Share on other sites

  • 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!