I was wondering how you create an essential edit box using open gl. I need to be able to have an area where a user types and what the user types can be manipulated by the program. Any suggestions would be appreciated. I don't have any information about it in my Open GL book and I haven't found anything on the web, although I'm not sure of the exact terminology that I should be searching for.
Comments
: I was wondering how you create an essential edit box using open gl. I need to be able to have an area where a user types and what the user types can be manipulated by the program. Any suggestions would be appreciated. I don't have any information about it in my Open GL book and I haven't found anything on the web, although I'm not sure of the exact terminology that I should be searching for.
:
:
I've never used OpenGL so i may be wrong but you should be able to create your own edit box..
For example, i use DirectX for game graphics and when i create buttons on say the main menu of the game i use a class similar to the following..
class MyButton
{
int BState;
int Top;
int Left;
int Height;
int Width;
}
Then i use window messages to tell me if the mouse cursor is over the button, for example in the WM_LBUTTONDOWN (left mouse button pressed down) i can do a loop that loops through my buttons and find the one which has its BState property set to a certain value, which i would create a constant for, say MB_MOUSEOVER.
If there is a button which has the mouse cursor over it then i run the code for that button, an easy way would be to put that buttons code in a function and call it.
So for your edit box, have a think about it and you should be able to create your own custom edit box. Create a class/struct to hold information about the edit box then use whatever method you want to check the keyboard and mouse state, use the information gained from checking the keyboard and mouse state to do stuff.
:
You create your own edit boxes, buttons, menues, ... (= GUI = graphical user interface) by painting them with OpenGL and handling user input within your program (if you develop for windows you can use directx)
But, try to find a GUI that fits your needs because programming one ... takes a lot of time