opengl 0.7.0-x86-mingw32 → 0.8.0.pre1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
data/ext/opengl/opengl.c CHANGED
@@ -3,9 +3,11 @@
3
3
  void Init_gl(void);
4
4
  void Init_glu(void);
5
5
  void Init_glut(void);
6
+ void Init_glut_callbacks(void);
6
7
 
7
8
  DLLEXPORT void Init_opengl() {
8
9
  Init_gl();
9
10
  Init_glu();
10
11
  Init_glut();
12
+ Init_glut_callbacks();
11
13
  }
data/lib/opengl.rb CHANGED
@@ -20,14 +20,9 @@
20
20
  # Thanks to Ilmari Heikkinen for a previous "reversed" version of this code,
21
21
  # and to Bill Kelly for a version before that one.
22
22
 
23
- # Extend the search path for Windows binary gem, depending of the current ruby version
24
- major_minor = RUBY_VERSION[ /^(\d+\.\d+)/ ] or
25
- raise "Oops, can't extract the major/minor version from #{RUBY_VERSION.dump}"
26
- $: << File.join(File.dirname(__FILE__), major_minor)
27
-
28
23
  module OpenGL
29
24
 
30
- VERSION = '0.7.0'
25
+ VERSION = '0.8.0.pre1'
31
26
 
32
27
  end
33
28
 
@@ -82,7 +77,6 @@ module GLUT
82
77
 
83
78
  Glut.constants.each do |cn|
84
79
  n = cn.to_s.sub(/^GLUT_/,'')
85
- next if n =~ /^[0-9]/
86
80
  const_set( n, Glut.const_get( cn ) )
87
81
  end
88
82
 
