4 * Display message posting, context buffer swapping.
6 * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
7 * Written by Pawel W. Olszta, <olszta@sourceforge.net>
8 * Creation date: Fri Dec 3 1999
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 * Permission is hereby granted, free of charge, to any person obtaining a
15 * copy of this software and associated documentation files (the "Software"),
16 * to deal in the Software without restriction, including without limitation
17 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 * and/or sell copies of the Software, and to permit persons to whom the
19 * Software is furnished to do so, subject to the following conditions:
21 * The above copyright notice and this permission notice shall be included
22 * in all copies or substantial portions of the Software.
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
28 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36 #define G_LOG_DOMAIN "freeglut-display"
38 #include "../include/GL/freeglut.h"
39 #include "../include/GL/freeglut_internal.h"
42 /* -- INTERFACE FUNCTIONS -------------------------------------------------- */
45 * Marks the current window to have the redisplay performed when possible...
47 void FGAPIENTRY glutPostRedisplay( void )
50 * Is there a current window set?
52 freeglut_assert_ready; freeglut_assert_window;
55 * Just mark the window as one that we need to redisplay...
57 fgStructure.Window->State.Redisplay = TRUE;
61 * Swaps the buffers for the current window (if any)
63 void FGAPIENTRY glutSwapBuffers( void )
66 * As long as we've got a current window set...
68 freeglut_assert_ready; freeglut_assert_window;
71 * Have the mouse cursor and/or the menus drawn for the current window
77 * Make sure the current context is flushed
81 #if TARGET_HOST_UNIX_X11
83 * Issue the glXSwapBuffers call and be done with it
85 glXSwapBuffers( fgDisplay.Display, fgStructure.Window->Window.Handle );
87 #elif TARGET_HOST_WIN32
89 * Swap the window's buffers
91 SwapBuffers( fgStructure.Window->Window.Device );
97 * Mark appropriate window to be displayed
99 void FGAPIENTRY glutPostWindowRedisplay( int windowID )
103 freeglut_assert_ready;
106 * Try looking for the window
108 window = fgWindowByID( windowID );
113 freeglut_return_if_fail( window != NULL );
116 * Otherwise mark the window for being redisplayed
118 window->State.Redisplay = TRUE;
121 /*** END OF FILE ***/