1/* 2 * Copyright (C) 2010 LunarG Inc. 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice shall be included 12 * in all copies or substantial portions of the Software. 13 * 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 * DEALINGS IN THE SOFTWARE. 21 * 22 * Authors: 23 * Chia-I Wu <olv@lunarg.com> 24 */ 25 26#ifndef EGLUT_H 27#define EGLUT_H 28 29/* used by eglutInitAPIMask */ 30enum { 31 EGLUT_OPENGL_BIT = 0x1, 32 EGLUT_OPENGL_ES1_BIT = 0x2, 33 EGLUT_OPENGL_ES2_BIT = 0x4, 34 EGLUT_OPENVG_BIT = 0x8 35}; 36 37/* used by EGLUTspecialCB */ 38enum { 39 /* function keys */ 40 EGLUT_KEY_F1, 41 EGLUT_KEY_F2, 42 EGLUT_KEY_F3, 43 EGLUT_KEY_F4, 44 EGLUT_KEY_F5, 45 EGLUT_KEY_F6, 46 EGLUT_KEY_F7, 47 EGLUT_KEY_F8, 48 EGLUT_KEY_F9, 49 EGLUT_KEY_F10, 50 EGLUT_KEY_F11, 51 EGLUT_KEY_F12, 52 53 /* directional keys */ 54 EGLUT_KEY_LEFT, 55 EGLUT_KEY_UP, 56 EGLUT_KEY_RIGHT, 57 EGLUT_KEY_DOWN, 58}; 59 60/* used by eglutGet */ 61enum { 62 EGLUT_ELAPSED_TIME 63}; 64 65typedef void (*EGLUTidleCB)(void); 66typedef void (*EGLUTreshapeCB)(int, int); 67typedef void (*EGLUTdisplayCB)(void); 68typedef void (*EGLUTkeyboardCB)(unsigned char); 69typedef void (*EGLUTspecialCB)(int); 70 71void eglutInitAPIMask(int mask); 72void eglutInitWindowSize(int width, int height); 73void eglutInit(int argc, char **argv); 74 75int eglutGet(int state); 76 77void eglutIdleFunc(EGLUTidleCB func); 78void eglutPostRedisplay(void); 79 80void eglutMainLoop(void); 81 82int eglutCreateWindow(const char *title); 83void eglutDestroyWindow(int win); 84 85int eglutGetWindowWidth(void); 86int eglutGetWindowHeight(void); 87 88void eglutDisplayFunc(EGLUTdisplayCB func); 89void eglutReshapeFunc(EGLUTreshapeCB func); 90void eglutKeyboardFunc(EGLUTkeyboardCB func); 91void eglutSpecialFunc(EGLUTspecialCB func); 92 93#endif /* EGLUT_H */ 94