Binary file
@@ -0,0 +1,137 @@
1
+ require 'opengl/test_case'
2
+
3
+ class TestOpenGLBuffer < OpenGL::TestCase
4
+
5
+ def test_class_map
6
+ buffer, = glGenBuffers 1
7
+
8
+ glBindBuffer GL_ARRAY_BUFFER, buffer
9
+
10
+ glBufferData GL_ARRAY_BUFFER, 5, 'hello', GL_STREAM_READ
11
+
12
+ buf = OpenGL::Buffer.map GL_ARRAY_BUFFER, GL_READ_ONLY
13
+
14
+ assert_equal 'hello', buf.read(5)
15
+
16
+ ensure
17
+ buf.unmap
18
+ end
19
+
20
+ def test_read_length
21
+ buffer, = glGenBuffers 1
22
+
23
+ glBindBuffer GL_ARRAY_BUFFER, buffer
24
+
25
+ glBufferData GL_ARRAY_BUFFER, 5, 'hello', GL_STREAM_READ
26
+
27
+ buf = OpenGL::Buffer.map GL_ARRAY_BUFFER, GL_READ_ONLY
28
+
29
+ assert_equal 'he', buf.read(2)
30
+ ensure
31
+ buf.unmap
32
+ end
33
+
34
+ def test_read_offset
35
+ buffer, = glGenBuffers 1
36
+
37
+ glBindBuffer GL_ARRAY_BUFFER, buffer
38
+
39
+ glBufferData GL_ARRAY_BUFFER, 5, 'hello', GL_STREAM_READ
40
+
41
+ buf = OpenGL::Buffer.map GL_ARRAY_BUFFER, GL_READ_ONLY
42
+
43
+ assert_equal 'el', buf.read(2, 1)
44
+ ensure
45
+ buf.unmap
46
+ end
47
+
48
+ def test_read_unbounded
49
+ buffer, = glGenBuffers 1
50
+
51
+ glBindBuffer GL_ARRAY_BUFFER, buffer
52
+
53
+ glBufferData GL_ARRAY_BUFFER, 5, 'hello', GL_STREAM_READ
54
+
55
+ buf = OpenGL::Buffer.map GL_ARRAY_BUFFER, GL_READ_ONLY
56
+
57
+ e = assert_raises ArgumentError do
58
+ buf.read
59
+ end
60
+
61
+ assert_equal 'length must be provided for unbounded buffer', e.message
62
+ ensure
63
+ buf.unmap
64
+ end
65
+
66
+ def test_write
67
+ buffer, = glGenBuffers 1
68
+
69
+ glBindBuffer GL_ARRAY_BUFFER, buffer
70
+
71
+ glBufferData GL_ARRAY_BUFFER, 5, 'hello', GL_STREAM_READ
72
+
73
+ buf = OpenGL::Buffer.map GL_ARRAY_BUFFER, GL_READ_WRITE
74
+
75
+ buf.write 'world'
76
+
77
+ assert_equal 'world', buf.read(5)
78
+
79
+ buf.unmap
80
+
81
+ assert_equal 'world', glGetBufferSubData(GL_ARRAY_BUFFER, 0, 5)
82
+
83
+ ensure
84
+ buf.unmap
85
+ end
86
+
87
+ def test_write_nil
88
+ buffer, = glGenBuffers 1
89
+
90
+ glBindBuffer GL_ARRAY_BUFFER, buffer
91
+
92
+ glBufferData GL_ARRAY_BUFFER, 5, 'hello', GL_STREAM_READ
93
+
94
+ buf = OpenGL::Buffer.map GL_ARRAY_BUFFER, GL_READ_WRITE
95
+
96
+ e = assert_raises ArgumentError do
97
+ buf.write nil
98
+ end
99
+
100
+ assert_equal 'cannot write nil to buffer', e.message
101
+
102
+ ensure
103
+ buf.unmap
104
+ end
105
+
106
+ def test_write_offset
107
+ buffer, = glGenBuffers 1
108
+
109
+ glBindBuffer GL_ARRAY_BUFFER, buffer
110
+
111
+ glBufferData GL_ARRAY_BUFFER, 5, 'hello', GL_STREAM_READ
112
+
113
+ buf = OpenGL::Buffer.map GL_ARRAY_BUFFER, GL_READ_WRITE
114
+
115
+ buf.write 'O', 4
116
+
117
+ assert_equal 'hellO', buf.read(5)
118
+ ensure
119
+ buf.unmap
120
+ end
121
+
122
+ def test_write_unmapped
123
+ buffer, = glGenBuffers 1
124
+
125
+ glBindBuffer GL_ARRAY_BUFFER, buffer
126
+
127
+ buf = OpenGL::Buffer.map GL_ARRAY_BUFFER, GL_READ_WRITE
128
+
129
+ e = assert_raises ArgumentError do
130
+ buf.write 'hello'
131
+ end
132
+
133
+ assert_equal 'write to unmapped buffer', e.message
134
+ end
135
+
136
+ end
137
+
metadata CHANGED
@@ -1,15 +1,10 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: opengl
3
- version: !ruby/object:Gem::Version
4
- hash: 3
5
- prerelease:
6
- segments:
7
- - 0
8
- - 7
9
- - 0
10
- version: 0.7.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.8.0.pre1
5
+ prerelease: 6
11
6
  platform: x86-mingw32
12
- authors:
7
+ authors:
13
8
  - Eric Hodel
14
9
  - Alain Hoang
15
10
  - Jan Dvorak
@@ -18,94 +13,57 @@ authors:
18
13
  autorequire:
19
14
  bindir: bin
20
15
  cert_chain: []
21
-
22
- date: 2013-02-03 00:00:00 Z
23
- dependencies:
24
- - !ruby/object:Gem::Dependency
25
- name: rdoc
26
- prerelease: false
27
- requirement: &id001 !ruby/object:Gem::Requirement
28
- none: false
29
- requirements:
30
- - - ~>
31
- - !ruby/object:Gem::Version
32
- hash: 19
33
- segments:
34
- - 3
35
- - 10
36
- version: "3.10"
37
- type: :development
38
- version_requirements: *id001
39
- - !ruby/object:Gem::Dependency
16
+ date: 2012-06-14 00:00:00.000000000 Z
17
+ dependencies:
18
+ - !ruby/object:Gem::Dependency
40
19
  name: rake-compiler
