Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Edit box in Open GL?

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

  • PlanetCppPlanetCpp Member Posts: 30
    in glut i dont think its possible, but if you use win32 it should be just natural, you have your HDC which is the opengl graphics window which doesnt have to be the main window just have a child window do it. then outside of that window is the GUI which will let the user manipulate whats in the opengl HDC, i dont think you can do it inside the HDC and integrate it though.



    : 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.
    :

  • DarknezzDarknezz Member Posts: 245
    : 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.
  • WuduWudu Member Posts: 25
    : 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.
    :

    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 ;)
Sign In or Register to comment.