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
@@ -0,0 +1,337 @@
|
|
1
|
+
//========================================================================
|
2
|
+
// GLFW - An OpenGL framework
|
3
|
+
// File: platform.h
|
4
|
+
// Platforms: AmigaOS, MorphOS
|
5
|
+
// API version: 2.6
|
6
|
+
// WWW: http://glfw.sourceforge.net
|
7
|
+
//------------------------------------------------------------------------
|
8
|
+
// Copyright (c) 2002-2006 Camilla Berglund
|
9
|
+
//
|
10
|
+
// This software is provided 'as-is', without any express or implied
|
11
|
+
// warranty. In no event will the authors be held liable for any damages
|
12
|
+
// arising from the use of this software.
|
13
|
+
//
|
14
|
+
// Permission is granted to anyone to use this software for any purpose,
|
15
|
+
// including commercial applications, and to alter it and redistribute it
|
16
|
+
// freely, subject to the following restrictions:
|
17
|
+
//
|
18
|
+
// 1. The origin of this software must not be misrepresented; you must not
|
19
|
+
// claim that you wrote the original software. If you use this software
|
20
|
+
// in a product, an acknowledgment in the product documentation would
|
21
|
+
// be appreciated but is not required.
|
22
|
+
//
|
23
|
+
// 2. Altered source versions must be plainly marked as such, and must not
|
24
|
+
// be misrepresented as being the original software.
|
25
|
+
//
|
26
|
+
// 3. This notice may not be removed or altered from any source
|
27
|
+
// distribution.
|
28
|
+
//
|
29
|
+
//========================================================================
|
30
|
+
|
31
|
+
#ifndef _platform_h_
|
32
|
+
#define _platform_h_
|
33
|
+
|
34
|
+
// First of all: a file that hides compiler specific stuff
|
35
|
+
#include "SDI_compiler.h"
|
36
|
+
|
37
|
+
|
38
|
+
// This is the AmigaOS version of GLFW
|
39
|
+
#define _GLFW_AMIGAOS
|
40
|
+
|
41
|
+
// Are we compiling for MorphOS?
|
42
|
+
#if defined(__MORPHOS__) || defined(MORPHOS)
|
43
|
+
#define _GLFW_MORPHOS
|
44
|
+
#endif
|
45
|
+
|
46
|
+
// Mesa/OpenGL flavour (we only support StormMesa at the moment)
|
47
|
+
#if !defined(_GLFW_STORMMESA)
|
48
|
+
#define _GLFW_STORMMESA
|
49
|
+
#endif
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
// Include files
|
54
|
+
#include <exec/exec.h>
|
55
|
+
#include <dos/dos.h>
|
56
|
+
#include <dos/dostags.h>
|
57
|
+
#include <dos/dosextens.h>
|
58
|
+
#include <intuition/intuition.h>
|
59
|
+
#include <graphics/displayinfo.h>
|
60
|
+
#include <graphics/rastport.h>
|
61
|
+
#include <devices/timer.h>
|
62
|
+
#include <devices/keymap.h>
|
63
|
+
#include <devices/input.h>
|
64
|
+
#include <devices/inputevent.h>
|
65
|
+
#include <devices/gameport.h>
|
66
|
+
|
67
|
+
#include <proto/exec.h>
|
68
|
+
#include <proto/dos.h>
|
69
|
+
#include <proto/intuition.h>
|
70
|
+
#include <proto/graphics.h>
|
71
|
+
#include <proto/timer.h>
|
72
|
+
#include <proto/keymap.h>
|
73
|
+
#include <proto/utility.h>
|
74
|
+
|
75
|
+
#include <clib/alib_protos.h>
|
76
|
+
|
77
|
+
|
78
|
+
// Amiga Mesa/OpenGL implementation dependent include
|
79
|
+
#ifdef _GLFW_STORMMESA
|
80
|
+
#include <GL/Amigamesa.h>
|
81
|
+
#endif
|
82
|
+
|
83
|
+
// MorphOS support
|
84
|
+
#ifdef _GLFW_MORPHOS
|
85
|
+
#include <emul/emulinterface.h>
|
86
|
+
#endif
|
87
|
+
|
88
|
+
// GLFW+GL+GLU defines
|
89
|
+
#ifdef __GNUC__
|
90
|
+
#include "../../include/GL/glfw.h"
|
91
|
+
#else
|
92
|
+
#include "//include/GL/glfw.h"
|
93
|
+
#endif
|
94
|
+
|
95
|
+
|
96
|
+
// Stack size for each thread (in bytes)
|
97
|
+
#define _GLFW_TASK_STACK_SIZE 50000
|
98
|
+
|
99
|
+
|
100
|
+
//========================================================================
|
101
|
+
// Global variables (GLFW internals)
|
102
|
+
//========================================================================
|
103
|
+
|
104
|
+
//------------------------------------------------------------------------
|
105
|
+
// Shared libraries
|
106
|
+
//------------------------------------------------------------------------
|
107
|
+
|
108
|
+
#if defined( _init_c_ )
|
109
|
+
struct GfxBase * GfxBase;
|
110
|
+
struct IntuitionBase * IntuitionBase;
|
111
|
+
struct Library * KeymapBase;
|
112
|
+
struct UtilityBase * UtilityBase;
|
113
|
+
struct Device * TimerBase;
|
114
|
+
#endif
|
115
|
+
|
116
|
+
|
117
|
+
//------------------------------------------------------------------------
|
118
|
+
// Window structure
|
119
|
+
//------------------------------------------------------------------------
|
120
|
+
typedef struct _GLFWwin_struct _GLFWwin;
|
121
|
+
|
122
|
+
struct _GLFWwin_struct {
|
123
|
+
|
124
|
+
// ========= PLATFORM INDEPENDENT MANDATORY PART =========================
|
125
|
+
|
126
|
+
// User callback functions
|
127
|
+
GLFWwindowsizefun WindowSizeCallback;
|
128
|
+
GLFWwindowclosefun WindowCloseCallback;
|
129
|
+
GLFWwindowrefreshfun WindowRefreshCallback;
|
130
|
+
GLFWmousebuttonfun MouseButtonCallback;
|
131
|
+
GLFWmouseposfun MousePosCallback;
|
132
|
+
GLFWmousewheelfun MouseWheelCallback;
|
133
|
+
GLFWkeyfun KeyCallback;
|
134
|
+
GLFWcharfun CharCallback;
|
135
|
+
|
136
|
+
// User selected window settings
|
137
|
+
int Fullscreen; // Fullscreen flag
|
138
|
+
int MouseLock; // Mouse-lock flag
|
139
|
+
int AutoPollEvents; // Auto polling flag
|
140
|
+
int SysKeysDisabled; // System keys disabled flag
|
141
|
+
int WindowNoResize; // Resize- and maximize gadgets disabled flag
|
142
|
+
|
143
|
+
// Window status & parameters
|
144
|
+
int Opened; // Flag telling if window is opened or not
|
145
|
+
int Active; // Application active flag
|
146
|
+
int Iconified; // Window iconified flag
|
147
|
+
int Width, Height; // Window width and heigth
|
148
|
+
int Accelerated; // GL_TRUE if window is HW accelerated
|
149
|
+
int RedBits;
|
150
|
+
int GreenBits;
|
151
|
+
int BlueBits;
|
152
|
+
int AlphaBits;
|
153
|
+
int DepthBits;
|
154
|
+
int StencilBits;
|
155
|
+
int AccumRedBits;
|
156
|
+
int AccumGreenBits;
|
157
|
+
int AccumBlueBits;
|
158
|
+
int AccumAlphaBits;
|
159
|
+
int AuxBuffers;
|
160
|
+
int Stereo;
|
161
|
+
int RefreshRate; // Vertical monitor refresh rate
|
162
|
+
|
163
|
+
// Extensions & OpenGL version
|
164
|
+
int Has_GL_SGIS_generate_mipmap;
|
165
|
+
int Has_GL_ARB_texture_non_power_of_two;
|
166
|
+
int GLVerMajor,GLVerMinor;
|
167
|
+
|
168
|
+
|
169
|
+
// ========= PLATFORM SPECIFIC PART ======================================
|
170
|
+
|
171
|
+
// Platform specific window resources
|
172
|
+
struct Screen *Screen; // Screen handle
|
173
|
+
struct Window *Window; // Window handle
|
174
|
+
ULONG ModeID; // ModeID
|
175
|
+
APTR PointerSprite; // Memory for blank pointer sprite
|
176
|
+
int PointerHidden; // Is pointer hidden?
|
177
|
+
struct MsgPort *InputMP; // Message port (pointer movement)
|
178
|
+
struct IOStdReq *InputIO; // I/O request (pointer movement)
|
179
|
+
|
180
|
+
// Mesa/OpenGL flavour specific
|
181
|
+
#ifdef _GLFW_STORMMESA
|
182
|
+
struct amigamesa_context *Context; // GL context handle
|
183
|
+
#endif
|
184
|
+
|
185
|
+
// Platform specific extensions
|
186
|
+
|
187
|
+
// Various platform specific internal variables
|
188
|
+
|
189
|
+
};
|
190
|
+
|
191
|
+
GLFWGLOBAL _GLFWwin _glfwWin;
|
192
|
+
|
193
|
+
|
194
|
+
//------------------------------------------------------------------------
|
195
|
+
// User input status (most of this should go in _GLFWwin)
|
196
|
+
//------------------------------------------------------------------------
|
197
|
+
GLFWGLOBAL struct {
|
198
|
+
|
199
|
+
// ========= PLATFORM INDEPENDENT MANDATORY PART =========================
|
200
|
+
|
201
|
+
// Mouse status
|
202
|
+
int MousePosX, MousePosY;
|
203
|
+
int WheelPos;
|
204
|
+
char MouseButton[ GLFW_MOUSE_BUTTON_LAST+1 ];
|
205
|
+
|
206
|
+
// Keyboard status
|
207
|
+
char Key[ GLFW_KEY_LAST+1 ];
|
208
|
+
int LastChar;
|
209
|
+
|
210
|
+
// User selected settings
|
211
|
+
int StickyKeys;
|
212
|
+
int StickyMouseButtons;
|
213
|
+
int KeyRepeat;
|
214
|
+
|
215
|
+
|
216
|
+
// ========= PLATFORM SPECIFIC PART ======================================
|
217
|
+
|
218
|
+
// Platform specific internal variables
|
219
|
+
int MouseMoved, OldMouseX, OldMouseY;
|
220
|
+
|
221
|
+
} _glfwInput;
|
222
|
+
|
223
|
+
|
224
|
+
//------------------------------------------------------------------------
|
225
|
+
// Timer status
|
226
|
+
//------------------------------------------------------------------------
|
227
|
+
GLFWGLOBAL struct {
|
228
|
+
struct MsgPort *TimerMP;
|
229
|
+
struct timerequest *TimerIO;
|
230
|
+
double Resolution;
|
231
|
+
long long t0;
|
232
|
+
} _glfwTimer;
|
233
|
+
|
234
|
+
|
235
|
+
//------------------------------------------------------------------------
|
236
|
+
// Thread record (one for each thread)
|
237
|
+
//------------------------------------------------------------------------
|
238
|
+
typedef struct _GLFWthread_struct _GLFWthread;
|
239
|
+
|
240
|
+
struct _GLFWthread_struct {
|
241
|
+
|
242
|
+
// ========= PLATFORM INDEPENDENT MANDATORY PART =========================
|
243
|
+
|
244
|
+
// Pointer to previous and next threads in linked list
|
245
|
+
_GLFWthread *Previous, *Next;
|
246
|
+
|
247
|
+
// GLFW user side thread information
|
248
|
+
GLFWthread ID;
|
249
|
+
|
250
|
+
// ========= PLATFORM SPECIFIC PART ======================================
|
251
|
+
|
252
|
+
// System side thread information
|
253
|
+
GLFWthreadfun Function;
|
254
|
+
void *Arg;
|
255
|
+
struct Process *AmiProc;
|
256
|
+
struct Task *AmiTask;
|
257
|
+
|
258
|
+
// "Wait for" object. Can be a thread, condition variable or NULL.
|
259
|
+
void *WaitFor;
|
260
|
+
int WaitSig;
|
261
|
+
|
262
|
+
// MorphOS support
|
263
|
+
#ifdef _GLFW_MORPHOS
|
264
|
+
struct EmulLibEntry mosEmulLibEntry;
|
265
|
+
#endif
|
266
|
+
};
|
267
|
+
|
268
|
+
|
269
|
+
//------------------------------------------------------------------------
|
270
|
+
// General thread information
|
271
|
+
//------------------------------------------------------------------------
|
272
|
+
GLFWGLOBAL struct {
|
273
|
+
|
274
|
+
// ========= PLATFORM INDEPENDENT MANDATORY PART =========================
|
275
|
+
|
276
|
+
// Next thread ID to use (increments for every created thread)
|
277
|
+
GLFWthread NextID;
|
278
|
+
|
279
|
+
// First thread in linked list (always the main thread)
|
280
|
+
_GLFWthread First;
|
281
|
+
|
282
|
+
// ========= PLATFORM SPECIFIC PART ======================================
|
283
|
+
|
284
|
+
// Critical section lock
|
285
|
+
struct SignalSemaphore CriticalSection;
|
286
|
+
|
287
|
+
// Next condition variable ID (decrements for every created cond)
|
288
|
+
unsigned int NextCondID;
|
289
|
+
|
290
|
+
} _glfwThrd;
|
291
|
+
|
292
|
+
|
293
|
+
//------------------------------------------------------------------------
|
294
|
+
// Joystick information & state
|
295
|
+
//------------------------------------------------------------------------
|
296
|
+
GLFWGLOBAL struct {
|
297
|
+
int Present;
|
298
|
+
int GameDeviceOpen;
|
299
|
+
struct IOStdReq *GameIO;
|
300
|
+
struct MsgPort *GameMP;
|
301
|
+
struct InputEvent GameEvent;
|
302
|
+
float Axis[ 2 ];
|
303
|
+
unsigned char Button[ 2 ];
|
304
|
+
} _glfwJoy;
|
305
|
+
|
306
|
+
|
307
|
+
//========================================================================
|
308
|
+
// Macros for encapsulating critical code sections (i.e. making parts
|
309
|
+
// of GLFW thread safe)
|
310
|
+
//========================================================================
|
311
|
+
|
312
|
+
// Thread list management
|
313
|
+
#define ENTER_THREAD_CRITICAL_SECTION ObtainSemaphore( &_glfwThrd.CriticalSection );
|
314
|
+
#define LEAVE_THREAD_CRITICAL_SECTION ReleaseSemaphore( &_glfwThrd.CriticalSection );
|
315
|
+
|
316
|
+
|
317
|
+
//========================================================================
|
318
|
+
// Prototypes for platform specific internal functions
|
319
|
+
//========================================================================
|
320
|
+
|
321
|
+
// Time
|
322
|
+
int _glfwInitTimer( void );
|
323
|
+
void _glfwTerminateTimer( void );
|
324
|
+
|
325
|
+
// Fullscreen
|
326
|
+
int _glfwOpenScreen( int *width, int *height, int *r, int *g, int *b,
|
327
|
+
int refresh );
|
328
|
+
int _glfwGetClosestVideoMode( int *w, int *h, int *r, int *g, int *b,
|
329
|
+
int refresh );
|
330
|
+
void _glfwGetModeIDInfo( ULONG ModeID, int *w, int *h, int *r, int *g,
|
331
|
+
int *b, int *refresh );
|
332
|
+
// Joystick
|
333
|
+
void _glfwInitJoysticks( void );
|
334
|
+
void _glfwTerminateJoysticks( void );
|
335
|
+
|
336
|
+
|
337
|
+
#endif // _platform_h_
|
@@ -0,0 +1,146 @@
|
|
1
|
+
##########################################################################
|
2
|
+
# Makefile for GLFW on DOS using DJGPP.
|
3
|
+
#-------------------------------------------------------------------------
|
4
|
+
# To compile GLFW using this makefile, run:
|
5
|
+
# make -f Makefile.dos.djgpp
|
6
|
+
# NOTE: You need long filename support (e.g. compile under Windows9x or
|
7
|
+
# use a LFN driver such as DOSLFN)
|
8
|
+
##########################################################################
|
9
|
+
|
10
|
+
##########################################################################
|
11
|
+
# Default: Build static library version of GLFW
|
12
|
+
##########################################################################
|
13
|
+
default: libglfw.a
|
14
|
+
|
15
|
+
|
16
|
+
##########################################################################
|
17
|
+
# GLFW version
|
18
|
+
##########################################################################
|
19
|
+
VERMAJOR = 2
|
20
|
+
VERMINOR = 4
|
21
|
+
|
22
|
+
|
23
|
+
##########################################################################
|
24
|
+
# Compiler settings
|
25
|
+
##########################################################################
|
26
|
+
CC = gcc
|
27
|
+
CFLAGS = -c -I. -I.. -Wall -Os
|
28
|
+
|
29
|
+
# Some modules should be optimized for speed (e.g. image decoding)
|
30
|
+
CFLAGS_SPEED = -c -I. -I.. -Wall -O3 -ffast-math
|
31
|
+
|
32
|
+
|
33
|
+
##########################################################################
|
34
|
+
# Library builder settings
|
35
|
+
##########################################################################
|
36
|
+
MKLIB = ar
|
37
|
+
LIBFLAGS = -rcs
|
38
|
+
|
39
|
+
|
40
|
+
##########################################################################
|
41
|
+
# Object files which are part of the GLFW library
|
42
|
+
##########################################################################
|
43
|
+
OBJS = \
|
44
|
+
enable.o \
|
45
|
+
fullscreen.o \
|
46
|
+
glext.o \
|
47
|
+
image.o \
|
48
|
+
init.o \
|
49
|
+
input.o \
|
50
|
+
joystick.o \
|
51
|
+
tga.o \
|
52
|
+
thread.o \
|
53
|
+
time.o \
|
54
|
+
window.o \
|
55
|
+
dos_enable.o \
|
56
|
+
dos_events.o \
|
57
|
+
dos_fullscreen.o \
|
58
|
+
dos_glext.o \
|
59
|
+
dos_init.o \
|
60
|
+
dos_irq.o \
|
61
|
+
dos_joystick.o \
|
62
|
+
dos_keyboard.o \
|
63
|
+
dos_mouse.o \
|
64
|
+
dos_thread.o \
|
65
|
+
dos_time.o \
|
66
|
+
dos_window.o
|
67
|
+
|
68
|
+
|
69
|
+
##########################################################################
|
70
|
+
# Rule for building library
|
71
|
+
##########################################################################
|
72
|
+
libglfw.a: $(OBJS)
|
73
|
+
$(MKLIB) $(LIBFLAGS) $@ $(OBJS)
|
74
|
+
|
75
|
+
|
76
|
+
##########################################################################
|
77
|
+
# Rules for building library object files
|
78
|
+
##########################################################################
|
79
|
+
enable.o: ..\\enable.c ..\\internal.h platform.h
|
80
|
+
$(CC) $(CFLAGS) -o $@ ..\\enable.c
|
81
|
+
|
82
|
+
fullscreen.o: ..\\fullscreen.c ..\\internal.h platform.h
|
83
|
+
$(CC) $(CFLAGS) -o $@ ..\\fullscreen.c
|
84
|
+
|
85
|
+
glext.o: ..\\glext.c ..\\internal.h platform.h
|
86
|
+
$(CC) $(CFLAGS) -o $@ ..\\glext.c
|
87
|
+
|
88
|
+
image.o: ..\\image.c ..\\internal.h platform.h
|
89
|
+
$(CC) $(CFLAGS_SPEED) -o $@ ..\\image.c
|
90
|
+
|
91
|
+
init.o: ..\\init.c ..\\internal.h platform.h
|
92
|
+
$(CC) $(CFLAGS) -o $@ ..\\init.c
|
93
|
+
|
94
|
+
input.o: ..\\input.c ..\\internal.h platform.h
|
95
|
+
$(CC) $(CFLAGS) -o $@ ..\\input.c
|
96
|
+
|
97
|
+
joystick.o: ..\\joystick.c ..\\internal.h platform.h
|
98
|
+
$(CC) $(CFLAGS) -o $@ ..\\joystick.c
|
99
|
+
|
100
|
+
tga.o: ..\\tga.c ..\\internal.h platform.h
|
101
|
+
$(CC) $(CFLAGS_SPEED) -o $@ ..\\tga.c
|
102
|
+
|
103
|
+
thread.o: ..\\thread.c ..\\internal.h platform.h
|
104
|
+
$(CC) $(CFLAGS) -o $@ ..\\thread.c
|
105
|
+
|
106
|
+
time.o: ..\\time.c ..\\internal.h platform.h
|
107
|
+
$(CC) $(CFLAGS) -o $@ ..\\time.c
|
108
|
+
|
109
|
+
window.o: ..\\window.c ..\\internal.h platform.h
|
110
|
+
$(CC) $(CFLAGS) -o $@ ..\\window.c
|
111
|
+
|
112
|
+
dos_enable.o: dos_enable.c ..\\internal.h platform.h
|
113
|
+
$(CC) $(CFLAGS) -o $@ dos_enable.c
|
114
|
+
|
115
|
+
dos_events.o: dos_events.c ..\\internal.h platform.h
|
116
|
+
$(CC) $(CFLAGS) -o $@ dos_events.c
|
117
|
+
|
118
|
+
dos_fullscreen.o: dos_fullscreen.c ..\\internal.h platform.h
|
119
|
+
$(CC) $(CFLAGS) -o $@ dos_fullscreen.c
|
120
|
+
|
121
|
+
dos_glext.o: dos_glext.c ..\\internal.h platform.h
|
122
|
+
$(CC) $(CFLAGS) -o $@ dos_glext.c
|
123
|
+
|
124
|
+
dos_init.o: dos_init.c ..\\internal.h platform.h
|
125
|
+
$(CC) $(CFLAGS) -o $@ dos_init.c
|
126
|
+
|
127
|
+
dos_irq.o: dos_irq.s ..\\internal.h platform.h
|
128
|
+
$(CC) $(CFLAGS) -x assembler-with-cpp -o $@ dos_irq.s
|
129
|
+
|
130
|
+
dos_joystick.o: dos_joystick.c ..\\internal.h platform.h
|
131
|
+
$(CC) $(CFLAGS) -o $@ dos_joystick.c
|
132
|
+
|
133
|
+
dos_keyboard.o: dos_keyboard.c ..\\internal.h platform.h
|
134
|
+
$(CC) $(CFLAGS) -o $@ dos_keyboard.c
|
135
|
+
|
136
|
+
dos_mouse.o: dos_mouse.c ..\\internal.h platform.h
|
137
|
+
$(CC) $(CFLAGS) -o $@ dos_mouse.c
|
138
|
+
|
139
|
+
dos_thread.o: dos_thread.c ..\\internal.h platform.h
|
140
|
+
$(CC) $(CFLAGS) -o $@ dos_thread.c
|
141
|
+
|
142
|
+
dos_time.o: dos_time.c ..\\internal.h platform.h
|
143
|
+
$(CC) $(CFLAGS) -o $@ dos_time.c
|
144
|
+
|
145
|
+
dos_window.o: dos_window.c ..\\internal.h platform.h
|
146
|
+
$(CC) $(CFLAGS) -o $@ dos_window.c
|