OpenGL GLUT Event handling (processing) window management (Windows Management) functions [go]

Source: Internet
Author: User

Glut event handling (processing) window management (Windows Management) functions

void Glutmainloop (void)

Let the GLUT program enter the event loop. Can be called at most once in a glut program. Once called, it is not returned until the end of the program.

int Glutcreatewindow (char* name);

Produces a top-level window. Name is the name of the window, which is what the window title bar displays.

The return value is the marker for the generated window and can be referenced by the function Glutgetwindow ().

int Glutcreatesubwindow (int win,int x,int y,int width,int height);

Creates a child window. Win is the marker for its parent window. X, Y is the displacement relative to the parent window, expressed in pixels.

Width,height is the width and height of the child window.

void Glutsetwindow (int win);
int Glutgetwindow (void);

The function is: Set the tag to win the window is the current window, return the current window of the marker.

void Glutdestroywindow (int win);

Destroys the window with the win tag.

void Glutpostredisplay (void);

Mark the current window and mark it to be displayed again.

void glutswapbuffers (void);

When the window mode is double-cached, the function is to swap the contents of the background cache to the foreground display. Of course, with only a single cache, it is used with the same functionality as Glflush ().

A double cache is used to display a complete picture at once on a window, or to animate.

void Glutpositionwindow (int x,int y);

Change the position of the current window: when the current window is the top-level window, x, Y is the offset from the screen, and X, Y is the displacement relative to the origin of its parent window when the current window is a child window.

void Glutreshapewindow (int width,int height);

Changes the size of the current window.

Width,height is the new width and height value of the current window, which can only be positive.

void Glutfullscreen (void);

Make the current window display full screen. The current window is only valid if it is a top-level window.

void Glutpopwindow (void);
void Glutpushwindow (void);

Valid for both the top-level window and the child window. Changes the order of the current window in the stack relative to other windows.

void Glutshowwindow (void);
void Gluthidewindow (void);
void Gluticonifywindow (void);

These three functions are to change the display state of the current window.

    • Glutshowwindow makes the current window visible (it may still be blocked by other windows).
    • Gluthidewindow makes the current window non-visual.
    • Gluticonifywindow makes the current window an icon, which is also minimized.

void Glutsetwindowtitle (char* name);
void Glutseticontitle (char* name);

Sets the title of the current window (which must be the top-level window) and the caption when it is being parameterized.

void glutsetcursor (int cursor);

Sets the cursor style for the current window.

There are a number of cursor selectable values: such as glut_cursor_right_arrow pointing to the right of the cursor, glut_cursor_left_arrow pointing to the left of the cursor, glut_cursor_info become a hand-shaped.
The Glut_cursor_destroy is forked and glut_cursor_help the shape of the question mark. Wait a minute.

Go to: http://blog.csdn.net/augusdi/article/details/7076771

OpenGL GLUT Event handling (processing) window management (Windows Management) functions [go]

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.