ruby-glfw 0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. data/README +1 -0
  2. data/README.API +73 -0
  3. data/Rakefile +120 -0
  4. data/examples/boing.rb +519 -0
  5. data/examples/gears.rb +327 -0
  6. data/examples/keytest.rb +117 -0
  7. data/examples/listmodes.rb +20 -0
  8. data/examples/mipmaps.rb +104 -0
  9. data/examples/mipmaps.tga +0 -0
  10. data/examples/particles.rb +837 -0
  11. data/examples/pong3d.rb +741 -0
  12. data/examples/pong3d_field.tga +0 -0
  13. data/examples/pong3d_instr.tga +0 -0
  14. data/examples/pong3d_menu.tga +0 -0
  15. data/examples/pong3d_title.tga +0 -0
  16. data/examples/pong3d_winner1.tga +0 -0
  17. data/examples/pong3d_winner2.tga +0 -0
  18. data/examples/splitview.rb +432 -0
  19. data/examples/triangle.rb +89 -0
  20. data/examples/wave.rb +294 -0
  21. data/ext/glfw/glfw.c +1094 -0
  22. data/ext/glfw/mkrf_conf.rb +70 -0
  23. data/glfw-src/Makefile +220 -0
  24. data/glfw-src/compile.ami +61 -0
  25. data/glfw-src/compile.bat +217 -0
  26. data/glfw-src/compile.sh +607 -0
  27. data/glfw-src/docs/Makefile +57 -0
  28. data/glfw-src/docs/Reference.pdf +0 -0
  29. data/glfw-src/docs/UsersGuide.pdf +0 -0
  30. data/glfw-src/docs/cleanup.bat +22 -0
  31. data/glfw-src/docs/glfwdoc.sty +80 -0
  32. data/glfw-src/docs/glfwrm.tex +3034 -0
  33. data/glfw-src/docs/glfwug.tex +2024 -0
  34. data/glfw-src/docs/readme.txt +80 -0
  35. data/glfw-src/examples/Makefile.amigaos.gcc +70 -0
  36. data/glfw-src/examples/Makefile.amigaos.vbcc +70 -0
  37. data/glfw-src/examples/Makefile.dos.djgpp +71 -0
  38. data/glfw-src/examples/Makefile.macosx.gcc +96 -0
  39. data/glfw-src/examples/Makefile.win32.bcc +75 -0
  40. data/glfw-src/examples/Makefile.win32.cross-mgw +79 -0
  41. data/glfw-src/examples/Makefile.win32.cygwin +79 -0
  42. data/glfw-src/examples/Makefile.win32.lcc +74 -0
  43. data/glfw-src/examples/Makefile.win32.mgw +75 -0
  44. data/glfw-src/examples/Makefile.win32.msvc +74 -0
  45. data/glfw-src/examples/Makefile.win32.ow +74 -0
  46. data/glfw-src/examples/Makefile.win32.pellesc +74 -0
  47. data/glfw-src/examples/Makefile.x11.in +54 -0
  48. data/glfw-src/examples/boing.c +606 -0
  49. data/glfw-src/examples/bundle.sh +46 -0
  50. data/glfw-src/examples/gears.c +382 -0
  51. data/glfw-src/examples/keytest.c +264 -0
  52. data/glfw-src/examples/listmodes.c +48 -0
  53. data/glfw-src/examples/mipmaps.c +126 -0
  54. data/glfw-src/examples/mipmaps.tga +0 -0
  55. data/glfw-src/examples/mtbench.c +301 -0
  56. data/glfw-src/examples/mthello.c +48 -0
  57. data/glfw-src/examples/particles.c +1148 -0
  58. data/glfw-src/examples/pong3d.c +839 -0
  59. data/glfw-src/examples/pong3d_field.tga +0 -0
  60. data/glfw-src/examples/pong3d_instr.tga +0 -0
  61. data/glfw-src/examples/pong3d_menu.tga +0 -0
  62. data/glfw-src/examples/pong3d_title.tga +0 -0
  63. data/glfw-src/examples/pong3d_winner1.tga +0 -0
  64. data/glfw-src/examples/pong3d_winner2.tga +0 -0
  65. data/glfw-src/examples/splitview.c +506 -0
  66. data/glfw-src/examples/triangle.c +108 -0
  67. data/glfw-src/examples/wave.c +397 -0
  68. data/glfw-src/images/opengl.gif +0 -0
  69. data/glfw-src/images/osicert.gif +0 -0
  70. data/glfw-src/include/GL/glfw.h +486 -0
  71. data/glfw-src/lib/amigaos/Makefile.amigaos.gcc +128 -0
  72. data/glfw-src/lib/amigaos/Makefile.amigaos.vbcc +128 -0
  73. data/glfw-src/lib/amigaos/SDI_compiler.h +94 -0
  74. data/glfw-src/lib/amigaos/amigaos_enable.c +51 -0
  75. data/glfw-src/lib/amigaos/amigaos_fullscreen.c +319 -0
  76. data/glfw-src/lib/amigaos/amigaos_glext.c +61 -0
  77. data/glfw-src/lib/amigaos/amigaos_init.c +284 -0
  78. data/glfw-src/lib/amigaos/amigaos_joystick.c +359 -0
  79. data/glfw-src/lib/amigaos/amigaos_thread.c +494 -0
  80. data/glfw-src/lib/amigaos/amigaos_time.c +206 -0
  81. data/glfw-src/lib/amigaos/amigaos_window.c +830 -0
  82. data/glfw-src/lib/amigaos/platform.h +337 -0
  83. data/glfw-src/lib/dos/Makefile.dos.djgpp +146 -0
  84. data/glfw-src/lib/dos/dos_enable.c +51 -0
  85. data/glfw-src/lib/dos/dos_events.c +173 -0
  86. data/glfw-src/lib/dos/dos_fullscreen.c +101 -0
  87. data/glfw-src/lib/dos/dos_glext.c +59 -0
  88. data/glfw-src/lib/dos/dos_init.c +105 -0
  89. data/glfw-src/lib/dos/dos_irq.s +246 -0
  90. data/glfw-src/lib/dos/dos_joystick.c +94 -0
  91. data/glfw-src/lib/dos/dos_keyboard.c +694 -0
  92. data/glfw-src/lib/dos/dos_mouse.c +337 -0
  93. data/glfw-src/lib/dos/dos_thread.c +267 -0
  94. data/glfw-src/lib/dos/dos_time.c +309 -0
  95. data/glfw-src/lib/dos/dos_window.c +563 -0
  96. data/glfw-src/lib/dos/platform.h +341 -0
  97. data/glfw-src/lib/enable.c +295 -0
  98. data/glfw-src/lib/fullscreen.c +95 -0
  99. data/glfw-src/lib/glext.c +201 -0
  100. data/glfw-src/lib/image.c +629 -0
  101. data/glfw-src/lib/init.c +108 -0
  102. data/glfw-src/lib/input.c +280 -0
  103. data/glfw-src/lib/internal.h +210 -0
  104. data/glfw-src/lib/joystick.c +101 -0
  105. data/glfw-src/lib/macosx/Makefile.macosx.gcc +172 -0
  106. data/glfw-src/lib/macosx/Makefile.macosx.gcc.universal +166 -0
  107. data/glfw-src/lib/macosx/libglfw.pc.in +11 -0
  108. data/glfw-src/lib/macosx/macosx_enable.c +42 -0
  109. data/glfw-src/lib/macosx/macosx_fullscreen.c +126 -0
  110. data/glfw-src/lib/macosx/macosx_glext.c +52 -0
  111. data/glfw-src/lib/macosx/macosx_init.c +194 -0
  112. data/glfw-src/lib/macosx/macosx_joystick.c +50 -0
  113. data/glfw-src/lib/macosx/macosx_thread.c +414 -0
  114. data/glfw-src/lib/macosx/macosx_time.c +112 -0
  115. data/glfw-src/lib/macosx/macosx_window.c +1279 -0
  116. data/glfw-src/lib/macosx/platform.h +349 -0
  117. data/glfw-src/lib/stream.c +194 -0
  118. data/glfw-src/lib/tga.c +405 -0
  119. data/glfw-src/lib/thread.c +340 -0
  120. data/glfw-src/lib/time.c +83 -0
  121. data/glfw-src/lib/win32/Makefile.win32.bcc +265 -0
  122. data/glfw-src/lib/win32/Makefile.win32.cross-mgw +274 -0
  123. data/glfw-src/lib/win32/Makefile.win32.cygwin +279 -0
  124. data/glfw-src/lib/win32/Makefile.win32.lcc +246 -0
  125. data/glfw-src/lib/win32/Makefile.win32.mgw +243 -0
  126. data/glfw-src/lib/win32/Makefile.win32.msvc +242 -0
  127. data/glfw-src/lib/win32/Makefile.win32.ow +242 -0
  128. data/glfw-src/lib/win32/Makefile.win32.pellesc +242 -0
  129. data/glfw-src/lib/win32/glfwdll.def +67 -0
  130. data/glfw-src/lib/win32/glfwdll_mgw1.def +67 -0
  131. data/glfw-src/lib/win32/glfwdll_mgw2.def +67 -0
  132. data/glfw-src/lib/win32/glfwdll_pellesc.def +65 -0
  133. data/glfw-src/lib/win32/libglfw.pc.in +11 -0
  134. data/glfw-src/lib/win32/platform.h +474 -0
  135. data/glfw-src/lib/win32/win32_dllmain.c +60 -0
  136. data/glfw-src/lib/win32/win32_enable.c +155 -0
  137. data/glfw-src/lib/win32/win32_fullscreen.c +317 -0
  138. data/glfw-src/lib/win32/win32_glext.c +85 -0
  139. data/glfw-src/lib/win32/win32_init.c +356 -0
  140. data/glfw-src/lib/win32/win32_joystick.c +234 -0
  141. data/glfw-src/lib/win32/win32_thread.c +511 -0
  142. data/glfw-src/lib/win32/win32_time.c +146 -0
  143. data/glfw-src/lib/win32/win32_window.c +1714 -0
  144. data/glfw-src/lib/window.c +727 -0
  145. data/glfw-src/lib/x11/Makefile.x11.in +243 -0
  146. data/glfw-src/lib/x11/platform.h +415 -0
  147. data/glfw-src/lib/x11/x11_enable.c +51 -0
  148. data/glfw-src/lib/x11/x11_fullscreen.c +524 -0
  149. data/glfw-src/lib/x11/x11_glext.c +69 -0
  150. data/glfw-src/lib/x11/x11_init.c +275 -0
  151. data/glfw-src/lib/x11/x11_joystick.c +371 -0
  152. data/glfw-src/lib/x11/x11_keysym2unicode.c +902 -0
  153. data/glfw-src/lib/x11/x11_thread.c +507 -0
  154. data/glfw-src/lib/x11/x11_time.c +154 -0
  155. data/glfw-src/lib/x11/x11_window.c +1746 -0
  156. data/glfw-src/license.txt +21 -0
  157. data/glfw-src/readme.html +927 -0
  158. data/glfw-src/support/d/examples/Makefile +59 -0
  159. data/glfw-src/support/d/examples/boing.d +610 -0
  160. data/glfw-src/support/d/examples/gears.d +379 -0
  161. data/glfw-src/support/d/examples/keytest.d +272 -0
  162. data/glfw-src/support/d/examples/listmodes.d +48 -0
  163. data/glfw-src/support/d/examples/mipmaps.d +126 -0
  164. data/glfw-src/support/d/examples/mtbench.d +304 -0
  165. data/glfw-src/support/d/examples/mthello.d +54 -0
  166. data/glfw-src/support/d/examples/particles.d +1150 -0
  167. data/glfw-src/support/d/examples/pong3d.d +840 -0
  168. data/glfw-src/support/d/examples/splitview.d +486 -0
  169. data/glfw-src/support/d/examples/triangle.d +108 -0
  170. data/glfw-src/support/d/examples/wave.d +400 -0
  171. data/glfw-src/support/d/imports/gl.d +4539 -0
  172. data/glfw-src/support/d/imports/glfw.d +349 -0
  173. data/glfw-src/support/d/imports/glu.d +328 -0
  174. data/glfw-src/support/d/lib/glfwdll.def +64 -0
  175. data/glfw-src/support/d/lib/glu32.def +56 -0
  176. data/glfw-src/support/d/lib/makefile +12 -0
  177. data/glfw-src/support/d/lib/opengl32.def +372 -0
  178. data/glfw-src/support/d/readme.html +83 -0
  179. data/glfw-src/support/delphi/examples/Triangle.dpr +105 -0
  180. data/glfw-src/support/delphi/lib/glfw.pas +437 -0
  181. data/glfw-src/support/delphi/readme.html +97 -0
  182. data/glfw-src/support/lua/examples/gears.lua +383 -0
  183. data/glfw-src/support/lua/examples/test1.lua +68 -0
  184. data/glfw-src/support/lua/readme.html +128 -0
  185. data/glfw-src/support/lua/src/luaglfw.c +1179 -0
  186. data/glfw-src/support/lua/src/luaglfw.h +48 -0
  187. data/glfw-src/support/lua/src/runlua.c +82 -0
  188. data/glfw-src/support/masm/examples/fpc.mac +47 -0
  189. data/glfw-src/support/masm/examples/makeit.bat +66 -0
  190. data/glfw-src/support/masm/examples/triangle.asm +232 -0
  191. data/glfw-src/support/masm/include/glfw.inc +326 -0
  192. data/glfw-src/support/masm/include/glu32.inc +55 -0
  193. data/glfw-src/support/masm/include/opengl32.inc +372 -0
  194. data/glfw-src/support/masm/lib/glfwdll.lib +0 -0
  195. data/glfw-src/support/masm/readme.html +170 -0
  196. data/glfw-src/support/msvc80/GLFW.sln +26 -0
  197. data/glfw-src/support/msvc80/GLFW.vcproj +257 -0
  198. data/glfw-src/support/msvc80/GLFWDLL.vcproj +287 -0
  199. data/glfw-src/support/visualbasic/bindings/glfw.bas +320 -0
  200. data/glfw-src/support/visualbasic/bindings/glu32.bas +284 -0
  201. data/glfw-src/support/visualbasic/bindings/opengl32.bas +999 -0
  202. data/glfw-src/support/visualbasic/examples/Triangle.bas +101 -0
  203. data/glfw-src/support/visualbasic/readme.html +164 -0
  204. data/website/index.html +84 -0
  205. data/website/style.css +110 -0
  206. metadata +301 -0
