Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include "config.h"
#include <GL/glut.h>
Go to the source code of this file.
Macros | |
#define | UCHAR_MAX 255 |
#define | HAVE_GLUT |
Typedefs | |
typedef void(* | winsys_display_func_t )() |
typedef void(* | winsys_idle_func_t )() |
typedef void(* | winsys_reshape_func_t )(int w, int h) |
typedef void(* | winsys_keyboard_func_t )(unsigned int key, unsigned int mod, bool release, int x, int y) |
typedef void(* | winsys_mouse_func_t )(int button, int state, int x, int y) |
typedef void(* | winsys_motion_func_t )(int x, int y) |
typedef void(* | winsys_atexit_func_t )(void) |
Enumerations | |
enum | winsys_keysym_t { WSK_NOT_AVAIL = 0, WSK_KP0 = 0, WSK_KP1 = 0, WSK_KP2 = 0, WSK_KP3 = 0, WSK_KP4 = 0, WSK_KP5 = 0, WSK_KP6 = 0, WSK_KP7 = 0, WSK_KP8 = 0, WSK_KP9 = 0, WSK_KP_PERIOD = 0, WSK_KP_DIVIDE = 0, WSK_KP_MULTIPLY = 0, WSK_KP_MINUS = 0, WSK_KP_PLUS = 0, WSK_KP_ENTER = 0, WSK_KP_EQUALS = 0, WSK_RETURN = 13, WSK_TAB = '\t', WSK_ESCAPE = 27, WSK_BACKSPACE, WSK_DELETE, WSK_UP = GLUT_KEY_UP+128, WSK_DOWN = GLUT_KEY_DOWN+128, WSK_RIGHT = GLUT_KEY_RIGHT+128, WSK_LEFT = GLUT_KEY_LEFT+128, WSK_INSERT = GLUT_KEY_INSERT+128, WSK_HOME = GLUT_KEY_HOME+128, WSK_END = GLUT_KEY_END+128, WSK_PAGEUP = GLUT_KEY_PAGE_UP+128, WSK_PAGEDOWN = GLUT_KEY_PAGE_DOWN+128, WSK_F1 = GLUT_KEY_F1+128, WSK_F2 = GLUT_KEY_F2+128, WSK_F3 = GLUT_KEY_F3+128, WSK_F4 = GLUT_KEY_F4+128, WSK_F5 = GLUT_KEY_F5+128, WSK_F6 = GLUT_KEY_F6+128, WSK_F7 = GLUT_KEY_F7+128, WSK_F8 = GLUT_KEY_F8+128, WSK_F9 = GLUT_KEY_F9+128, WSK_F10 = GLUT_KEY_F10+128, WSK_F11 = GLUT_KEY_F11+128, WSK_F12 = GLUT_KEY_F12+128, WSK_F13 = 0, WSK_F14 = 0, WSK_F15 = 0, WSK_NUMLOCK = 0, WSK_CAPSLOCK = 0, WSK_SCROLLOCK = 0, WSK_RSHIFT = 0, WSK_LSHIFT = 0, WSK_RCTRL = 0, WSK_LCTRL = 0, WSK_RALT = 0, WSK_LALT = 0, WSK_RMETA = 0, WSK_LMETA = 0, WSK_BREAK = 0, WSK_PAUSE = 0, WSK_LAST = UCHAR_MAX } |
enum | winsys_modifiers { WSK_MOD_NONE =0, WSK_MOD_LSHIFT =GLUT_ACTIVE_SHIFT, WSK_MOD_RSHIFT =GLUT_ACTIVE_SHIFT, WSK_MOD_LCTRL =GLUT_ACTIVE_CTRL, WSK_MOD_RCTRL =GLUT_ACTIVE_CTRL, WSK_MOD_LALT =GLUT_ACTIVE_ALT, WSK_MOD_RALT =GLUT_ACTIVE_ALT, WSK_MOD_LMETA =0, WSK_MOD_RMETA =0, WSK_MOD_NUM =0, WSK_MOD_CAPS =0, WSK_MOD_MODE =0 } |
enum | winsys_mouse_button_t { WS_LEFT_BUTTON = GLUT_LEFT_BUTTON, WS_MIDDLE_BUTTON = GLUT_MIDDLE_BUTTON, WS_RIGHT_BUTTON = GLUT_RIGHT_BUTTON, WS_WHEEL_UP, WS_WHEEL_DOWN } |
enum | winsys_button_state_t { WS_MOUSE_DOWN = GLUT_DOWN, WS_MOUSE_UP = GLUT_UP } |
Functions | |
void | winsys_post_redisplay () |
void | winsys_set_display_func (winsys_display_func_t func) |
void | winsys_set_idle_func (winsys_idle_func_t func) |
void | winsys_set_reshape_func (winsys_reshape_func_t func) |
void | winsys_set_keyboard_func (winsys_keyboard_func_t func) |
void | winsys_set_mouse_func (winsys_mouse_func_t func) |
void | winsys_set_motion_func (winsys_motion_func_t func) |
void | winsys_set_passive_motion_func (winsys_motion_func_t func) |
void | winsys_swap_buffers () |
void | winsys_enable_key_repeat (bool enabled) |
void | winsys_warp_pointer (int x, int y) |
void | winsys_show_cursor (bool visible) |
void | winsys_init (int *argc, char **argv, char const *window_title, char const *icon_title) |
void | winsys_shutdown () |
void | winsys_process_events () |
void | winsys_atexit (winsys_atexit_func_t func) |
void | winsys_exit (int code) |
enum winsys_keysym_t |
Definition at line 183 of file winsys.h.
enum winsys_modifiers |
void winsys_atexit | ( | winsys_atexit_func_t | func) |
Sets the function to be called when program ends. Note that this function should only be called once.
Definition at line 867 of file winsys.cpp.
References VSFileSystem::vs_fprintf().
void winsys_enable_key_repeat | ( | bool | enabled) |
Enables/disables key repeat messages from being generated
Definition at line 817 of file winsys.cpp.
Referenced by GFXInit().
void winsys_exit | ( | int | code) |
Exits the program
Definition at line 884 of file winsys.cpp.
References winsys_shutdown().
Referenced by bootstrap_main_loop(), Mission::DirectorBenchmark(), main(), GameMenu::processExitGameButton(), and VSExit().
void winsys_init | ( | int * | argc, |
char ** | argv, | ||
char const * | window_title, | ||
char const * | icon_title | ||
) |
Initializes the OpenGL rendering context, and creates a window (or sets up fullscreen mode if selected)
Definition at line 747 of file winsys.cpp.
References gl_options_t::color_depth, gl_options_t::fullscreen, g_game, VegaConfig::getVariable(), gl_options, height, XMLSupport::parse_bool(), XMLSupport::parse_int(), vs_config, VSFileSystem::vs_dprintf(), VSFileSystem::vs_fprintf(), width, game_data_t::x_resolution, and game_data_t::y_resolution.
Referenced by GFXInit().
void winsys_post_redisplay | ( | ) |
Requests that the screen be redrawn
Definition at line 575 of file winsys.cpp.
void winsys_process_events | ( | ) |
Processes and dispatches events. This function never returns.
Definition at line 849 of file winsys.cpp.
References glut_keyboard_cb(), glut_keyboard_up_cb(), glut_special_cb(), and glut_special_up_cb().
Referenced by GFXLoop().
void winsys_set_display_func | ( | winsys_display_func_t | func) |
Sets the display callback
Definition at line 587 of file winsys.cpp.
Referenced by GFXLoop().
void winsys_set_idle_func | ( | winsys_idle_func_t | func) |
Sets the idle callback
Definition at line 599 of file winsys.cpp.
Referenced by GFXLoop().
void winsys_set_keyboard_func | ( | winsys_keyboard_func_t | func) |
Sets the keyboard callback
Definition at line 674 of file winsys.cpp.
Referenced by ConsoleKeys::BringConsole(), BaseInterface::InitCallbacks(), RestoreKB(), UniverseUtil::startMenuInterface(), CockpitKeys::TextMessageKey(), and NavComputer::toggleVisibility().
void winsys_set_motion_func | ( | winsys_motion_func_t | func) |
Sets the mouse motion callback (when a mouse button is pressed)
Definition at line 698 of file winsys.cpp.
Referenced by BaseInterface::InitCallbacks(), GameCockpit::NavScreen(), RestoreMouse(), UniverseUtil::startMenuInterface(), EventManager::takeOverEventManagement(), and NavComputer::toggleVisibility().
void winsys_set_mouse_func | ( | winsys_mouse_func_t | func) |
Sets the mouse button-press callback
Definition at line 686 of file winsys.cpp.
Referenced by BaseInterface::InitCallbacks(), GameCockpit::NavScreen(), RestoreMouse(), UniverseUtil::startMenuInterface(), EventManager::takeOverEventManagement(), and NavComputer::toggleVisibility().
void winsys_set_passive_motion_func | ( | winsys_motion_func_t | func) |
Sets the mouse motion callback (when no mouse button is pressed)
Definition at line 710 of file winsys.cpp.
Referenced by BaseInterface::InitCallbacks(), GameCockpit::NavScreen(), RestoreMouse(), UniverseUtil::startMenuInterface(), EventManager::takeOverEventManagement(), and NavComputer::toggleVisibility().
void winsys_set_reshape_func | ( | winsys_reshape_func_t | func) |
Sets the reshape callback
Definition at line 611 of file winsys.cpp.
Referenced by GFXInit().
void winsys_show_cursor | ( | bool | visible) |
Shows/hides mouse cursor
Definition at line 829 of file winsys.cpp.
Referenced by ConditionalCursorDraw(), and GFXInit().
void winsys_shutdown | ( | ) |
Deallocates resources in preparation for program termination
Definition at line 799 of file winsys.cpp.
References gl_options_t::fullscreen, and gl_options.
Referenced by cleanup(), GFXShutdown(), and winsys_exit().
void winsys_swap_buffers | ( | ) |
Copies the OpenGL back buffer to the front buffer
Definition at line 722 of file winsys.cpp.
Referenced by GFXEndScene(), and GFXInit().
Moves the mouse pointer to (x,y)
Definition at line 734 of file winsys.cpp.
Referenced by BaseInterface::Room::Click(), and DealWithWarp().