glfw3 0.4.7 → 0.4.8
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 +4 -4
- data/README.md +7 -9
- data/ext/glfw3/glfw3.c +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 256b792a403efee9cab85894c782d63d4949a547
|
4
|
+
data.tar.gz: f67a880e6f52a55e4208cb2914f01aa0c7e57386
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b66e95308ea6383260a1bd539b2f3c7cf276133e6d5da2a283db97f2c3fe9041de7665dd45c40a208c9f04e65b09f3cd77aafc07b73ebc4b41211016a65a798
|
7
|
+
data.tar.gz: 6d77ae5714dbfeacf4dae96bbf927c03615e36a98a328b6d07798cab3d961c55c253d1667c5634b4b3679f0e00a46f566ecf8808d372ae15241d7838c8419ae6
|
data/README.md
CHANGED
@@ -36,25 +36,23 @@ After that, write a quick script to toy with it. For example:
|
|
36
36
|
window = Glfw::Window.new(800, 600, "Foobar")
|
37
37
|
|
38
38
|
# Set some callbacks
|
39
|
-
window.set_key_callback
|
40
|
-
|window, key, code, action, mods|
|
39
|
+
window.set_key_callback do |window, key, code, action, mods|
|
41
40
|
window.should_close = true if key == Glfw::KEY_ESCAPE
|
42
|
-
|
41
|
+
end
|
43
42
|
|
44
|
-
window.set_close_callback
|
45
|
-
|window|
|
43
|
+
window.set_close_callback do |window|
|
46
44
|
window.should_close = true
|
47
|
-
|
45
|
+
end
|
48
46
|
|
49
47
|
# Make the window's context current
|
50
48
|
window.make_context_current
|
51
|
-
loop
|
49
|
+
loop do
|
52
50
|
# And do stuff
|
53
51
|
Glfw.wait_events
|
54
|
-
|
52
|
+
GL.glClear(GL::GL_COLOR_BUFFER_BIT | GL::GL_DEPTH_BUFFER_BIT)
|
55
53
|
window.swap_buffers
|
56
54
|
break if window.should_close?
|
57
|
-
|
55
|
+
end
|
58
56
|
|
59
57
|
# Explicitly destroy the window when done with it.
|
60
58
|
window.destroy
|
data/ext/glfw3/glfw3.c
CHANGED
@@ -379,7 +379,7 @@ static VALUE rb_monitor_video_modes(VALUE self)
|
|
379
379
|
modes = glfwGetVideoModes(monitor, &num_modes);
|
380
380
|
|
381
381
|
for (; mode_index < num_modes; ++mode_index) {
|
382
|
-
ALLOC(GLFWvidmode);
|
382
|
+
mode = ALLOC(GLFWvidmode);
|
383
383
|
*mode = modes[mode_index];
|
384
384
|
rb_mode = Data_Wrap_Struct(s_glfw_videomode_klass, 0, free, mode);
|
385
385
|
rb_obj_call_init(rb_mode, 0, 0);
|
@@ -450,11 +450,16 @@ static VALUE rb_monitor_get_gamma_ramp(VALUE self)
|
|
450
450
|
const GLFWgammaramp *ramp = NULL;
|
451
451
|
VALUE rb_gamma_hash, rb_red, rb_green, rb_blue;
|
452
452
|
unsigned int ramp_index;
|
453
|
-
unsigned int ramp_len
|
453
|
+
unsigned int ramp_len;
|
454
454
|
|
455
455
|
Data_Get_Struct(self, GLFWmonitor, monitor);
|
456
456
|
ramp = glfwGetGammaRamp(monitor);
|
457
457
|
|
458
|
+
if (ramp == NULL) {
|
459
|
+
return Qnil;
|
460
|
+
}
|
461
|
+
ramp_len = ramp->size;
|
462
|
+
|
458
463
|
rb_gamma_hash = rb_hash_new();
|
459
464
|
rb_red = rb_ary_new();
|
460
465
|
rb_green = rb_ary_new();
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glfw3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noel Raymond Cower
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: GLFW 3 bindings for Ruby 2.x
|
14
14
|
email: ncower@gmail.com
|