opengl-core 1.3.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/COPYING +22 -0
- data/README.md +124 -0
- data/lib/opengl-core.rb +20 -8
- data/lib/opengl-core/gl-commands.rb +6892 -0
- data/lib/opengl-core/{gl_enums.rb → gl-enums.rb} +48 -6
- data/lib/opengl-core/gl-sym.rb +74 -0
- data/lib/opengl-core/gl-sym/fiddle-symbol-loader.rb +130 -0
- metadata +17 -25
- data/ext/opengl-core/extconf.rb +0 -3
- data/ext/opengl-core/opengl_stub.c +0 -56
- data/lib/opengl-core/aux.rb +0 -7
- data/lib/opengl-core/aux/buffer.rb +0 -44
- data/lib/opengl-core/aux/gl.rb +0 -238
- data/lib/opengl-core/aux/marked.rb +0 -66
- data/lib/opengl-core/aux/program.rb +0 -122
- data/lib/opengl-core/aux/shader.rb +0 -49
- data/lib/opengl-core/aux/texture.rb +0 -45
- data/lib/opengl-core/aux/vertex_array.rb +0 -43
- data/lib/opengl-core/gl_commands.rb +0 -8587
- data/lib/opengl-core/gl_sym.rb +0 -51
data/lib/opengl-core/gl_sym.rb
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
require 'fiddle'
|
2
|
-
require 'opengl-core/opengl_stub'
|
3
|
-
|
4
|
-
module Gl ; end
|
5
|
-
|
6
|
-
# @api private
|
7
|
-
module Gl::GlSym
|
8
|
-
|
9
|
-
# Filled by gl_commands.rb
|
10
|
-
GL_COMMAND_TYPES = {}
|
11
|
-
# Filled by __load_gl_sym__
|
12
|
-
GL_COMMAND_FUNCTIONS = {}
|
13
|
-
|
14
|
-
# OpenGL library handle.
|
15
|
-
@@opengl_lib = nil
|
16
|
-
|
17
|
-
# Loads a symbol from the GL library. If the GL library hasn't yet been loaded
|
18
|
-
# it will also do that. The returned function will be a wrapped Fiddle
|
19
|
-
# function using the types that function name is associated with in
|
20
|
-
# GL_COMMAND_TYPES. The returned value is cached in GL_COMMAND_FUNCTIONS and
|
21
|
-
# returned if __load_gl_sym__ is called for the same name again.
|
22
|
-
def self.__load_gl_sym__(name)
|
23
|
-
if @@opengl_lib.nil?
|
24
|
-
lib_path = case
|
25
|
-
when apple?
|
26
|
-
'/System/Library/Frameworks/OpenGL.framework/OpenGL'
|
27
|
-
when windows? || Fiddle::WINDOWS
|
28
|
-
'opengl32.dll'
|
29
|
-
when unix? || linux?
|
30
|
-
'libGL.so.1'
|
31
|
-
else
|
32
|
-
raise 'Unrecognized platform'
|
33
|
-
end
|
34
|
-
@@opengl_lib = Fiddle.dlopen(lib_path)
|
35
|
-
end
|
36
|
-
|
37
|
-
fn = GL_COMMAND_FUNCTIONS[name]
|
38
|
-
if fn.nil?
|
39
|
-
fn = (GL_COMMAND_FUNCTIONS[name] = begin
|
40
|
-
sym = @@opengl_lib[name.to_s]
|
41
|
-
types = GL_COMMAND_TYPES[name]
|
42
|
-
Fiddle::Function.new(sym, types[:parameter_types], types[:return_type])
|
43
|
-
rescue
|
44
|
-
false
|
45
|
-
end)
|
46
|
-
end
|
47
|
-
|
48
|
-
fn
|
49
|
-
end
|
50
|
-
|
51
|
-
end # module GlSym
|