rubygl 0.1.0 → 0.2.1
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.
- checksums.yaml +13 -5
- data/.travis/push-rdoc-to-gh-pages.sh +22 -0
- data/.travis.yml +18 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +12 -0
- data/LICENSE +21 -21
- data/README.md +40 -0
- data/Rakefile +98 -83
- data/bin/ffi_code_gen.rb +166 -166
- data/bin/gl_code_gen.rb +458 -458
- data/examples/faceted_example.rb +71 -64
- data/examples/instanced_example.rb +135 -127
- data/examples/phong_example.rb +80 -71
- data/ext/windows/RubyGL.so +0 -0
- data/lib/rubygl/event.rb +64 -0
- data/lib/{RubyGL → rubygl}/geometry.rb +216 -211
- data/lib/{RubyGL → rubygl}/math.rb +300 -300
- data/lib/{RubyGL → rubygl}/memory.rb +125 -121
- data/lib/rubygl/native/all_enums.rb +641 -0
- data/lib/{RubyGL/Native → rubygl/native}/glcontext.rb +23 -47
- data/lib/{RubyGL/Native → rubygl/native}/include/GLContext.h +36 -36
- data/lib/{RubyGL/Native → rubygl/native}/include/Input.h +15 -15
- data/lib/{RubyGL/Native → rubygl/native}/include/Window.h +27 -27
- data/lib/rubygl/native/input.rb +247 -0
- data/lib/{RubyGL/Native → rubygl/native}/opengl.rb +2808 -2032
- data/lib/{RubyGL/Native → rubygl/native}/src/GLContext.c +72 -72
- data/lib/{RubyGL/Native → rubygl/native}/src/Input.c +25 -25
- data/lib/{RubyGL/Native → rubygl/native}/src/Window.c +57 -57
- data/lib/{RubyGL/Native → rubygl/native}/window.rb +24 -24
- data/lib/{RubyGL → rubygl}/setup.rb +50 -50
- data/lib/{RubyGL → rubygl}/shader.rb +203 -203
- data/lib/{RubyGL → rubygl}/util.rb +77 -77
- data/lib/rubygl.rb +49 -48
- data/{RubyGL.gemspec → rubygl.gemspec} +20 -23
- data/test/test_util.rb +19 -0
- metadata +36 -33
- data/lib/RubyGL/Native/input.rb +0 -13
- data/lib/RubyGL/callback.rb +0 -10
@@ -1,23 +1,20 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
Gem::Specification.new do |spec|
|
4
|
-
spec.
|
5
|
-
spec.
|
6
|
-
spec.
|
7
|
-
|
8
|
-
spec.summary = %q{A Complete Solution For Graphics Programming In Ruby}
|
9
|
-
spec.description = %q{This library provides you with all of the essentials for
|
10
|
-
doing graphics programming in Ruby including windowing, context management,
|
11
|
-
1:1 mapping of OpenGL calls, and input handling.
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
spec.
|
17
|
-
spec.license = "MIT"
|
18
|
-
|
19
|
-
spec.
|
20
|
-
|
21
|
-
|
22
|
-
spec.add_dependency 'ffi'
|
23
|
-
end
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.authors = ["Andrew Miller"]
|
5
|
+
spec.email = ["millera9@seattleu.edu"]
|
6
|
+
spec.homepage = "https://github.com/GGist/RubyGL"
|
7
|
+
|
8
|
+
spec.summary = %q{A Complete Solution For Graphics Programming In Ruby.}
|
9
|
+
spec.description = %q{This library provides you with all of the essentials for
|
10
|
+
doing graphics programming in Ruby including windowing, context management,
|
11
|
+
1:1 mapping of OpenGL calls, and input handling.}
|
12
|
+
|
13
|
+
spec.files = `git ls-files`.split($/)
|
14
|
+
spec.name = 'rubygl'
|
15
|
+
spec.version = '0.2.1'
|
16
|
+
spec.require_paths = ["lib"]
|
17
|
+
spec.license = "MIT"
|
18
|
+
|
19
|
+
spec.add_runtime_dependency 'ffi', '~> 0'
|
20
|
+
end
|
data/test/test_util.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'rubygl/util'
|
3
|
+
|
4
|
+
class TestUtil < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def test_overflow_wrap
|
7
|
+
data = [1, 2, 3, 4, 5]
|
8
|
+
|
9
|
+
normal_entry = RubyGL::Util.overflow_wrap(data, 1)
|
10
|
+
assert_equal(2, normal_entry)
|
11
|
+
|
12
|
+
underflow_entry = RubyGL::Util.overflow_wrap(data, -1)
|
13
|
+
assert_equal(5, underflow_entry)
|
14
|
+
|
15
|
+
overflow_entry = RubyGL::Util.overflow_wrap(data, 5)
|
16
|
+
assert_equal(1, overflow_entry)
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
metadata
CHANGED
@@ -1,45 +1,45 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubygl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Miller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
description: "This library provides you with all of the essentials for \n doing
|
28
|
-
programming in Ruby including windowing, context management, \n 1:1 mapping
|
29
|
-
OpenGL calls, and input handling.
|
30
|
-
functions with 1:1 mapping to the C code that makes all of this \n possible. The
|
31
|
-
frontend of this library provides abstractions for interacting with\n the backend
|
32
|
-
functionality so that you do not have to deal with the manual memory\n management
|
33
|
-
from within Ruby that the backend requires."
|
27
|
+
description: ! "This library provides you with all of the essentials for \n doing
|
28
|
+
graphics programming in Ruby including windowing, context management, \n 1:1 mapping
|
29
|
+
of OpenGL calls, and input handling."
|
34
30
|
email:
|
35
31
|
- millera9@seattleu.edu
|
36
32
|
executables: []
|
37
33
|
extensions: []
|
38
34
|
extra_rdoc_files: []
|
39
35
|
files:
|
36
|
+
- .travis.yml
|
37
|
+
- .travis/push-rdoc-to-gh-pages.sh
|
38
|
+
- Gemfile
|
39
|
+
- Gemfile.lock
|
40
40
|
- LICENSE
|
41
|
+
- README.md
|
41
42
|
- Rakefile
|
42
|
-
- RubyGL.gemspec
|
43
43
|
- bin/ffi_code_gen.rb
|
44
44
|
- bin/gl_code_gen.rb
|
45
45
|
- examples/faceted_example.rb
|
@@ -47,24 +47,27 @@ files:
|
|
47
47
|
- examples/phong_example.rb
|
48
48
|
- ext/windows/RubyGL.so
|
49
49
|
- ext/windows/SDL2.dll
|
50
|
-
- lib/RubyGL/Native/glcontext.rb
|
51
|
-
- lib/RubyGL/Native/include/GLContext.h
|
52
|
-
- lib/RubyGL/Native/include/Input.h
|
53
|
-
- lib/RubyGL/Native/include/Window.h
|
54
|
-
- lib/RubyGL/Native/input.rb
|
55
|
-
- lib/RubyGL/Native/opengl.rb
|
56
|
-
- lib/RubyGL/Native/src/GLContext.c
|
57
|
-
- lib/RubyGL/Native/src/Input.c
|
58
|
-
- lib/RubyGL/Native/src/Window.c
|
59
|
-
- lib/RubyGL/Native/window.rb
|
60
|
-
- lib/RubyGL/callback.rb
|
61
|
-
- lib/RubyGL/geometry.rb
|
62
|
-
- lib/RubyGL/math.rb
|
63
|
-
- lib/RubyGL/memory.rb
|
64
|
-
- lib/RubyGL/setup.rb
|
65
|
-
- lib/RubyGL/shader.rb
|
66
|
-
- lib/RubyGL/util.rb
|
67
50
|
- lib/rubygl.rb
|
51
|
+
- lib/rubygl/event.rb
|
52
|
+
- lib/rubygl/geometry.rb
|
53
|
+
- lib/rubygl/math.rb
|
54
|
+
- lib/rubygl/memory.rb
|
55
|
+
- lib/rubygl/native/all_enums.rb
|
56
|
+
- lib/rubygl/native/glcontext.rb
|
57
|
+
- lib/rubygl/native/include/GLContext.h
|
58
|
+
- lib/rubygl/native/include/Input.h
|
59
|
+
- lib/rubygl/native/include/Window.h
|
60
|
+
- lib/rubygl/native/input.rb
|
61
|
+
- lib/rubygl/native/opengl.rb
|
62
|
+
- lib/rubygl/native/src/GLContext.c
|
63
|
+
- lib/rubygl/native/src/Input.c
|
64
|
+
- lib/rubygl/native/src/Window.c
|
65
|
+
- lib/rubygl/native/window.rb
|
66
|
+
- lib/rubygl/setup.rb
|
67
|
+
- lib/rubygl/shader.rb
|
68
|
+
- lib/rubygl/util.rb
|
69
|
+
- rubygl.gemspec
|
70
|
+
- test/test_util.rb
|
68
71
|
homepage: https://github.com/GGist/RubyGL
|
69
72
|
licenses:
|
70
73
|
- MIT
|
@@ -75,18 +78,18 @@ require_paths:
|
|
75
78
|
- lib
|
76
79
|
required_ruby_version: !ruby/object:Gem::Requirement
|
77
80
|
requirements:
|
78
|
-
- - '>='
|
81
|
+
- - ! '>='
|
79
82
|
- !ruby/object:Gem::Version
|
80
83
|
version: '0'
|
81
84
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
85
|
requirements:
|
83
|
-
- - '>='
|
86
|
+
- - ! '>='
|
84
87
|
- !ruby/object:Gem::Version
|
85
88
|
version: '0'
|
86
89
|
requirements: []
|
87
90
|
rubyforge_project:
|
88
|
-
rubygems_version: 2.
|
91
|
+
rubygems_version: 2.4.2
|
89
92
|
signing_key:
|
90
93
|
specification_version: 4
|
91
|
-
summary: A Complete Solution For Graphics Programming In Ruby
|
94
|
+
summary: A Complete Solution For Graphics Programming In Ruby.
|
92
95
|
test_files: []
|
data/lib/RubyGL/Native/input.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'ffi'
|
2
|
-
|
3
|
-
module RubyGL::Native
|
4
|
-
class EventType < FFI::Union
|
5
|
-
|
6
|
-
end
|
7
|
-
|
8
|
-
attach_function :initInput, [], :int
|
9
|
-
attach_function :quitInput, [], :void
|
10
|
-
attach_function :addEventWatch, [:pointer, :pointer], :void
|
11
|
-
attach_function :deleteEventWatch, [:pointer, :pointer], :void
|
12
|
-
attach_function :pumpEvents, [], :void
|
13
|
-
end
|