@@ -0,0 +1,83 @@
1
+ //========================================================================
2
+ // GLFW - An OpenGL framework
3
+ // File: time.c
4
+ // Platform: Any
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
+ #include "internal.h"
32
+
33
+
34
+ //************************************************************************
35
+ //**** GLFW user functions ****
36
+ //************************************************************************
37
+
38
+ //========================================================================
39
+ // glfwGetTime() - Return timer value in seconds
40
+ //========================================================================
41
+
42
+ GLFWAPI double GLFWAPIENTRY glfwGetTime( void )
43
+ {
44
+ // Is GLFW initialized?
45
+ if( !_glfwInitialized )
46
+ {
47
+ return 0.0;
48
+ }
49
+
50
+ return _glfwPlatformGetTime();
51
+ }
52
+
53
+
54
+ //========================================================================
55
+ // glfwSetTime() - Set timer value in seconds
56
+ //========================================================================
57
+
58
+ GLFWAPI void GLFWAPIENTRY glfwSetTime( double time )
59
+ {
60
+ // Is GLFW initialized?
61
+ if( !_glfwInitialized )
62
+ {
63
+ return;
64
+ }
65
+
66
+ _glfwPlatformSetTime( time );
67
+ }
68
+
69
+
70
+ //========================================================================
71
+ // glfwSleep() - Put a thread to sleep for a specified amount of time
72
+ //========================================================================
73
+
74
+ GLFWAPI void GLFWAPIENTRY glfwSleep( double time )
75
+ {
76
+ // Is GLFW initialized?
77
+ if( !_glfwInitialized )
78
+ {
79
+ return;
80
+ }
81
+
82
+ _glfwPlatformSleep( time );
83
+ }
@@ -0,0 +1,265 @@
1
+ ##########################################################################
2
+ # Makefile for GLFW on Windows using Borland C++ Builder Compiler 5.x.
3
+ #-------------------------------------------------------------------------
4
+ # To compile GLFW using this makefile, run:
5
+ # make -f Makefile.win32.bcc
6
+ ##########################################################################
7
+
8
+ ##########################################################################
9
+ # Default: Build static and dynamic versions of GLFW
10
+ ##########################################################################
11
+ default: glfw.lib glfw.dll
12
+
13
+
14
+ ##########################################################################
15
+ # GLFW version
16
+ ##########################################################################
17
+ VERMAJOR = 2
18
+ VERMINOR = 5
19
+
20
+
21
+ ##########################################################################
22
+ # Compiler settings
23
+ ##########################################################################
24
+ CC = bcc32
25
+ CFLAGS = -c -O1 -q -w -I. -I..
26
+ CFLAGS_DLL = $(CFLAGS) -DGLFW_BUILD_DLL
27
+
28
+ # Some modules should be optimized for speed (e.g. image decoding)
29
+ CFLAGS_SPEED = -c -O2 -OS -Ov -q -w -I. -I..
30
+ CFLAGS_SPEED_DLL = $(CFLAGS_SPEED) -DGLFW_BUILD_DLL
31
+
32
+
33
+ ##########################################################################
34
+ # Library builder settings
35
+ ##########################################################################
36
+ # Static library
37
+ MKLIB = tlib
38
+ LIBFLAGS =
39
+
40
+ # DLL
41
+ LINK = bcc32
42
+ LINKFLAGS = -tWD -q -v-
43
+ IMPLIB = implib
44
+
45
+
46
+ ##########################################################################
47
+ # Object files for static library
48
+ ##########################################################################
49
+ OBJS = \
50
+ enable.obj \
51
+ fullscreen.obj \
52
+ glext.obj \
53
+ image.obj \
54
+ init.obj \
55
+ input.obj \
56
+ joystick.obj \
57
+ stream.obj \
58
+ tga.obj \
59
+ thread.obj \
60
+ time.obj \
61
+ window.obj \
62
+ win32_enable.obj \
63
+ win32_fullscreen.obj \
64
+ win32_glext.obj \
65
+ win32_init.obj \
66
+ win32_joystick.obj \
67
+ win32_thread.obj \
68
+ win32_time.obj \
69
+ win32_window.obj
70
+
71
+ OBJS2 = \
72
+ +enable.obj \
73
+ +fullscreen.obj \
74
+ +glext.obj \
75
+ +image.obj \
76
+ +init.obj \
77
+ +input.obj \
78
+ +joystick.obj \
79
+ +stream.obj \
80
+ +tga.obj \
81
+ +thread.obj \
82
+ +time.obj \
83
+ +window.obj \
84
+ +win32_enable.obj \
85
+ +win32_fullscreen.obj \
86
+ +win32_glext.obj \
87
+ +win32_init.obj \
88
+ +win32_joystick.obj \
89
+ +win32_thread.obj \
90
+ +win32_time.obj \
91
+ +win32_window.obj
92
+
93
+
94
+ ##########################################################################
95
+ # Object files for dynamic library
96
+ ##########################################################################
97
+ DLLOBJS = \
98
+ enable_dll.obj \
99
+ fullscreen_dll.obj \
100
+ glext_dll.obj \
101
+ image_dll.obj \
102
+ init_dll.obj \
103
+ input_dll.obj \
104
+ joystick_dll.obj \
105
+ stream_dll.obj \
106
+ tga_dll.obj \
107
+ thread_dll.obj \
108
+ time_dll.obj \
109
+ window_dll.obj \
110
+ win32_dllmain_dll.obj \
111
+ win32_enable_dll.obj \
112
+ win32_fullscreen_dll.obj \
113
+ win32_glext_dll.obj \
114
+ win32_init_dll.obj \
115
+ win32_joystick_dll.obj \
116
+ win32_thread_dll.obj \
117
+ win32_time_dll.obj \
118
+ win32_window_dll.obj
119
+
120
+
121
+
122
+ ##########################################################################
123
+ # Rule for building static library
124
+ ##########################################################################
125
+ glfw.lib: $(OBJS)
126
+ $(MKLIB) $(LIBFLAGS) glfw.lib $(OBJS2)
127
+
128
+
129
+ ##########################################################################
130
+ # Rule for building dynamic library
131
+ ##########################################################################
132
+ glfw.dll: $(DLLOBJS)
133
+ $(LINK) -e$@ $(LINKFLAGS) $(DLLOBJS)
134
+ $(IMPLIB) glfwdll.lib glfwdll.def
135
+
136
+
137
+ ##########################################################################
138
+ # Rules for building static library object files
139
+ ##########################################################################
140
+ enable.obj: ..\\enable.c ..\\internal.h platform.h
141
+ $(CC) $(CFLAGS) -o$@ ..\\enable.c
142
+
143
+ fullscreen.obj: ..\\fullscreen.c ..\\internal.h platform.h
144
+ $(CC) $(CFLAGS) -o$@ ..\\fullscreen.c
145
+
146
+ glext.obj: ..\\glext.c ..\\internal.h platform.h
147
+ $(CC) $(CFLAGS) -o$@ ..\\glext.c
148
+
149
+ image.obj: ..\\image.c ..\\internal.h platform.h
150
+ $(CC) $(CFLAGS_SPEED) -o$@ ..\\image.c
151
+
152
+ init.obj: ..\\init.c ..\\internal.h platform.h
153
+ $(CC) $(CFLAGS) -o$@ ..\\init.c
154
+
155
+ input.obj: ..\\input.c ..\\internal.h platform.h
156
+ $(CC) $(CFLAGS) -o$@ ..\\input.c
157
+
158
+ joystick.obj: ..\\joystick.c ..\\internal.h platform.h
159
+ $(CC) $(CFLAGS) -o$@ ..\\joystick.c
160
+
161
+ stream.obj: ..\\stream.c ..\\internal.h platform.h
162
+ $(CC) $(CFLAGS) -o$@ ..\\stream.c
163
+
164
+ tga.obj: ..\\tga.c ..\\internal.h platform.h
165
+ $(CC) $(CFLAGS_SPEED) -o$@ ..\\tga.c
166
+
167
+ thread.obj: ..\\thread.c ..\\internal.h platform.h
168
+ $(CC) $(CFLAGS) -o$@ ..\\thread.c
169
+
170
+ time.obj: ..\\time.c ..\\internal.h platform.h
171
+ $(CC) $(CFLAGS) -o$@ ..\\time.c
172
+
173
+ window.obj: ..\\window.c ..\\internal.h platform.h
174
+ $(CC) $(CFLAGS) -o$@ ..\\window.c
175
+
176
+ win32_enable.obj: win32_enable.c ..\\internal.h platform.h
177
+ $(CC) $(CFLAGS) -o$@ win32_enable.c
178
+
179
+ win32_fullscreen.obj: win32_fullscreen.c ..\\internal.h platform.h
180
+ $(CC) $(CFLAGS) -o$@ win32_fullscreen.c
181
+
182
+ win32_glext.obj: win32_glext.c ..\\internal.h platform.h
183
+ $(CC) $(CFLAGS) -o$@ win32_glext.c
184
+
185
+ win32_init.obj: win32_init.c ..\\internal.h platform.h
186
+ $(CC) $(CFLAGS) -o$@ win32_init.c
187
+
188
+ win32_joystick.obj: win32_joystick.c ..\\internal.h platform.h
189
+ $(CC) $(CFLAGS) -o$@ win32_joystick.c
190
+
191
+ win32_thread.obj: win32_thread.c ..\\internal.h platform.h
192
+ $(CC) $(CFLAGS) -o$@ win32_thread.c
193
+
194
+ win32_time.obj: win32_time.c ..\\internal.h platform.h
195
+ $(CC) $(CFLAGS) -o$@ win32_time.c
196
+
197
+ win32_window.obj: win32_window.c ..\\internal.h platform.h
198
+ $(CC) $(CFLAGS) -o$@ win32_window.c
199
+
200
+
201
+ ##########################################################################
202
+ # Rules for building dynamic library object files
203
+ ##########################################################################
204
+ enable_dll.obj: ..\\enable.c ..\\internal.h platform.h
205
+ $(CC) $(CFLAGS_DLL) -o$@ ..\\enable.c
206
+
207
+ fullscreen_dll.obj: ..\\fullscreen.c ..\\internal.h platform.h
208
+ $(CC) $(CFLAGS_DLL) -o$@ ..\\fullscreen.c
209
+
210
+ glext_dll.obj: ..\\glext.c ..\\internal.h platform.h
211
+ $(CC) $(CFLAGS_DLL) -o$@ ..\\glext.c
212
+
213
+ image_dll.obj: ..\\image.c ..\\internal.h platform.h
214
+ $(CC) $(CFLAGS_SPEED_DLL) -o$@ ..\\image.c
215
+
216
+ init_dll.obj: ..\\init.c ..\\internal.h platform.h
217
+ $(CC) $(CFLAGS_DLL) -o$@ ..\\init.c
218
+
219
+ input_dll.obj: ..\\input.c ..\\internal.h platform.h
220
+ $(CC) $(CFLAGS_DLL) -o$@ ..\\input.c
221
+
222
+ joystick_dll.obj: ..\\joystick.c ..\\internal.h platform.h
223
+ $(CC) $(CFLAGS_DLL) -o$@ ..\\joystick.c
224
+
225
+ stream_dll.obj: ..\\stream.c ..\\internal.h platform.h
226
+ $(CC) $(CFLAGS_DLL) -o$@ ..\\stream.c
227
+
228
+ tga_dll.obj: ..\\tga.c ..\\internal.h platform.h
229
+ $(CC) $(CFLAGS_SPEED_DLL) -o$@ ..\\tga.c
230
+
231
+ thread_dll.obj: ..\\thread.c ..\\internal.h platform.h
232
+ $(CC) $(CFLAGS_DLL) -o$@ ..\\thread.c
233
+
234
+ time_dll.obj: ..\\time.c ..\\internal.h platform.h
235
+ $(CC) $(CFLAGS_DLL) -o$@ ..\\time.c
236
+
237
+ window_dll.obj: ..\\window.c ..\\internal.h platform.h
238
+ $(CC) $(CFLAGS_DLL) -o$@ ..\\window.c
239
+
240
+ win32_dllmain_dll.obj: win32_dllmain.c ..\\internal.h platform.h
241
+ $(CC) $(CFLAGS_DLL) -o$@ win32_dllmain.c
242
+
243
+ win32_enable_dll.obj: win32_enable.c ..\\internal.h platform.h
244
+ $(CC) $(CFLAGS_DLL) -o$@ win32_enable.c
245
+
246
+ win32_fullscreen_dll.obj: win32_fullscreen.c ..\\internal.h platform.h
247
+ $(CC) $(CFLAGS_DLL) -o$@ win32_fullscreen.c
248
+
249
+ win32_glext_dll.obj: win32_glext.c ..\\internal.h platform.h
250
+ $(CC) $(CFLAGS_DLL) -o$@ win32_glext.c
251
+
252
+ win32_init_dll.obj: win32_init.c ..\\internal.h platform.h
253
+ $(CC) $(CFLAGS_DLL) -o$@ win32_init.c
254
+
255
+ win32_joystick_dll.obj: win32_joystick.c ..\\internal.h platform.h
256
+ $(CC) $(CFLAGS_DLL) -o$@ win32_joystick.c
257
+
258
+ win32_thread_dll.obj: win32_thread.c ..\\internal.h platform.h
259
+ $(CC) $(CFLAGS_DLL) -o$@ win32_thread.c
260
+
261
+ win32_time_dll.obj: win32_time.c ..\\internal.h platform.h
262
+ $(CC) $(CFLAGS_DLL) -o$@ win32_time.c
263
+
264
+ win32_window_dll.obj: win32_window.c ..\\internal.h platform.h
265
+ $(CC) $(CFLAGS_DLL) -o$@ win32_window.c
@@ -0,0 +1,274 @@
1
+ ##########################################################################
2
+ # Makefile for GLFW on Windows using MinGW32.
3
+ #-------------------------------------------------------------------------
4
+ # To compile GLFW using this makefile, run:
5
+ # make -f Makefile.win32.mgw
6
+ ##########################################################################
7
+ PREFIX ?= /usr/local
8
+ TARGET ?= i586-mingw32msvc-
9
+ ##########################################################################
10
+ # Default: Build static and dynamic versions of GLFW
11
+ ##########################################################################
12
+ default: libglfw.a glfw.dll
13
+
14
+ ##########################################################################
15
+ # Install GLFW header and static library
16
+ ##########################################################################
17
+ install: glfw.dll libglfw.a libglfw.pc
18
+ $(INSTALL) -d $(PREFIX)/bin
19
+ $(INSTALL) -c glfw.dll $(PREFIX)/bin/glfw.dll
20
+ $(INSTALL) -d $(PREFIX)/lib
21
+ $(INSTALL) -c -m 644 libglfw.a $(PREFIX)/lib/libglfw.a
22
+ $(INSTALL) -d $(PREFIX)/include/GL
23
+ $(INSTALL) -c -m 644 ../../include/GL/glfw.h $(PREFIX)/include/GL/glfw.h
24
+ $(INSTALL) -d $(PREFIX)/lib/pkgconfig
25
+ $(INSTALL) -c -m 644 libglfw.pc $(PREFIX)/lib/pkgconfig/libglfw.pc
26
+
27
+ ##########################################################################
28
+ # Clean up generated files
29
+ ##########################################################################
30
+ clean:
31
+ @rm -f *.o
32
+ @rm -f *.obj
33
+ @rm -f *.tds
34
+ @rm -f lib*.a
35
+ @rm -f glfw.dll
36
+ @rm -f libglfw.pc
37
+
38
+ ##########################################################################
39
+ # GLFW version
40
+ ##########################################################################
41
+ VERMAJOR = 2
42
+ VERMINOR = 6
43
+
44
+
45
+ ##########################################################################
46
+ # Compiler settings
47
+ ##########################################################################
48
+ CC = gcc
49
+ CFLAGS = -c -I. -I.. -Wall -Os
50
+ CFLAGS_DLL = $(CFLAGS) -mdll -DGLFW_BUILD_DLL
51
+
52
+ # Some modules should be optimized for speed (e.g. image decoding)
53
+ CFLAGS_SPEED = -c -I. -I.. -Wall -O3 -ffast-math
54
+ CFLAGS_SPEED_DLL = $(CFLAGS_SPEED) -mdll -DGLFW_BUILD_DLL
55
+
56
+
57
+ ##########################################################################
58
+ # Library builder settings
59
+ ##########################################################################
60
+ # Static library
61
+ MKLIB = ar
62
+ LIBFLAGS = -rcs
63
+
64
+ # DLL
65
+ LINK = dllwrap
66
+ LINKFLAGS = -s -Wl,--major-image-version,$(VERMAJOR),--minor-image-version,$(VERMINOR)
67
+ LINKLIBS = -lopengl32
68
+
69
+ DLLTOOL = dlltool
70
+
71
+ SED = sed
72
+ INSTALL = install
73
+
74
+ ##########################################################################
75
+ # Object files for static library
76
+ ##########################################################################
77
+ OBJS = \
78
+ enable.o \
79
+ fullscreen.o \
80
+ glext.o \
81
+ image.o \
82
+ init.o \
83
+ input.o \
84
+ joystick.o \
85
+ stream.o \
86
+ tga.o \
87
+ thread.o \
88
+ time.o \
89
+ window.o \
90
+ win32_enable.o \
91
+ win32_fullscreen.o \
92
+ win32_glext.o \
93
+ win32_init.o \
94
+ win32_joystick.o \
95
+ win32_thread.o \
96
+ win32_time.o \
97
+ win32_window.o
98
+
99
+
100
+ ##########################################################################
101
+ # Object files for dynamic library
102
+ ##########################################################################
103
+ DLLOBJS = \
104
+ enable_dll.o \
105
+ fullscreen_dll.o \
106
+ glext_dll.o \
107
+ image_dll.o \
108
+ init_dll.o \
109
+ input_dll.o \
110
+ joystick_dll.o \
111
+ stream_dll.o \
112
+ tga_dll.o \
113
+ thread_dll.o \
114
+ time_dll.o \
115
+ window_dll.o \
116
+ win32_dllmain_dll.o \
117
+ win32_enable_dll.o \
118
+ win32_fullscreen_dll.o \
119
+ win32_glext_dll.o \
120
+ win32_init_dll.o \
121
+ win32_joystick_dll.o \
122
+ win32_thread_dll.o \
123
+ win32_time_dll.o \
124
+ win32_window_dll.o
125
+
126
+
127
+
128
+ ##########################################################################
129
+ # Rule for building static library
130
+ ##########################################################################
131
+ libglfw.a: $(OBJS)
132
+ $(TARGET)$(MKLIB) $(LIBFLAGS) $@ $(OBJS) $(SYSOBJS)
133
+
134
+
135
+ ##########################################################################
136
+ # Rule for building dynamic library
137
+ ##########################################################################
138
+ glfw.dll: $(DLLOBJS)
139
+ $(TARGET)$(LINK) --dllname $@ --def glfwdll_mgw1.def $(DLLOBJS) $(LINKFLAGS) $(LINKLIBS)
140
+ $(TARGET)$(DLLTOOL) --kill-at --output-lib libglfwdll.a --def glfwdll_mgw2.def
141
+
142
+ libglfw.pc: libglfw.pc.in
143
+ $(SED) -e 's,\@PREFIX\@,$(PREFIX),' libglfw.pc.in > libglfw.pc
144
+
145
+ ##########################################################################
146
+ # Rules for building static library object files
147
+ ##########################################################################
148
+ enable.o: ../enable.c ../internal.h platform.h
149
+ $(TARGET)$(CC) $(CFLAGS) -o $@ ../enable.c
150
+
151
+ fullscreen.o: ../fullscreen.c ../internal.h platform.h
152
+ $(TARGET)$(CC) $(CFLAGS) -o $@ ../fullscreen.c
153
+
154
+ glext.o: ../glext.c ../internal.h platform.h
155
+ $(TARGET)$(CC) $(CFLAGS) -o $@ ../glext.c
156
+
157
+ image.o: ../image.c ../internal.h platform.h
158
+ $(TARGET)$(CC) $(CFLAGS_SPEED) -o $@ ../image.c
159
+
160
+ init.o: ../init.c ../internal.h platform.h
161
+ $(TARGET)$(CC) $(CFLAGS) -o $@ ../init.c
162
+
163
+ input.o: ../input.c ../internal.h platform.h
164
+ $(TARGET)$(CC) $(CFLAGS) -o $@ ../input.c
165
+
166
+ joystick.o: ../joystick.c ../internal.h platform.h
167
+ $(TARGET)$(CC) $(CFLAGS) -o $@ ../joystick.c
168
+
169
+ stream.o: ../stream.c ../internal.h platform.h
170
+ $(TARGET)$(CC) $(CFLAGS) -o $@ ../stream.c
171
+
172
+ tga.o: ../tga.c ../internal.h platform.h
173
+ $(TARGET)$(CC) $(CFLAGS_SPEED) -o $@ ../tga.c
174
+
175
+ thread.o: ../thread.c ../internal.h platform.h
176
+ $(TARGET)$(CC) $(CFLAGS) -o $@ ../thread.c
177
+
178
+ time.o: ../time.c ../internal.h platform.h
179
+ $(TARGET)$(CC) $(CFLAGS) -o $@ ../time.c
180
+
181
+ window.o: ../window.c ../internal.h platform.h
182
+ $(TARGET)$(CC) $(CFLAGS) -o $@ ../window.c
183
+
184
+ win32_enable.o: win32_enable.c ../internal.h platform.h
185
+ $(TARGET)$(CC) $(CFLAGS) -o $@ win32_enable.c
186
+
187
+ win32_fullscreen.o: win32_fullscreen.c ../internal.h platform.h
188
+ $(TARGET)$(CC) $(CFLAGS) -o $@ win32_fullscreen.c
189
+
190
+ win32_glext.o: win32_glext.c ../internal.h platform.h
191
+ $(TARGET)$(CC) $(CFLAGS) -o $@ win32_glext.c
192
+
193
+ win32_init.o: win32_init.c ../internal.h platform.h
194
+ $(TARGET)$(CC) $(CFLAGS) -o $@ win32_init.c
195
+
196
+ win32_joystick.o: win32_joystick.c ../internal.h platform.h
197
+ $(TARGET)$(CC) $(CFLAGS) -o $@ win32_joystick.c
198
+
199
+ win32_thread.o: win32_thread.c ../internal.h platform.h
200
+ $(TARGET)$(CC) $(CFLAGS) -o $@ win32_thread.c
201
+
202
+ win32_time.o: win32_time.c ../internal.h platform.h
203
+ $(TARGET)$(CC) $(CFLAGS) -o $@ win32_time.c
204
+
205
+ win32_window.o: win32_window.c ../internal.h platform.h
206
+ $(TARGET)$(CC) $(CFLAGS) -o $@ win32_window.c
207
+
208
+
209
+ ##########################################################################
210
+ # Rules for building dynamic library object files
211
+ ##########################################################################
212
+ enable_dll.o: ../enable.c ../internal.h platform.h
213
+ $(TARGET)$(CC) $(CFLAGS_DLL) -o $@ ../enable.c
214
+
215
+ fullscreen_dll.o: ../fullscreen.c ../internal.h platform.h
216
+ $(TARGET)$(CC) $(CFLAGS_DLL) -o $@ ../fullscreen.c
217
+
218
+ glext_dll.o: ../glext.c ../internal.h platform.h
219
+ $(TARGET)$(CC) $(CFLAGS_DLL) -o $@ ../glext.c
220
+
221
+ image_dll.o: ../image.c ../internal.h platform.h
222
+ $(TARGET)$(CC) $(CFLAGS_SPEED_DLL) -o $@ ../image.c
223
+
224
+ init_dll.o: ../init.c ../internal.h platform.h
225
+ $(TARGET)$(CC) $(CFLAGS_DLL) -o $@ ../init.c
226
+
227
+ input_dll.o: ../input.c ../internal.h platform.h
228
+ $(TARGET)$(CC) $(CFLAGS_DLL) -o $@ ../input.c
229
+
230
+ joystick_dll.o: ../joystick.c ../internal.h platform.h
231
+ $(TARGET)$(CC) $(CFLAGS_DLL) -o $@ ../joystick.c
232
+
233
+ stream_dll.o: ../stream.c ../internal.h platform.h
234
+ $(TARGET)$(CC) $(CFLAGS_DLL) -o $@ ../stream.c
235
+
236
+ tga_dll.o: ../tga.c ../internal.h platform.h
237
+ $(TARGET)$(CC) $(CFLAGS_SPEED_DLL) -o $@ ../tga.c
238
+
239
+ thread_dll.o: ../thread.c ../internal.h platform.h
240
+ $(TARGET)$(CC) $(CFLAGS_DLL) -o $@ ../thread.c
241
+
242
+ time_dll.o: ../time.c ../internal.h platform.h
243
+ $(TARGET)$(CC) $(CFLAGS_DLL) -o $@ ../time.c
244
+
245
+ window_dll.o: ../window.c ../internal.h platform.h
246
+ $(TARGET)$(CC) $(CFLAGS_DLL) -o $@ ../window.c
247
+
248
+ win32_dllmain_dll.o: win32_dllmain.c ../internal.h platform.h
249
+ $(TARGET)$(CC) $(CFLAGS_DLL) -o $@ win32_dllmain.c
250
+
251
+ win32_enable_dll.o: win32_enable.c ../internal.h platform.h
252
+ $(TARGET)$(CC) $(CFLAGS_DLL) -o $@ win32_enable.c
253
+
254
+ win32_fullscreen_dll.o: win32_fullscreen.c ../internal.h platform.h
255
+ $(TARGET)$(CC) $(CFLAGS_DLL) -o $@ win32_fullscreen.c
256
+
257
+ win32_glext_dll.o: win32_glext.c ../internal.h platform.h
258
+ $(TARGET)$(CC) $(CFLAGS_DLL) -o $@ win32_glext.c
259
+
260
+ win32_init_dll.o: win32_init.c ../internal.h platform.h
261
+ $(TARGET)$(CC) $(CFLAGS_DLL) -o $@ win32_init.c
262
+
263
+ win32_joystick_dll.o: win32_joystick.c ../internal.h platform.h
264
+ $(TARGET)$(CC) $(CFLAGS_DLL) -o $@ win32_joystick.c
265
+
266
+ win32_thread_dll.o: win32_thread.c ../internal.h platform.h
267
+ $(TARGET)$(CC) $(CFLAGS_DLL) -o $@ win32_thread.c
268
+
269
+ win32_time_dll.o: win32_time.c ../internal.h platform.h
270
+ $(TARGET)$(CC) $(CFLAGS_DLL) -o $@ win32_time.c
271
+
272
+ win32_window_dll.o: win32_window.c ../internal.h platform.h
273
+ $(TARGET)$(CC) $(CFLAGS_DLL) -o $@ win32_window.c
274
+