opengl3 0.0.1.pre5 → 0.0.1.pre6
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.
- data/lib/glut.rb +1 -1
- data/lib/opengl/gl.rb +23 -4
- data/lib/opengl/version.rb +1 -1
- metadata +1 -1
data/lib/glut.rb
CHANGED
@@ -22,7 +22,7 @@ module GLUT
|
|
22
22
|
[:LEFT, 0x64, :UP, :RIGHT, :DOWN, :PAGE_UP, :PAGE_DOWN,
|
23
23
|
:HOME, :END, :INSERT]
|
24
24
|
|
25
|
-
enum :mouse_button, [:LEFT, 0x0, :MIDDLE, :RIGHT]
|
25
|
+
enum :mouse_button, [:LEFT, 0x0, :MIDDLE, :RIGHT, :WHEEL_UP, :WHEEL_DOWN]
|
26
26
|
enum :mouse_button_state, [:DOWN, 0x0, :UP]
|
27
27
|
enum :mouse_entry_state, [:LEFT, 0x0, :ENTERED]
|
28
28
|
|
data/lib/opengl/gl.rb
CHANGED
@@ -11,20 +11,39 @@ module OpenGL
|
|
11
11
|
module GL
|
12
12
|
include Constants
|
13
13
|
|
14
|
+
DEFAULT_OPTIONS = {
|
15
|
+
debug: true, wrapper: true,
|
16
|
+
}
|
17
|
+
|
14
18
|
# Load entrypoints from the current context
|
15
19
|
#
|
16
20
|
# @return [Module] entrypoints
|
17
21
|
#
|
18
|
-
def self.entrypoints
|
22
|
+
def self.entrypoints(options = {})
|
23
|
+
options = DEFAULT_OPTIONS.merge(options)
|
24
|
+
|
25
|
+
# make sure there is an OpenGL context in the current thread
|
19
26
|
unless Platform.current.current_context?
|
20
27
|
raise RuntimeError, "OpenGL context is missing"
|
21
28
|
end
|
29
|
+
|
30
|
+
# create module
|
22
31
|
base = Module.new
|
32
|
+
|
33
|
+
# include raw functions
|
23
34
|
base.send :include, Raw.generate_module()
|
24
|
-
|
25
|
-
|
26
|
-
|
35
|
+
|
36
|
+
# include debugging
|
37
|
+
base.send :include, Debugging if options[:debug]
|
38
|
+
|
39
|
+
# include wrappers
|
40
|
+
if options[:wrapper]
|
41
|
+
Wrapper.constants.each do |c|
|
42
|
+
base.send :include, Wrapper.const_get(c) if c =~ /\AGL_/
|
43
|
+
end
|
27
44
|
end
|
45
|
+
|
46
|
+
# you have a module with OpenGL functions
|
28
47
|
return base
|
29
48
|
end
|
30
49
|
|
data/lib/opengl/version.rb
CHANGED