GLUI Subwindow Template

I have written an article on CodeProject that shows you how to create GUI controls for your OpenGL application and organize them into GLUI subwindows. In this article, we will take the source code from the previous article GLUI Window Template, and modify it so that our GLUI controls will be laid out inside two subwindows rather than in a single window. The reason is that having a separate window to contain our GLUI controls could be sometimes annoying for the user, as she or he will have to lose the focus on the OpenGL context window every time she or he wants to do an action. A nice way to avoid this is to place the GLUI controls directly into the GLUT OpenGL window by embedding them into a GLUI subwindow.

This article can be used in the following ways:

  • Learn how to use GLUI subwindows
  • Understand the Viewport concept in OpenGl
  • Use the program as a template for your OpenGL applications that require GUI controls

The image below shows how our controls were laid out into a single GLUI window in the previous article:

GLUI Window

The image below shows how our controls will be laid out into two separate subwindows placed on the left and the bottom of our main GLUT window:

GLUI Subwindow

You can download the code from my GitHub page. Check it out, and let me know what you think.

Ali B

One thought on “GLUI Subwindow Template

  1. hi,
    i need to learn something about GLUI_EditText.i want to write something on the screen.but it doesnt appear on the window what i write.still just inside box.this is the code..
    GLUI_EditText *edittext = glui_window->add_edittext_to_panel(op_panel, “Text:”, GLUI_EDITTEXT_TEXT, &text, EDITTEXT_TEXT, glui_callback);

    what should be to make appear on the window?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s