glut2 8.4.0
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 +7 -0
- data/.autotest +29 -0
- data/.gemtest +0 -0
- data/.gitignore +6 -0
- data/.travis.yml +15 -0
- data/History.rdoc +29 -0
- data/MIT-LICENSE +18 -0
- data/Manifest.txt +16 -0
- data/README.rdoc +78 -0
- data/Rakefile +77 -0
- data/ext/glut/common.h +68 -0
- data/ext/glut/extconf.rb +72 -0
- data/ext/glut/glut.c +1152 -0
- data/ext/glut/glut_callbacks.c +845 -0
- data/ext/glut/glut_ext.c +100 -0
- data/lib/glut/dummy.rb +2 -0
- data/lib/glut.rb +30 -0
- metadata +155 -0
data/ext/glut/glut_ext.c
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) 2013 Blaž Hrastnik <speed.the.bboy@gmail.com>
|
3
|
+
*
|
4
|
+
* This program is distributed under the terms of the MIT license.
|
5
|
+
* See the included COPYRIGHT file for the terms of this license.
|
6
|
+
*
|
7
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
8
|
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
9
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
10
|
+
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
11
|
+
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
12
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
13
|
+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
14
|
+
*
|
15
|
+
*/
|
16
|
+
|
17
|
+
#include "common.h"
|
18
|
+
|
19
|
+
/*
|
20
|
+
* Process loop function, see freeglut_main.c
|
21
|
+
*/
|
22
|
+
GLUT_SIMPLE_FUNCTION(MainLoopEvent)
|
23
|
+
GLUT_SIMPLE_FUNCTION(LeaveMainLoop)
|
24
|
+
GLUT_SIMPLE_FUNCTION(Exit)
|
25
|
+
|
26
|
+
/*
|
27
|
+
* Window management functions, see freeglut_window.c
|
28
|
+
*/
|
29
|
+
GLUT_SIMPLE_FUNCTION(FullScreenToggle)
|
30
|
+
GLUT_SIMPLE_FUNCTION(LeaveFullScreen)
|
31
|
+
|
32
|
+
/* Initialization functions */
|
33
|
+
static VALUE
|
34
|
+
glut_InitContextVersion(VALUE obj, VALUE majorVersion, VALUE minorVersion)
|
35
|
+
{
|
36
|
+
glutInitContextVersion(NUM2INT(majorVersion), NUM2INT(minorVersion));
|
37
|
+
return Qnil;
|
38
|
+
}
|
39
|
+
|
40
|
+
static VALUE
|
41
|
+
glut_InitContextFlags(VALUE obj, VALUE flags)
|
42
|
+
{
|
43
|
+
glutInitContextFlags(NUM2INT(flags));
|
44
|
+
return Qnil;
|
45
|
+
}
|
46
|
+
|
47
|
+
static VALUE
|
48
|
+
glut_InitContextProfile(VALUE obj, VALUE profile)
|
49
|
+
{
|
50
|
+
glutInitContextProfile(NUM2INT(profile));
|
51
|
+
return Qnil;
|
52
|
+
}
|
53
|
+
|
54
|
+
void Init_glut_ext() {
|
55
|
+
VALUE mGlut = rb_path2class("Glut");
|
56
|
+
|
57
|
+
/* Process loop functions */
|
58
|
+
rb_define_module_function(mGlut, "glutMainLoopEvent", glut_MainLoopEvent, 0);
|
59
|
+
rb_define_module_function(mGlut, "glutLeaveMainLoop", glut_LeaveMainLoop, 0);
|
60
|
+
rb_define_module_function(mGlut, "glutExit", glut_Exit, 0);
|
61
|
+
|
62
|
+
/* Window management functions */
|
63
|
+
rb_define_module_function(mGlut, "glutFullScreenToggle", glut_FullScreenToggle, 0);
|
64
|
+
rb_define_module_function(mGlut, "glutLeaveFullScreen", glut_LeaveFullScreen, 0);
|
65
|
+
|
66
|
+
/* Initialization functions */
|
67
|
+
rb_define_module_function(mGlut, "glutInitContextVersion", glut_InitContextVersion, 2);
|
68
|
+
rb_define_module_function(mGlut, "glutInitContextFlags", glut_InitContextFlags, 1);
|
69
|
+
rb_define_module_function(mGlut, "glutInitContextProfile", glut_InitContextProfile, 1);
|
70
|
+
|
71
|
+
/* Context-related flags */
|
72
|
+
#ifdef GLUT_INIT_MAJOR_VERSION
|
73
|
+
rb_define_const(mGlut, "GLUT_INIT_MAJOR_VERSION", INT2NUM(GLUT_INIT_MAJOR_VERSION));
|
74
|
+
#endif
|
75
|
+
#ifdef GLUT_INIT_MINOR_VERSION
|
76
|
+
rb_define_const(mGlut, "GLUT_INIT_MINOR_VERSION", INT2NUM(GLUT_INIT_MINOR_VERSION));
|
77
|
+
#endif
|
78
|
+
#ifdef GLUT_INIT_FLAGS
|
79
|
+
rb_define_const(mGlut, "GLUT_INIT_FLAGS", INT2NUM(GLUT_INIT_FLAGS));
|
80
|
+
#endif
|
81
|
+
#ifdef GLUT_INIT_PROFILE
|
82
|
+
rb_define_const(mGlut, "GLUT_INIT_PROFILE", INT2NUM(GLUT_INIT_PROFILE));
|
83
|
+
#endif
|
84
|
+
|
85
|
+
/* Flags for glutInitContextFlags */
|
86
|
+
#ifdef GLUT_FORWARD_COMPATIBLE
|
87
|
+
rb_define_const(mGlut, "GLUT_FORWARD_COMPATIBLE", INT2NUM(GLUT_FORWARD_COMPATIBLE));
|
88
|
+
#endif
|
89
|
+
#ifdef GLUT_DEBUG
|
90
|
+
rb_define_const(mGlut, "GLUT_DEBUG", INT2NUM(GLUT_DEBUG));
|
91
|
+
#endif
|
92
|
+
|
93
|
+
/* Flags for glutInitContextProfile */
|
94
|
+
#ifdef GLUT_CORE_PROFILE
|
95
|
+
rb_define_const(mGlut, "GLUT_CORE_PROFILE", INT2NUM(GLUT_CORE_PROFILE));
|
96
|
+
#endif
|
97
|
+
#ifdef GLUT_COMPATIBILITY_PROFILE
|
98
|
+
rb_define_const(mGlut, "GLUT_COMPATIBILITY_PROFILE", INT2NUM(GLUT_COMPATIBILITY_PROFILE));
|
99
|
+
#endif
|
100
|
+
}
|
data/lib/glut/dummy.rb
ADDED
data/lib/glut.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
begin
|
2
|
+
RUBY_VERSION =~ /(\d+.\d+)/
|
3
|
+
require "glut/#{Regexp.last_match(1)}/glut"
|
4
|
+
rescue LoadError
|
5
|
+
require 'glut/glut'
|
6
|
+
end
|
7
|
+
|
8
|
+
# (Glut.)glutInit -> GLUT.Init
|
9
|
+
# (Glut::)GLUT_RGBA -> GLUT::RGBA
|
10
|
+
module GLUT
|
11
|
+
extend self
|
12
|
+
include Glut
|
13
|
+
|
14
|
+
Glut.constants.each do |cn|
|
15
|
+
n = cn.to_s.sub(/^GLUT_/, '')
|
16
|
+
next if n =~ /^[0-9]/
|
17
|
+
|
18
|
+
const_set(n, Glut.const_get(cn))
|
19
|
+
end
|
20
|
+
|
21
|
+
Glut.methods(false).each do |mn|
|
22
|
+
n = mn.to_s.sub(/^glut/, '')
|
23
|
+
alias_method(n, mn)
|
24
|
+
public(n)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
module Glut2
|
29
|
+
VERSION = '8.4.0'
|
30
|
+
end
|
metadata
ADDED
@@ -0,0 +1,155 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: glut2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 8.4.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Eric Hodel
|
8
|
+
- Lars Kanis
|
9
|
+
- Blaž Hrastnik
|
10
|
+
- Alain Hoang
|
11
|
+
- Jan Dvorak
|
12
|
+
- Minh Thu Vo
|
13
|
+
- James Adam
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
date: 2024-09-08 00:00:00.000000000 Z
|
18
|
+
dependencies:
|
19
|
+
- !ruby/object:Gem::Dependency
|
20
|
+
name: rake-compiler
|
21
|
+
requirement: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - "~>"
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: '1.0'
|
26
|
+
type: :development
|
27
|
+
prerelease: false
|
28
|
+
version_requirements: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - "~>"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '1.0'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: rake-compiler-dock
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 0.6.0
|
40
|
+
type: :development
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.6.0
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: mini_portile2
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '2.1'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '2.1'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rdoc
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '4.0'
|
68
|
+
- - "<"
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '7'
|
71
|
+
type: :development
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '4.0'
|
78
|
+
- - "<"
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '7'
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: hoe
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - "~>"
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '4.2'
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - "~>"
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '4.2'
|
95
|
+
description: Glut bindings for OpenGL. To be used with the {opengl}[https://github.com/larskanis/opengl]
|
96
|
+
gem.
|
97
|
+
email:
|
98
|
+
- drbrain@segment7.net
|
99
|
+
- lars@greiz-reinsdorf.de
|
100
|
+
- speed.the.bboy@gmail.com
|
101
|
+
- ''
|
102
|
+
- ''
|
103
|
+
- ''
|
104
|
+
- ''
|
105
|
+
executables: []
|
106
|
+
extensions:
|
107
|
+
- ext/glut/extconf.rb
|
108
|
+
extra_rdoc_files:
|
109
|
+
- History.rdoc
|
110
|
+
- Manifest.txt
|
111
|
+
- README.rdoc
|
112
|
+
files:
|
113
|
+
- ".autotest"
|
114
|
+
- ".gemtest"
|
115
|
+
- ".gitignore"
|
116
|
+
- ".travis.yml"
|
117
|
+
- History.rdoc
|
118
|
+
- MIT-LICENSE
|
119
|
+
- Manifest.txt
|
120
|
+
- README.rdoc
|
121
|
+
- Rakefile
|
122
|
+
- ext/glut/common.h
|
123
|
+
- ext/glut/extconf.rb
|
124
|
+
- ext/glut/glut.c
|
125
|
+
- ext/glut/glut_callbacks.c
|
126
|
+
- ext/glut/glut_ext.c
|
127
|
+
- lib/glut.rb
|
128
|
+
- lib/glut/dummy.rb
|
129
|
+
homepage: https://github.com/vrodic/ruby-glut2
|
130
|
+
licenses:
|
131
|
+
- MIT
|
132
|
+
metadata:
|
133
|
+
msys2_mingw_dependencies: freeglut
|
134
|
+
post_install_message:
|
135
|
+
rdoc_options:
|
136
|
+
- "--main"
|
137
|
+
- README.rdoc
|
138
|
+
require_paths:
|
139
|
+
- lib
|
140
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: 1.9.2
|
145
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
requirements: []
|
151
|
+
rubygems_version: 3.5.18
|
152
|
+
signing_key:
|
153
|
+
specification_version: 4
|
154
|
+
summary: Glut bindings for OpenGL
|
155
|
+
test_files: []
|