41
- prerelease: false
42
- requirement: &id002 !ruby/object:Gem::Requirement
20
+ requirement: &6409680 !ruby/object:Gem::Requirement
43
21
  none: false
44
- requirements:
22
+ requirements:
45
23
  - - ~>
46
- - !ruby/object:Gem::Version
47
- hash: 5
48
- segments:
49
- - 0
50
- - 7
51
- version: "0.7"
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- hash: 17
55
- segments:
56
- - 0
57
- - 7
58
- - 9
24
+ - !ruby/object:Gem::Version
25
+ version: '0.7'
26
+ - - ! '>='
27
+ - !ruby/object:Gem::Version
59
28
  version: 0.7.9
60
29
  type: :development
61
- version_requirements: *id002
62
- - !ruby/object:Gem::Dependency
63
- name: minitest
64
30
  prerelease: false
65
- requirement: &id003 !ruby/object:Gem::Requirement
31
+ version_requirements: *6409680
32
+ - !ruby/object:Gem::Dependency
33
+ name: rdoc
34
+ requirement: &6406920 !ruby/object:Gem::Requirement
66
35
  none: false
67
- requirements:
36
+ requirements:
68
37
  - - ~>
69
- - !ruby/object:Gem::Version
70
- hash: 7
71
- segments:
72
- - 3
73
- - 0
74
- version: "3.0"
38
+ - !ruby/object:Gem::Version
39
+ version: '3.10'
75
40
  type: :development
76
- version_requirements: *id003
77
- - !ruby/object:Gem::Dependency
78
- name: hoe
79
41
  prerelease: false
80
- requirement: &id004 !ruby/object:Gem::Requirement
42
+ version_requirements: *6406920
43
+ - !ruby/object:Gem::Dependency
44
+ name: hoe
45
+ requirement: &6420080 !ruby/object:Gem::Requirement
81
46
  none: false
82
- requirements:
47
+ requirements:
83
48
  - - ~>
84
- - !ruby/object:Gem::Version
85
- hash: 13
86
- segments:
87
- - 3
88
- - 5
89
- version: "3.5"
49
+ - !ruby/object:Gem::Version
50
+ version: '2.16'
90
51
  type: :development
91
- version_requirements: *id004
92
- description: |-
93
- An OpenGL wrapper for Ruby. ruby-opengl contains bindings for OpenGL and the
94
- GLU and GLUT libraries.
95
-
96
- * This branch is for compatibility with Ruby 1.8. Latest development is for
97
- Ruby 1.9.2+ only, on master branch: https://github.com/larskanis/opengl
98
- email:
52
+ prerelease: false
53
+ version_requirements: *6420080
54
+ description: ! 'An OpenGL wrapper for Ruby. ruby-opengl contains bindings for OpenGL
55
+ and the
56
+
57
+ GLU and GLUT libraries.'
58
+ email:
99
59
  - drbrain@segment7.net
100
- - ""
101
- - ""
102
- - ""
103
- - ""
60
+ - ''
61
+ - ''
62
+ - ''
63
+ - ''
104
64
  executables: []
105
-
106
65
  extensions: []
107
-
108
- extra_rdoc_files:
66
+ extra_rdoc_files:
109
67
  - History.rdoc
110
68
  - Manifest.txt
111
69
  - README.rdoc
@@ -117,7 +75,7 @@ extra_rdoc_files:
117
75
  - docs/thanks.txt
118
76
  - docs/tutorial.txt
119
77
  - examples/OrangeBook/3Dlabs-License.txt
120
- files:
78
+ files:
121
79
  - .autotest
122
80
  - .gemtest
123
81
  - .gitignore
@@ -241,10 +199,12 @@ files:
241
199
  - ext/opengl/gl-ext-nv.c
242
200
  - ext/opengl/gl-types.h
