ruby-glfw 0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -0
- data/README.API +73 -0
- data/Rakefile +120 -0
- data/examples/boing.rb +519 -0
- data/examples/gears.rb +327 -0
- data/examples/keytest.rb +117 -0
- data/examples/listmodes.rb +20 -0
- data/examples/mipmaps.rb +104 -0
- data/examples/mipmaps.tga +0 -0
- data/examples/particles.rb +837 -0
- data/examples/pong3d.rb +741 -0
- data/examples/pong3d_field.tga +0 -0
- data/examples/pong3d_instr.tga +0 -0
- data/examples/pong3d_menu.tga +0 -0
- data/examples/pong3d_title.tga +0 -0
- data/examples/pong3d_winner1.tga +0 -0
- data/examples/pong3d_winner2.tga +0 -0
- data/examples/splitview.rb +432 -0
- data/examples/triangle.rb +89 -0
- data/examples/wave.rb +294 -0
- data/ext/glfw/glfw.c +1094 -0
- data/ext/glfw/mkrf_conf.rb +70 -0
- data/glfw-src/Makefile +220 -0
- data/glfw-src/compile.ami +61 -0
- data/glfw-src/compile.bat +217 -0
- data/glfw-src/compile.sh +607 -0
- data/glfw-src/docs/Makefile +57 -0
- data/glfw-src/docs/Reference.pdf +0 -0
- data/glfw-src/docs/UsersGuide.pdf +0 -0
- data/glfw-src/docs/cleanup.bat +22 -0
- data/glfw-src/docs/glfwdoc.sty +80 -0
- data/glfw-src/docs/glfwrm.tex +3034 -0
- data/glfw-src/docs/glfwug.tex +2024 -0
- data/glfw-src/docs/readme.txt +80 -0
- data/glfw-src/examples/Makefile.amigaos.gcc +70 -0
- data/glfw-src/examples/Makefile.amigaos.vbcc +70 -0
- data/glfw-src/examples/Makefile.dos.djgpp +71 -0
- data/glfw-src/examples/Makefile.macosx.gcc +96 -0
- data/glfw-src/examples/Makefile.win32.bcc +75 -0
- data/glfw-src/examples/Makefile.win32.cross-mgw +79 -0
- data/glfw-src/examples/Makefile.win32.cygwin +79 -0
- data/glfw-src/examples/Makefile.win32.lcc +74 -0
- data/glfw-src/examples/Makefile.win32.mgw +75 -0
- data/glfw-src/examples/Makefile.win32.msvc +74 -0
- data/glfw-src/examples/Makefile.win32.ow +74 -0
- data/glfw-src/examples/Makefile.win32.pellesc +74 -0
- data/glfw-src/examples/Makefile.x11.in +54 -0
- data/glfw-src/examples/boing.c +606 -0
- data/glfw-src/examples/bundle.sh +46 -0
- data/glfw-src/examples/gears.c +382 -0
- data/glfw-src/examples/keytest.c +264 -0
- data/glfw-src/examples/listmodes.c +48 -0
- data/glfw-src/examples/mipmaps.c +126 -0
- data/glfw-src/examples/mipmaps.tga +0 -0
- data/glfw-src/examples/mtbench.c +301 -0
- data/glfw-src/examples/mthello.c +48 -0
- data/glfw-src/examples/particles.c +1148 -0
- data/glfw-src/examples/pong3d.c +839 -0
- data/glfw-src/examples/pong3d_field.tga +0 -0
- data/glfw-src/examples/pong3d_instr.tga +0 -0
- data/glfw-src/examples/pong3d_menu.tga +0 -0
- data/glfw-src/examples/pong3d_title.tga +0 -0
- data/glfw-src/examples/pong3d_winner1.tga +0 -0
- data/glfw-src/examples/pong3d_winner2.tga +0 -0
- data/glfw-src/examples/splitview.c +506 -0
- data/glfw-src/examples/triangle.c +108 -0
- data/glfw-src/examples/wave.c +397 -0
- data/glfw-src/images/opengl.gif +0 -0
- data/glfw-src/images/osicert.gif +0 -0
- data/glfw-src/include/GL/glfw.h +486 -0
- data/glfw-src/lib/amigaos/Makefile.amigaos.gcc +128 -0
- data/glfw-src/lib/amigaos/Makefile.amigaos.vbcc +128 -0
- data/glfw-src/lib/amigaos/SDI_compiler.h +94 -0
- data/glfw-src/lib/amigaos/amigaos_enable.c +51 -0
- data/glfw-src/lib/amigaos/amigaos_fullscreen.c +319 -0
- data/glfw-src/lib/amigaos/amigaos_glext.c +61 -0
- data/glfw-src/lib/amigaos/amigaos_init.c +284 -0
- data/glfw-src/lib/amigaos/amigaos_joystick.c +359 -0
- data/glfw-src/lib/amigaos/amigaos_thread.c +494 -0
- data/glfw-src/lib/amigaos/amigaos_time.c +206 -0
- data/glfw-src/lib/amigaos/amigaos_window.c +830 -0
- data/glfw-src/lib/amigaos/platform.h +337 -0
- data/glfw-src/lib/dos/Makefile.dos.djgpp +146 -0
- data/glfw-src/lib/dos/dos_enable.c +51 -0
- data/glfw-src/lib/dos/dos_events.c +173 -0
- data/glfw-src/lib/dos/dos_fullscreen.c +101 -0
- data/glfw-src/lib/dos/dos_glext.c +59 -0
- data/glfw-src/lib/dos/dos_init.c +105 -0
- data/glfw-src/lib/dos/dos_irq.s +246 -0
- data/glfw-src/lib/dos/dos_joystick.c +94 -0
- data/glfw-src/lib/dos/dos_keyboard.c +694 -0
- data/glfw-src/lib/dos/dos_mouse.c +337 -0
- data/glfw-src/lib/dos/dos_thread.c +267 -0
- data/glfw-src/lib/dos/dos_time.c +309 -0
- data/glfw-src/lib/dos/dos_window.c +563 -0
- data/glfw-src/lib/dos/platform.h +341 -0
- data/glfw-src/lib/enable.c +295 -0
- data/glfw-src/lib/fullscreen.c +95 -0
- data/glfw-src/lib/glext.c +201 -0
- data/glfw-src/lib/image.c +629 -0
- data/glfw-src/lib/init.c +108 -0
- data/glfw-src/lib/input.c +280 -0
- data/glfw-src/lib/internal.h +210 -0
- data/glfw-src/lib/joystick.c +101 -0
- data/glfw-src/lib/macosx/Makefile.macosx.gcc +172 -0
- data/glfw-src/lib/macosx/Makefile.macosx.gcc.universal +166 -0
- data/glfw-src/lib/macosx/libglfw.pc.in +11 -0
- data/glfw-src/lib/macosx/macosx_enable.c +42 -0
- data/glfw-src/lib/macosx/macosx_fullscreen.c +126 -0
- data/glfw-src/lib/macosx/macosx_glext.c +52 -0
- data/glfw-src/lib/macosx/macosx_init.c +194 -0
- data/glfw-src/lib/macosx/macosx_joystick.c +50 -0
- data/glfw-src/lib/macosx/macosx_thread.c +414 -0
- data/glfw-src/lib/macosx/macosx_time.c +112 -0
- data/glfw-src/lib/macosx/macosx_window.c +1279 -0
- data/glfw-src/lib/macosx/platform.h +349 -0
- data/glfw-src/lib/stream.c +194 -0
- data/glfw-src/lib/tga.c +405 -0
- data/glfw-src/lib/thread.c +340 -0
- data/glfw-src/lib/time.c +83 -0
- data/glfw-src/lib/win32/Makefile.win32.bcc +265 -0
- data/glfw-src/lib/win32/Makefile.win32.cross-mgw +274 -0
- data/glfw-src/lib/win32/Makefile.win32.cygwin +279 -0
- data/glfw-src/lib/win32/Makefile.win32.lcc +246 -0
- data/glfw-src/lib/win32/Makefile.win32.mgw +243 -0
- data/glfw-src/lib/win32/Makefile.win32.msvc +242 -0
- data/glfw-src/lib/win32/Makefile.win32.ow +242 -0
- data/glfw-src/lib/win32/Makefile.win32.pellesc +242 -0
- data/glfw-src/lib/win32/glfwdll.def +67 -0
- data/glfw-src/lib/win32/glfwdll_mgw1.def +67 -0
- data/glfw-src/lib/win32/glfwdll_mgw2.def +67 -0
- data/glfw-src/lib/win32/glfwdll_pellesc.def +65 -0
- data/glfw-src/lib/win32/libglfw.pc.in +11 -0
- data/glfw-src/lib/win32/platform.h +474 -0
- data/glfw-src/lib/win32/win32_dllmain.c +60 -0
- data/glfw-src/lib/win32/win32_enable.c +155 -0
- data/glfw-src/lib/win32/win32_fullscreen.c +317 -0
- data/glfw-src/lib/win32/win32_glext.c +85 -0
- data/glfw-src/lib/win32/win32_init.c +356 -0
- data/glfw-src/lib/win32/win32_joystick.c +234 -0
- data/glfw-src/lib/win32/win32_thread.c +511 -0
- data/glfw-src/lib/win32/win32_time.c +146 -0
- data/glfw-src/lib/win32/win32_window.c +1714 -0
- data/glfw-src/lib/window.c +727 -0
- data/glfw-src/lib/x11/Makefile.x11.in +243 -0
- data/glfw-src/lib/x11/platform.h +415 -0
- data/glfw-src/lib/x11/x11_enable.c +51 -0
- data/glfw-src/lib/x11/x11_fullscreen.c +524 -0
- data/glfw-src/lib/x11/x11_glext.c +69 -0
- data/glfw-src/lib/x11/x11_init.c +275 -0
- data/glfw-src/lib/x11/x11_joystick.c +371 -0
- data/glfw-src/lib/x11/x11_keysym2unicode.c +902 -0
- data/glfw-src/lib/x11/x11_thread.c +507 -0
- data/glfw-src/lib/x11/x11_time.c +154 -0
- data/glfw-src/lib/x11/x11_window.c +1746 -0
- data/glfw-src/license.txt +21 -0
- data/glfw-src/readme.html +927 -0
- data/glfw-src/support/d/examples/Makefile +59 -0
- data/glfw-src/support/d/examples/boing.d +610 -0
- data/glfw-src/support/d/examples/gears.d +379 -0
- data/glfw-src/support/d/examples/keytest.d +272 -0
- data/glfw-src/support/d/examples/listmodes.d +48 -0
- data/glfw-src/support/d/examples/mipmaps.d +126 -0
- data/glfw-src/support/d/examples/mtbench.d +304 -0
- data/glfw-src/support/d/examples/mthello.d +54 -0
- data/glfw-src/support/d/examples/particles.d +1150 -0
- data/glfw-src/support/d/examples/pong3d.d +840 -0
- data/glfw-src/support/d/examples/splitview.d +486 -0
- data/glfw-src/support/d/examples/triangle.d +108 -0
- data/glfw-src/support/d/examples/wave.d +400 -0
- data/glfw-src/support/d/imports/gl.d +4539 -0
- data/glfw-src/support/d/imports/glfw.d +349 -0
- data/glfw-src/support/d/imports/glu.d +328 -0
- data/glfw-src/support/d/lib/glfwdll.def +64 -0
- data/glfw-src/support/d/lib/glu32.def +56 -0
- data/glfw-src/support/d/lib/makefile +12 -0
- data/glfw-src/support/d/lib/opengl32.def +372 -0
- data/glfw-src/support/d/readme.html +83 -0
- data/glfw-src/support/delphi/examples/Triangle.dpr +105 -0
- data/glfw-src/support/delphi/lib/glfw.pas +437 -0
- data/glfw-src/support/delphi/readme.html +97 -0
- data/glfw-src/support/lua/examples/gears.lua +383 -0
- data/glfw-src/support/lua/examples/test1.lua +68 -0
- data/glfw-src/support/lua/readme.html +128 -0
- data/glfw-src/support/lua/src/luaglfw.c +1179 -0
- data/glfw-src/support/lua/src/luaglfw.h +48 -0
- data/glfw-src/support/lua/src/runlua.c +82 -0
- data/glfw-src/support/masm/examples/fpc.mac +47 -0
- data/glfw-src/support/masm/examples/makeit.bat +66 -0
- data/glfw-src/support/masm/examples/triangle.asm +232 -0
- data/glfw-src/support/masm/include/glfw.inc +326 -0
- data/glfw-src/support/masm/include/glu32.inc +55 -0
- data/glfw-src/support/masm/include/opengl32.inc +372 -0
- data/glfw-src/support/masm/lib/glfwdll.lib +0 -0
- data/glfw-src/support/masm/readme.html +170 -0
- data/glfw-src/support/msvc80/GLFW.sln +26 -0
- data/glfw-src/support/msvc80/GLFW.vcproj +257 -0
- data/glfw-src/support/msvc80/GLFWDLL.vcproj +287 -0
- data/glfw-src/support/visualbasic/bindings/glfw.bas +320 -0
- data/glfw-src/support/visualbasic/bindings/glu32.bas +284 -0
- data/glfw-src/support/visualbasic/bindings/opengl32.bas +999 -0
- data/glfw-src/support/visualbasic/examples/Triangle.bas +101 -0
- data/glfw-src/support/visualbasic/readme.html +164 -0
- data/website/index.html +84 -0
- data/website/style.css +110 -0
- metadata +301 -0
Binary file
|
Binary file
|
@@ -0,0 +1,486 @@
|
|
1
|
+
//========================================================================
|
2
|
+
// GLFW - An OpenGL framework
|
3
|
+
// File: glfw.h
|
4
|
+
// API version: 2.6
|
5
|
+
// WWW: http://glfw.sourceforge.net
|
6
|
+
//------------------------------------------------------------------------
|
7
|
+
// Copyright (c) 2002-2006 Camilla Berglund
|
8
|
+
//
|
9
|
+
// This software is provided 'as-is', without any express or implied
|
10
|
+
// warranty. In no event will the authors be held liable for any damages
|
11
|
+
// arising from the use of this software.
|
12
|
+
//
|
13
|
+
// Permission is granted to anyone to use this software for any purpose,
|
14
|
+
// including commercial applications, and to alter it and redistribute it
|
15
|
+
// freely, subject to the following restrictions:
|
16
|
+
//
|
17
|
+
// 1. The origin of this software must not be misrepresented; you must not
|
18
|
+
// claim that you wrote the original software. If you use this software
|
19
|
+
// in a product, an acknowledgment in the product documentation would
|
20
|
+
// be appreciated but is not required.
|
21
|
+
//
|
22
|
+
// 2. Altered source versions must be plainly marked as such, and must not
|
23
|
+
// be misrepresented as being the original software.
|
24
|
+
//
|
25
|
+
// 3. This notice may not be removed or altered from any source
|
26
|
+
// distribution.
|
27
|
+
//
|
28
|
+
//========================================================================
|
29
|
+
|
30
|
+
#ifndef __glfw_h_
|
31
|
+
#define __glfw_h_
|
32
|
+
|
33
|
+
#ifdef __cplusplus
|
34
|
+
extern "C" {
|
35
|
+
#endif
|
36
|
+
|
37
|
+
|
38
|
+
//========================================================================
|
39
|
+
// Global definitions
|
40
|
+
//========================================================================
|
41
|
+
|
42
|
+
// We need a NULL pointer from time to time
|
43
|
+
#ifndef NULL
|
44
|
+
#ifdef __cplusplus
|
45
|
+
#define NULL 0
|
46
|
+
#else
|
47
|
+
#define NULL ((void *)0)
|
48
|
+
#endif
|
49
|
+
#endif // NULL
|
50
|
+
|
51
|
+
|
52
|
+
// ------------------- BEGIN SYSTEM/COMPILER SPECIFIC --------------------
|
53
|
+
|
54
|
+
// Please report any probles that you find with your compiler, which may
|
55
|
+
// be solved in this section! There are several compilers that I have not
|
56
|
+
// been able to test this file with yet.
|
57
|
+
|
58
|
+
// First: If we are we on Windows, we want a single define for it (_WIN32)
|
59
|
+
// (Note: For Cygwin the compiler flag -mwin32 should be used, but to
|
60
|
+
// make sure that things run smoothly for Cygwin users, we add __CYGWIN__
|
61
|
+
// to the list of "valid Win32 identifiers", which removes the need for
|
62
|
+
// -mwin32)
|
63
|
+
#if !defined(_WIN32) && (defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__))
|
64
|
+
#define _WIN32
|
65
|
+
#endif // _WIN32
|
66
|
+
|
67
|
+
// In order for extension support to be portable, we need to define an
|
68
|
+
// OpenGL function call method. We use the keyword APIENTRY, which is
|
69
|
+
// defined for Win32. (Note: Windows also needs this for <GL/gl.h>)
|
70
|
+
#ifndef APIENTRY
|
71
|
+
#ifdef _WIN32
|
72
|
+
#define APIENTRY __stdcall
|
73
|
+
#else
|
74
|
+
#define APIENTRY
|
75
|
+
#endif
|
76
|
+
#define GL_APIENTRY_DEFINED
|
77
|
+
#endif // APIENTRY
|
78
|
+
|
79
|
+
|
80
|
+
// The following three defines are here solely to make some Windows-based
|
81
|
+
// <GL/gl.h> files happy. Theoretically we could include <windows.h>, but
|
82
|
+
// it has the major drawback of severely polluting our namespace.
|
83
|
+
|
84
|
+
// Under Windows, we need WINGDIAPI defined
|
85
|
+
#if !defined(WINGDIAPI) && defined(_WIN32)
|
86
|
+
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__)
|
87
|
+
// Microsoft Visual C++, Borland C++ Builder and Pelles C
|
88
|
+
#define WINGDIAPI __declspec(dllimport)
|
89
|
+
#elif defined(__LCC__)
|
90
|
+
// LCC-Win32
|
91
|
+
#define WINGDIAPI __stdcall
|
92
|
+
#else
|
93
|
+
// Others (e.g. MinGW, Cygwin)
|
94
|
+
#define WINGDIAPI extern
|
95
|
+
#endif
|
96
|
+
#define GL_WINGDIAPI_DEFINED
|
97
|
+
#endif // WINGDIAPI
|
98
|
+
|
99
|
+
// Some <GL/glu.h> files also need CALLBACK defined
|
100
|
+
#if !defined(CALLBACK) && defined(_WIN32)
|
101
|
+
#if defined(_MSC_VER)
|
102
|
+
// Microsoft Visual C++
|
103
|
+
#if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)
|
104
|
+
#define CALLBACK __stdcall
|
105
|
+
#else
|
106
|
+
#define CALLBACK
|
107
|
+
#endif
|
108
|
+
#else
|
109
|
+
// Other Windows compilers
|
110
|
+
#define CALLBACK __stdcall
|
111
|
+
#endif
|
112
|
+
#define GLU_CALLBACK_DEFINED
|
113
|
+
#endif // CALLBACK
|
114
|
+
|
115
|
+
// Microsoft Visual C++, Borland C++ and Pelles C <GL/glu.h> needs wchar_t
|
116
|
+
#if defined(_WIN32) && (defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__)) && !defined(_WCHAR_T_DEFINED)
|
117
|
+
typedef unsigned short wchar_t;
|
118
|
+
#define _WCHAR_T_DEFINED
|
119
|
+
#endif // _WCHAR_T_DEFINED
|
120
|
+
|
121
|
+
|
122
|
+
// ---------------- GLFW related system specific defines -----------------
|
123
|
+
|
124
|
+
#if defined(_WIN32) && defined(GLFW_BUILD_DLL)
|
125
|
+
|
126
|
+
// We are building a Win32 DLL
|
127
|
+
#define GLFWAPI __declspec(dllexport)
|
128
|
+
#define GLFWAPIENTRY __stdcall
|
129
|
+
#define GLFWCALL __stdcall
|
130
|
+
|
131
|
+
#elif defined(_WIN32) && defined(GLFW_DLL)
|
132
|
+
|
133
|
+
// We are calling a Win32 DLL
|
134
|
+
#if defined(__LCC__)
|
135
|
+
#define GLFWAPI extern
|
136
|
+
#else
|
137
|
+
#define GLFWAPI __declspec(dllimport)
|
138
|
+
#endif
|
139
|
+
#define GLFWAPIENTRY __stdcall
|
140
|
+
#define GLFWCALL __stdcall
|
141
|
+
|
142
|
+
#else
|
143
|
+
|
144
|
+
// We are either building/calling a static lib or we are non-win32
|
145
|
+
#define GLFWAPIENTRY
|
146
|
+
#define GLFWAPI
|
147
|
+
#define GLFWCALL
|
148
|
+
|
149
|
+
#endif
|
150
|
+
|
151
|
+
// -------------------- END SYSTEM/COMPILER SPECIFIC ---------------------
|
152
|
+
|
153
|
+
// Include standard OpenGL headers: GLFW uses GL_FALSE/GL_TRUE, and it is
|
154
|
+
// convenient for the user to only have to include <GL/glfw.h>. This also
|
155
|
+
// solves the problem with Windows <GL/gl.h> and <GL/glu.h> needing some
|
156
|
+
// special defines which normally requires the user to include <windows.h>
|
157
|
+
// (which is not a nice solution for portable programs).
|
158
|
+
#if defined(__APPLE_CC__)
|
159
|
+
#include <OpenGL/gl.h>
|
160
|
+
#include <OpenGL/glu.h>
|
161
|
+
#else
|
162
|
+
#include <GL/gl.h>
|
163
|
+
#include <GL/glu.h>
|
164
|
+
#endif
|
165
|
+
|
166
|
+
|
167
|
+
//========================================================================
|
168
|
+
// GLFW version
|
169
|
+
//========================================================================
|
170
|
+
|
171
|
+
#define GLFW_VERSION_MAJOR 2
|
172
|
+
#define GLFW_VERSION_MINOR 6
|
173
|
+
#define GLFW_VERSION_REVISION 0
|
174
|
+
|
175
|
+
|
176
|
+
//========================================================================
|
177
|
+
// Input handling definitions
|
178
|
+
//========================================================================
|
179
|
+
|
180
|
+
// Key and button state/action definitions
|
181
|
+
#define GLFW_RELEASE 0
|
182
|
+
#define GLFW_PRESS 1
|
183
|
+
|
184
|
+
// Keyboard key definitions: 8-bit ISO-8859-1 (Latin 1) encoding is used
|
185
|
+
// for printable keys (such as A-Z, 0-9 etc), and values above 256
|
186
|
+
// represent special (non-printable) keys (e.g. F1, Page Up etc).
|
187
|
+
#define GLFW_KEY_UNKNOWN -1
|
188
|
+
#define GLFW_KEY_SPACE 32
|
189
|
+
#define GLFW_KEY_SPECIAL 256
|
190
|
+
#define GLFW_KEY_ESC (GLFW_KEY_SPECIAL+1)
|
191
|
+
#define GLFW_KEY_F1 (GLFW_KEY_SPECIAL+2)
|
192
|
+
#define GLFW_KEY_F2 (GLFW_KEY_SPECIAL+3)
|
193
|
+
#define GLFW_KEY_F3 (GLFW_KEY_SPECIAL+4)
|
194
|
+
#define GLFW_KEY_F4 (GLFW_KEY_SPECIAL+5)
|
195
|
+
#define GLFW_KEY_F5 (GLFW_KEY_SPECIAL+6)
|
196
|
+
#define GLFW_KEY_F6 (GLFW_KEY_SPECIAL+7)
|
197
|
+
#define GLFW_KEY_F7 (GLFW_KEY_SPECIAL+8)
|
198
|
+
#define GLFW_KEY_F8 (GLFW_KEY_SPECIAL+9)
|
199
|
+
#define GLFW_KEY_F9 (GLFW_KEY_SPECIAL+10)
|
200
|
+
#define GLFW_KEY_F10 (GLFW_KEY_SPECIAL+11)
|
201
|
+
#define GLFW_KEY_F11 (GLFW_KEY_SPECIAL+12)
|
202
|
+
#define GLFW_KEY_F12 (GLFW_KEY_SPECIAL+13)
|
203
|
+
#define GLFW_KEY_F13 (GLFW_KEY_SPECIAL+14)
|
204
|
+
#define GLFW_KEY_F14 (GLFW_KEY_SPECIAL+15)
|
205
|
+
#define GLFW_KEY_F15 (GLFW_KEY_SPECIAL+16)
|
206
|
+
#define GLFW_KEY_F16 (GLFW_KEY_SPECIAL+17)
|
207
|
+
#define GLFW_KEY_F17 (GLFW_KEY_SPECIAL+18)
|
208
|
+
#define GLFW_KEY_F18 (GLFW_KEY_SPECIAL+19)
|
209
|
+
#define GLFW_KEY_F19 (GLFW_KEY_SPECIAL+20)
|
210
|
+
#define GLFW_KEY_F20 (GLFW_KEY_SPECIAL+21)
|
211
|
+
#define GLFW_KEY_F21 (GLFW_KEY_SPECIAL+22)
|
212
|
+
#define GLFW_KEY_F22 (GLFW_KEY_SPECIAL+23)
|
213
|
+
#define GLFW_KEY_F23 (GLFW_KEY_SPECIAL+24)
|
214
|
+
#define GLFW_KEY_F24 (GLFW_KEY_SPECIAL+25)
|
215
|
+
#define GLFW_KEY_F25 (GLFW_KEY_SPECIAL+26)
|
216
|
+
#define GLFW_KEY_UP (GLFW_KEY_SPECIAL+27)
|
217
|
+
#define GLFW_KEY_DOWN (GLFW_KEY_SPECIAL+28)
|
218
|
+
#define GLFW_KEY_LEFT (GLFW_KEY_SPECIAL+29)
|
219
|
+
#define GLFW_KEY_RIGHT (GLFW_KEY_SPECIAL+30)
|
220
|
+
#define GLFW_KEY_LSHIFT (GLFW_KEY_SPECIAL+31)
|
221
|
+
#define GLFW_KEY_RSHIFT (GLFW_KEY_SPECIAL+32)
|
222
|
+
#define GLFW_KEY_LCTRL (GLFW_KEY_SPECIAL+33)
|
223
|
+
#define GLFW_KEY_RCTRL (GLFW_KEY_SPECIAL+34)
|
224
|
+
#define GLFW_KEY_LALT (GLFW_KEY_SPECIAL+35)
|
225
|
+
#define GLFW_KEY_RALT (GLFW_KEY_SPECIAL+36)
|
226
|
+
#define GLFW_KEY_TAB (GLFW_KEY_SPECIAL+37)
|
227
|
+
#define GLFW_KEY_ENTER (GLFW_KEY_SPECIAL+38)
|
228
|
+
#define GLFW_KEY_BACKSPACE (GLFW_KEY_SPECIAL+39)
|
229
|
+
#define GLFW_KEY_INSERT (GLFW_KEY_SPECIAL+40)
|
230
|
+
#define GLFW_KEY_DEL (GLFW_KEY_SPECIAL+41)
|
231
|
+
#define GLFW_KEY_PAGEUP (GLFW_KEY_SPECIAL+42)
|
232
|
+
#define GLFW_KEY_PAGEDOWN (GLFW_KEY_SPECIAL+43)
|
233
|
+
#define GLFW_KEY_HOME (GLFW_KEY_SPECIAL+44)
|
234
|
+
#define GLFW_KEY_END (GLFW_KEY_SPECIAL+45)
|
235
|
+
#define GLFW_KEY_KP_0 (GLFW_KEY_SPECIAL+46)
|
236
|
+
#define GLFW_KEY_KP_1 (GLFW_KEY_SPECIAL+47)
|
237
|
+
#define GLFW_KEY_KP_2 (GLFW_KEY_SPECIAL+48)
|
238
|
+
#define GLFW_KEY_KP_3 (GLFW_KEY_SPECIAL+49)
|
239
|
+
#define GLFW_KEY_KP_4 (GLFW_KEY_SPECIAL+50)
|
240
|
+
#define GLFW_KEY_KP_5 (GLFW_KEY_SPECIAL+51)
|
241
|
+
#define GLFW_KEY_KP_6 (GLFW_KEY_SPECIAL+52)
|
242
|
+
#define GLFW_KEY_KP_7 (GLFW_KEY_SPECIAL+53)
|
243
|
+
#define GLFW_KEY_KP_8 (GLFW_KEY_SPECIAL+54)
|
244
|
+
#define GLFW_KEY_KP_9 (GLFW_KEY_SPECIAL+55)
|
245
|
+
#define GLFW_KEY_KP_DIVIDE (GLFW_KEY_SPECIAL+56)
|
246
|
+
#define GLFW_KEY_KP_MULTIPLY (GLFW_KEY_SPECIAL+57)
|
247
|
+
#define GLFW_KEY_KP_SUBTRACT (GLFW_KEY_SPECIAL+58)
|
248
|
+
#define GLFW_KEY_KP_ADD (GLFW_KEY_SPECIAL+59)
|
249
|
+
#define GLFW_KEY_KP_DECIMAL (GLFW_KEY_SPECIAL+60)
|
250
|
+
#define GLFW_KEY_KP_EQUAL (GLFW_KEY_SPECIAL+61)
|
251
|
+
#define GLFW_KEY_KP_ENTER (GLFW_KEY_SPECIAL+62)
|
252
|
+
#define GLFW_KEY_LAST GLFW_KEY_KP_ENTER
|
253
|
+
|
254
|
+
// Mouse button definitions
|
255
|
+
#define GLFW_MOUSE_BUTTON_1 0
|
256
|
+
#define GLFW_MOUSE_BUTTON_2 1
|
257
|
+
#define GLFW_MOUSE_BUTTON_3 2
|
258
|
+
#define GLFW_MOUSE_BUTTON_4 3
|
259
|
+
#define GLFW_MOUSE_BUTTON_5 4
|
260
|
+
#define GLFW_MOUSE_BUTTON_6 5
|
261
|
+
#define GLFW_MOUSE_BUTTON_7 6
|
262
|
+
#define GLFW_MOUSE_BUTTON_8 7
|
263
|
+
#define GLFW_MOUSE_BUTTON_LAST GLFW_MOUSE_BUTTON_8
|
264
|
+
|
265
|
+
// Mouse button aliases
|
266
|
+
#define GLFW_MOUSE_BUTTON_LEFT GLFW_MOUSE_BUTTON_1
|
267
|
+
#define GLFW_MOUSE_BUTTON_RIGHT GLFW_MOUSE_BUTTON_2
|
268
|
+
#define GLFW_MOUSE_BUTTON_MIDDLE GLFW_MOUSE_BUTTON_3
|
269
|
+
|
270
|
+
|
271
|
+
// Joystick identifiers
|
272
|
+
#define GLFW_JOYSTICK_1 0
|
273
|
+
#define GLFW_JOYSTICK_2 1
|
274
|
+
#define GLFW_JOYSTICK_3 2
|
275
|
+
#define GLFW_JOYSTICK_4 3
|
276
|
+
#define GLFW_JOYSTICK_5 4
|
277
|
+
#define GLFW_JOYSTICK_6 5
|
278
|
+
#define GLFW_JOYSTICK_7 6
|
279
|
+
#define GLFW_JOYSTICK_8 7
|
280
|
+
#define GLFW_JOYSTICK_9 8
|
281
|
+
#define GLFW_JOYSTICK_10 9
|
282
|
+
#define GLFW_JOYSTICK_11 10
|
283
|
+
#define GLFW_JOYSTICK_12 11
|
284
|
+
#define GLFW_JOYSTICK_13 12
|
285
|
+
#define GLFW_JOYSTICK_14 13
|
286
|
+
#define GLFW_JOYSTICK_15 14
|
287
|
+
#define GLFW_JOYSTICK_16 15
|
288
|
+
#define GLFW_JOYSTICK_LAST GLFW_JOYSTICK_16
|
289
|
+
|
290
|
+
|
291
|
+
//========================================================================
|
292
|
+
// Other definitions
|
293
|
+
//========================================================================
|
294
|
+
|
295
|
+
// glfwOpenWindow modes
|
296
|
+
#define GLFW_WINDOW 0x00010001
|
297
|
+
#define GLFW_FULLSCREEN 0x00010002
|
298
|
+
|
299
|
+
// glfwGetWindowParam tokens
|
300
|
+
#define GLFW_OPENED 0x00020001
|
301
|
+
#define GLFW_ACTIVE 0x00020002
|
302
|
+
#define GLFW_ICONIFIED 0x00020003
|
303
|
+
#define GLFW_ACCELERATED 0x00020004
|
304
|
+
#define GLFW_RED_BITS 0x00020005
|
305
|
+
#define GLFW_GREEN_BITS 0x00020006
|
306
|
+
#define GLFW_BLUE_BITS 0x00020007
|
307
|
+
#define GLFW_ALPHA_BITS 0x00020008
|
308
|
+
#define GLFW_DEPTH_BITS 0x00020009
|
309
|
+
#define GLFW_STENCIL_BITS 0x0002000A
|
310
|
+
|
311
|
+
// The following constants are used for both glfwGetWindowParam
|
312
|
+
// and glfwOpenWindowHint
|
313
|
+
#define GLFW_REFRESH_RATE 0x0002000B
|
314
|
+
#define GLFW_ACCUM_RED_BITS 0x0002000C
|
315
|
+
#define GLFW_ACCUM_GREEN_BITS 0x0002000D
|
316
|
+
#define GLFW_ACCUM_BLUE_BITS 0x0002000E
|
317
|
+
#define GLFW_ACCUM_ALPHA_BITS 0x0002000F
|
318
|
+
#define GLFW_AUX_BUFFERS 0x00020010
|
319
|
+
#define GLFW_STEREO 0x00020011
|
320
|
+
#define GLFW_WINDOW_NO_RESIZE 0x00020012
|
321
|
+
#define GLFW_FSAA_SAMPLES 0x00020013
|
322
|
+
|
323
|
+
// glfwEnable/glfwDisable tokens
|
324
|
+
#define GLFW_MOUSE_CURSOR 0x00030001
|
325
|
+
#define GLFW_STICKY_KEYS 0x00030002
|
326
|
+
#define GLFW_STICKY_MOUSE_BUTTONS 0x00030003
|
327
|
+
#define GLFW_SYSTEM_KEYS 0x00030004
|
328
|
+
#define GLFW_KEY_REPEAT 0x00030005
|
329
|
+
#define GLFW_AUTO_POLL_EVENTS 0x00030006
|
330
|
+
|
331
|
+
// glfwWaitThread wait modes
|
332
|
+
#define GLFW_WAIT 0x00040001
|
333
|
+
#define GLFW_NOWAIT 0x00040002
|
334
|
+
|
335
|
+
// glfwGetJoystickParam tokens
|
336
|
+
#define GLFW_PRESENT 0x00050001
|
337
|
+
#define GLFW_AXES 0x00050002
|
338
|
+
#define GLFW_BUTTONS 0x00050003
|
339
|
+
|
340
|
+
// glfwReadImage/glfwLoadTexture2D flags
|
341
|
+
#define GLFW_NO_RESCALE_BIT 0x00000001 // Only for glfwReadImage
|
342
|
+
#define GLFW_ORIGIN_UL_BIT 0x00000002
|
343
|
+
#define GLFW_BUILD_MIPMAPS_BIT 0x00000004 // Only for glfwLoadTexture2D
|
344
|
+
#define GLFW_ALPHA_MAP_BIT 0x00000008
|
345
|
+
|
346
|
+
// Time spans longer than this (seconds) are considered to be infinity
|
347
|
+
#define GLFW_INFINITY 100000.0
|
348
|
+
|
349
|
+
|
350
|
+
//========================================================================
|
351
|
+
// Typedefs
|
352
|
+
//========================================================================
|
353
|
+
|
354
|
+
// The video mode structure used by glfwGetVideoModes()
|
355
|
+
typedef struct {
|
356
|
+
int Width, Height;
|
357
|
+
int RedBits, BlueBits, GreenBits;
|
358
|
+
} GLFWvidmode;
|
359
|
+
|
360
|
+
// Image/texture information
|
361
|
+
typedef struct {
|
362
|
+
int Width, Height;
|
363
|
+
int Format;
|
364
|
+
int BytesPerPixel;
|
365
|
+
unsigned char *Data;
|
366
|
+
} GLFWimage;
|
367
|
+
|
368
|
+
// Thread ID
|
369
|
+
typedef int GLFWthread;
|
370
|
+
|
371
|
+
// Mutex object
|
372
|
+
typedef void * GLFWmutex;
|
373
|
+
|
374
|
+
// Condition variable object
|
375
|
+
typedef void * GLFWcond;
|
376
|
+
|
377
|
+
// Function pointer types
|
378
|
+
typedef void (GLFWCALL * GLFWwindowsizefun)(int,int);
|
379
|
+
typedef int (GLFWCALL * GLFWwindowclosefun)(void);
|
380
|
+
typedef void (GLFWCALL * GLFWwindowrefreshfun)(void);
|
381
|
+
typedef void (GLFWCALL * GLFWmousebuttonfun)(int,int);
|
382
|
+
typedef void (GLFWCALL * GLFWmouseposfun)(int,int);
|
383
|
+
typedef void (GLFWCALL * GLFWmousewheelfun)(int);
|
384
|
+
typedef void (GLFWCALL * GLFWkeyfun)(int,int);
|
385
|
+
typedef void (GLFWCALL * GLFWcharfun)(int,int);
|
386
|
+
typedef void (GLFWCALL * GLFWthreadfun)(void *);
|
387
|
+
|
388
|
+
|
389
|
+
//========================================================================
|
390
|
+
// Prototypes
|
391
|
+
//========================================================================
|
392
|
+
|
393
|
+
/*! @file glfw.h
|
394
|
+
*/
|
395
|
+
// GLFW initialization, termination and version querying
|
396
|
+
/*! @fn glfwInit
|
397
|
+
*/
|
398
|
+
GLFWAPI int GLFWAPIENTRY glfwInit( void );
|
399
|
+
GLFWAPI void GLFWAPIENTRY glfwTerminate( void );
|
400
|
+
GLFWAPI void GLFWAPIENTRY glfwGetVersion( int *major, int *minor, int *rev );
|
401
|
+
|
402
|
+
// Window handling
|
403
|
+
GLFWAPI int GLFWAPIENTRY glfwOpenWindow( int width, int height, int redbits, int greenbits, int bluebits, int alphabits, int depthbits, int stencilbits, int mode );
|
404
|
+
GLFWAPI void GLFWAPIENTRY glfwOpenWindowHint( int target, int hint );
|
405
|
+
GLFWAPI void GLFWAPIENTRY glfwCloseWindow( void );
|
406
|
+
GLFWAPI void GLFWAPIENTRY glfwSetWindowTitle( const char *title );
|
407
|
+
GLFWAPI void GLFWAPIENTRY glfwGetWindowSize( int *width, int *height );
|
408
|
+
GLFWAPI void GLFWAPIENTRY glfwSetWindowSize( int width, int height );
|
409
|
+
GLFWAPI void GLFWAPIENTRY glfwSetWindowPos( int x, int y );
|
410
|
+
GLFWAPI void GLFWAPIENTRY glfwIconifyWindow( void );
|
411
|
+
GLFWAPI void GLFWAPIENTRY glfwRestoreWindow( void );
|
412
|
+
GLFWAPI void GLFWAPIENTRY glfwSwapBuffers( void );
|
413
|
+
GLFWAPI void GLFWAPIENTRY glfwSwapInterval( int interval );
|
414
|
+
GLFWAPI int GLFWAPIENTRY glfwGetWindowParam( int param );
|
415
|
+
GLFWAPI void GLFWAPIENTRY glfwSetWindowSizeCallback( GLFWwindowsizefun cbfun );
|
416
|
+
GLFWAPI void GLFWAPIENTRY glfwSetWindowCloseCallback( GLFWwindowclosefun cbfun );
|
417
|
+
GLFWAPI void GLFWAPIENTRY glfwSetWindowRefreshCallback( GLFWwindowrefreshfun cbfun );
|
418
|
+
|
419
|
+
// Video mode functions
|
420
|
+
GLFWAPI int GLFWAPIENTRY glfwGetVideoModes( GLFWvidmode *list, int maxcount );
|
421
|
+
GLFWAPI void GLFWAPIENTRY glfwGetDesktopMode( GLFWvidmode *mode );
|
422
|
+
|
423
|
+
// Input handling
|
424
|
+
GLFWAPI void GLFWAPIENTRY glfwPollEvents( void );
|
425
|
+
GLFWAPI void GLFWAPIENTRY glfwWaitEvents( void );
|
426
|
+
GLFWAPI int GLFWAPIENTRY glfwGetKey( int key );
|
427
|
+
GLFWAPI int GLFWAPIENTRY glfwGetMouseButton( int button );
|
428
|
+
GLFWAPI void GLFWAPIENTRY glfwGetMousePos( int *xpos, int *ypos );
|
429
|
+
GLFWAPI void GLFWAPIENTRY glfwSetMousePos( int xpos, int ypos );
|
430
|
+
GLFWAPI int GLFWAPIENTRY glfwGetMouseWheel( void );
|
431
|
+
GLFWAPI void GLFWAPIENTRY glfwSetMouseWheel( int pos );
|
432
|
+
GLFWAPI void GLFWAPIENTRY glfwSetKeyCallback( GLFWkeyfun cbfun );
|
433
|
+
GLFWAPI void GLFWAPIENTRY glfwSetCharCallback( GLFWcharfun cbfun );
|
434
|
+
GLFWAPI void GLFWAPIENTRY glfwSetMouseButtonCallback( GLFWmousebuttonfun cbfun );
|
435
|
+
GLFWAPI void GLFWAPIENTRY glfwSetMousePosCallback( GLFWmouseposfun cbfun );
|
436
|
+
GLFWAPI void GLFWAPIENTRY glfwSetMouseWheelCallback( GLFWmousewheelfun cbfun );
|
437
|
+
|
438
|
+
// Joystick input
|
439
|
+
GLFWAPI int GLFWAPIENTRY glfwGetJoystickParam( int joy, int param );
|
440
|
+
GLFWAPI int GLFWAPIENTRY glfwGetJoystickPos( int joy, float *pos, int numaxes );
|
441
|
+
GLFWAPI int GLFWAPIENTRY glfwGetJoystickButtons( int joy, unsigned char *buttons, int numbuttons );
|
442
|
+
|
443
|
+
// Time
|
444
|
+
GLFWAPI double GLFWAPIENTRY glfwGetTime( void );
|
445
|
+
GLFWAPI void GLFWAPIENTRY glfwSetTime( double time );
|
446
|
+
GLFWAPI void GLFWAPIENTRY glfwSleep( double time );
|
447
|
+
|
448
|
+
// Extension support
|
449
|
+
GLFWAPI int GLFWAPIENTRY glfwExtensionSupported( const char *extension );
|
450
|
+
GLFWAPI void* GLFWAPIENTRY glfwGetProcAddress( const char *procname );
|
451
|
+
GLFWAPI void GLFWAPIENTRY glfwGetGLVersion( int *major, int *minor, int *rev );
|
452
|
+
|
453
|
+
// Threading support
|
454
|
+
GLFWAPI GLFWthread GLFWAPIENTRY glfwCreateThread( GLFWthreadfun fun, void *arg );
|
455
|
+
GLFWAPI void GLFWAPIENTRY glfwDestroyThread( GLFWthread ID );
|
456
|
+
GLFWAPI int GLFWAPIENTRY glfwWaitThread( GLFWthread ID, int waitmode );
|
457
|
+
GLFWAPI GLFWthread GLFWAPIENTRY glfwGetThreadID( void );
|
458
|
+
GLFWAPI GLFWmutex GLFWAPIENTRY glfwCreateMutex( void );
|
459
|
+
GLFWAPI void GLFWAPIENTRY glfwDestroyMutex( GLFWmutex mutex );
|
460
|
+
GLFWAPI void GLFWAPIENTRY glfwLockMutex( GLFWmutex mutex );
|
461
|
+
GLFWAPI void GLFWAPIENTRY glfwUnlockMutex( GLFWmutex mutex );
|
462
|
+
GLFWAPI GLFWcond GLFWAPIENTRY glfwCreateCond( void );
|
463
|
+
GLFWAPI void GLFWAPIENTRY glfwDestroyCond( GLFWcond cond );
|
464
|
+
GLFWAPI void GLFWAPIENTRY glfwWaitCond( GLFWcond cond, GLFWmutex mutex, double timeout );
|
465
|
+
GLFWAPI void GLFWAPIENTRY glfwSignalCond( GLFWcond cond );
|
466
|
+
GLFWAPI void GLFWAPIENTRY glfwBroadcastCond( GLFWcond cond );
|
467
|
+
GLFWAPI int GLFWAPIENTRY glfwGetNumberOfProcessors( void );
|
468
|
+
|
469
|
+
// Enable/disable functions
|
470
|
+
GLFWAPI void GLFWAPIENTRY glfwEnable( int token );
|
471
|
+
GLFWAPI void GLFWAPIENTRY glfwDisable( int token );
|
472
|
+
|
473
|
+
// Image/texture I/O support
|
474
|
+
GLFWAPI int GLFWAPIENTRY glfwReadImage( const char *name, GLFWimage *img, int flags );
|
475
|
+
GLFWAPI int GLFWAPIENTRY glfwReadMemoryImage( const void *data, long size, GLFWimage *img, int flags );
|
476
|
+
GLFWAPI void GLFWAPIENTRY glfwFreeImage( GLFWimage *img );
|
477
|
+
GLFWAPI int GLFWAPIENTRY glfwLoadTexture2D( const char *name, int flags );
|
478
|
+
GLFWAPI int GLFWAPIENTRY glfwLoadMemoryTexture2D( const void *data, long size, int flags );
|
479
|
+
GLFWAPI int GLFWAPIENTRY glfwLoadTextureImage2D( GLFWimage *img, int flags );
|
480
|
+
|
481
|
+
|
482
|
+
#ifdef __cplusplus
|
483
|
+
}
|
484
|
+
#endif
|
485
|
+
|
486
|
+
#endif // __glfw_h_
|