PDA

View Full Version : OpenGL text editor suggestions


Ssendam
2002.07.10, 05:36 PM
I'm working on a project that requires some basic text-editing to be present. I'm doing everything through OpenGL (I've got textures for the characters, etc.) and I have things working to the point where I can pop a text-editing field up on the screen and have the user type into it. However, I've been struggling to come up with a good way to allow the user to move the cursor around with the mouse, and make selections with the mouse as well. Has anybody done this? Does anybody have any suggestions as to good approaches to take (or bad approaches to avoid)?
Thanks in advance.

Ssendam
2002.07.14, 02:15 PM
I got something worked out; it's not as elegant as I would have liked but it doesn't actually seem to be slowing anything down.

codemattic
2002.07.14, 03:57 PM
I dont know how complex you want to get - but check out GLOW and GLUI. Both are open source toolkits that create a gui using opengl. Along with the sliders, menus, arcballs, etc... they both have textedit boxes that allow you to select text with your mouse. If you dont want to use either library - maybe by looking through the source you can get a better idea of how to do it yourself.

I should add that for games - we usually accept that we dont have full editing capabilities in-game. If we can type - and backspace to delete mistakes - usually thats good enough.

GLOW <http://glow.sourceforge.net/>
GLUI <http://www.cs.unc.edu/~rademach/glui/>

neither library has been updated in a while.

hth,
Codemattic