243
201
  - ext/opengl/gl.c
202
+ - ext/opengl/gl_buffer.c
244
203
  - ext/opengl/glu-enums.c
245
204
  - ext/opengl/glu-enums.h
246
205
  - ext/opengl/glu.c
247
206
  - ext/opengl/glut.c
207
+ - ext/opengl/glut_callbacks.c
248
208
  - ext/opengl/opengl.c
249
209
  - lib/gl.rb
250
210
  - lib/glu.rb
@@ -265,6 +225,7 @@ files:
265
225
  - test/test_gl_ext_gremedy.rb
266
226
  - test/test_gl_ext_nv.rb
267
227
  - test/test_glu.rb
228
+ - test/test_opengl_buffer.rb
268
229
  - utils/README
269
230
  - utils/enumgen.rb
270
231
  - utils/extlistgen.rb
@@ -273,56 +234,46 @@ files:
273
234
  - website/images/ogl.jpg
274
235
  - website/images/tab_bottom.gif
275
236
  - website/style.css
276
- - lib/opengl/1.8/opengl.so
277
- - lib/opengl/1.9/opengl.so
278
- homepage: http://ruby-opengl.rubyforge.org
237
+ - lib/opengl/opengl.so
238
+ homepage: https://github.com/drbrain/opengl
279
239
  licenses: []
280
-
281
240
  post_install_message:
282
- rdoc_options:
241
+ rdoc_options:
283
242
  - --main
284
243
  - README.rdoc
285
- require_paths:
244
+ require_paths:
286
245
  - lib
287
- required_ruby_version: !ruby/object:Gem::Requirement
246
+ required_ruby_version: !ruby/object:Gem::Requirement
288
247
  none: false
289
- requirements:
290
- - - ">="
291
- - !ruby/object:Gem::Version
292
- hash: 57
293
- segments:
294
- - 1
295
- - 8
296
- - 7
297
- version: 1.8.7
298
- required_rubygems_version: !ruby/object:Gem::Requirement
248
+ requirements:
249
+ - - ! '>='
250
+ - !ruby/object:Gem::Version
251
+ version: 1.9.2
252
+ required_rubygems_version: !ruby/object:Gem::Requirement
299
253
  none: false
300
- requirements:
301
- - - ">="
302
- - !ruby/object:Gem::Version
303
- hash: 3
304
- segments:
305
- - 0
306
- version: "0"
254
+ requirements:
255
+ - - ! '>'
256
+ - !ruby/object:Gem::Version
257
+ version: 1.3.1
307
258
  requirements: []
308
-
309
259
  rubyforge_project: opengl
310
- rubygems_version: 1.8.15
260
+ rubygems_version: 1.8.17
311
261
  signing_key:
312
262
  specification_version: 3
313
263
  summary: An OpenGL wrapper for Ruby
314
- test_files:
315
- - test/test_gl_ext_ext.rb
264
+ test_files:
265
+ - test/test_gl_13.rb
266
+ - test/test_gl_10_11.rb
316
267
  - test/test_gl_12.rb
317
- - test/test_gl_15.rb
268
+ - test/test_gl_14.rb
318
269
  - test/test_glu.rb
270
+ - test/test_opengl_buffer.rb
271
+ - test/test_gl_15.rb
272
+ - test/test_gl_ext_nv.rb
273
+ - test/test_gl_ext_ati.rb
274
+ - test/test_gl_ext_ext.rb
275
+ - test/test_gl_21.rb
319
276
  - test/test_gl_20.rb
320
- - test/test_gl_13.rb
321
277
  - test/test_gl_ext_gremedy.rb
322
278
  - test/test_gl.rb
323
- - test/test_gl_ext_nv.rb
324
279
  - test/test_gl_ext_arb.rb
325
- - test/test_gl_10_11.rb
326
- - test/test_gl_ext_ati.rb
327
- - test/test_gl_14.rb
328
- - test/test_gl_21.rb
Binary file
Binary file