glfw 0.9.8 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Makefile +3 -3
- data/README.md +5 -2
- data/Rakefile +0 -9
- data/ext/glfw/common.h +45 -45
- data/ext/glfw/cursor.c +42 -42
- data/ext/glfw/cursor.h +13 -13
- data/ext/glfw/extconf.rb +13 -16
- data/ext/glfw/glfw.c +2 -2
- data/ext/glfw/image.c +76 -76
- data/ext/glfw/image.h +13 -13
- data/ext/glfw/monitor.c +209 -209
- data/ext/glfw/monitor.h +28 -28
- data/ext/glfw/video_mode.c +60 -60
- data/ext/glfw/video_mode.h +20 -20
- data/ext/glfw/vulkan.c +48 -48
- data/ext/glfw/vulkan.h +15 -15
- data/ext/glfw/window.c +708 -708
- data/ext/glfw/window.h +86 -86
- data/lib/glfw.rb +8 -26
- data/lib/glfw/version.rb +1 -1
- metadata +3 -4
- data/ext/glfw/lib/libglfw3.a +0 -0
data/ext/glfw/window.h
CHANGED
@@ -1,87 +1,87 @@
|
|
1
|
-
|
2
|
-
#ifndef GLFW_RB_WINDOW_H
|
3
|
-
#define GLFW_RB_WINDOW_H 1
|
4
|
-
|
5
|
-
#include "common.h"
|
6
|
-
|
7
|
-
void Init_glfw_window(VALUE mmodule);
|
8
|
-
|
9
|
-
static VALUE rb_glfw_window_alloc(VALUE klass);
|
10
|
-
VALUE rb_glfw_window_initialize(int argc, VALUE *argv, VALUE self);
|
11
|
-
VALUE rb_glfw_window_destroy(VALUE self);
|
12
|
-
VALUE rb_glfw_window_show(VALUE self);
|
13
|
-
VALUE rb_glfw_window_hide(VALUE self);
|
14
|
-
VALUE rb_glfw_window_minimize(VALUE self);
|
15
|
-
VALUE rb_glfw_window_maximize(VALUE self);
|
16
|
-
VALUE rb_glfw_window_restore(VALUE self);
|
17
|
-
VALUE rb_glfw_window_focus(VALUE self);
|
18
|
-
VALUE rb_glfw_window_swap_buffers(VALUE self);
|
19
|
-
VALUE rb_glfw_window_make_current(VALUE self);
|
20
|
-
VALUE rb_glfw_window_dimensions(VALUE self);
|
21
|
-
VALUE rb_glfw_window_get_pos(VALUE self);
|
22
|
-
VALUE rb_glfw_window_set_pos(VALUE self, VALUE x, VALUE y);
|
23
|
-
VALUE rb_glfw_window_get_size(VALUE self);
|
24
|
-
VALUE rb_glfw_window_set_size(VALUE self, VALUE width, VALUE height);
|
25
|
-
VALUE rb_glfw_window_get_x(VALUE self);
|
26
|
-
VALUE rb_glfw_window_get_y(VALUE self);
|
27
|
-
VALUE rb_glfw_window_set_x(VALUE self, VALUE x);
|
28
|
-
VALUE rb_glfw_window_set_y(VALUE self, VALUE y);
|
29
|
-
VALUE rb_glfw_window_get_width(VALUE self);
|
30
|
-
VALUE rb_glfw_window_get_height(VALUE self);
|
31
|
-
VALUE rb_glfw_window_set_width(VALUE self, VALUE width);
|
32
|
-
VALUE rb_glfw_window_set_height(VALUE self, VALUE height);
|
33
|
-
VALUE rb_glfw_window_get_framebuffer_size(VALUE self);
|
34
|
-
VALUE rb_glfw_window_closing_p(VALUE self);
|
35
|
-
VALUE rb_glfw_window_close(int argc, VALUE *argv, VALUE self);
|
36
|
-
VALUE rb_glfw_window_get_monitor(VALUE self);
|
37
|
-
VALUE rb_glfw_window_set_monitor(int argc, VALUE *argv, VALUE self);
|
38
|
-
VALUE rb_glfw_window_set_title(VALUE self, volatile VALUE title);
|
39
|
-
VALUE rb_glfw_window_focused_p(VALUE self);
|
40
|
-
VALUE rb_glfw_window_minimized_p(VALUE self);
|
41
|
-
VALUE rb_glfw_window_maximized_p(VALUE self);
|
42
|
-
VALUE rb_glfw_window_visible_p(VALUE self);
|
43
|
-
VALUE rb_glfw_window_resizable_p(VALUE self);
|
44
|
-
VALUE rb_glfw_window_decorated_p(VALUE self);
|
45
|
-
VALUE rb_glfw_window_floating_p(VALUE self);
|
46
|
-
VALUE rb_glfw_window_aspect_ratio(VALUE self, VALUE numerator, VALUE denominator);
|
47
|
-
VALUE rb_glfw_window_limits(VALUE self, VALUE minWidth, VALUE minHeight, VALUE maxWidth, VALUE maxHeight);
|
48
|
-
VALUE rb_glfw_window_frame_size(VALUE self);
|
49
|
-
VALUE rb_glfw_window_get_clipboard(VALUE self);
|
50
|
-
VALUE rb_glfw_window_set_clipboard(VALUE self, VALUE str);
|
51
|
-
VALUE rb_glfw_window_set_icon(VALUE self, VALUE args);
|
52
|
-
VALUE rb_glfw_window_get_input_cursor(VALUE self);
|
53
|
-
VALUE rb_glfw_window_set_input_cursor(VALUE self, VALUE value);
|
54
|
-
VALUE rb_glfw_window_get_input_sticky_keys(VALUE self);
|
55
|
-
VALUE rb_glfw_window_set_input_sticky_keys(VALUE self, VALUE value);
|
56
|
-
VALUE rb_glfw_window_get_input_sticky_mouse(VALUE self);
|
57
|
-
VALUE rb_glfw_window_set_input_sticky_mouse(VALUE self, VALUE value);
|
58
|
-
VALUE rb_glfw_window_cursor_pos(VALUE self);
|
59
|
-
VALUE rb_glfw_window_set_cursor_pos(VALUE self, VALUE x, VALUE y);
|
60
|
-
VALUE rb_glfw_window_set_cursor(VALUE self, VALUE cursor);
|
61
|
-
VALUE rb_glfw_window_get_key(VALUE self, VALUE key);
|
62
|
-
VALUE rb_glfw_window_get_mouse_button(VALUE self, VALUE mbtn);
|
63
|
-
|
64
|
-
/////////////////////////////////////////////////////////////////////////////
|
65
|
-
// Callbacks
|
66
|
-
/////////////////////////////////////////////////////////////////////////////
|
67
|
-
|
68
|
-
VALUE rb_glfw_window_enable_callback(VALUE self, VALUE sym, VALUE enable);
|
69
|
-
VALUE rb_glfw_window_empty_method(int argc, VALUE *argv, VALUE self);
|
70
|
-
|
71
|
-
static void rb_glfw_window_closing(GLFWwindow *window);
|
72
|
-
static void rb_glfw_window_moved(GLFWwindow *window, int x, int y);
|
73
|
-
static void rb_glfw_window_resized(GLFWwindow *window, int width, int height);
|
74
|
-
static void rb_glfw_window_refreshed(GLFWwindow *window);
|
75
|
-
static void rb_glfw_window_focus_changed(GLFWwindow *window, int focus);
|
76
|
-
static void rb_glfw_window_minimize_changed(GLFWwindow *window, int minimized);
|
77
|
-
static void rb_glfw_window_frame_buffer_resized(GLFWwindow *window, int width, int height);
|
78
|
-
static void rb_glfw_window_cursor_mouse_move(GLFWwindow *window, double x, double y);
|
79
|
-
static void rb_glfw_window_cursor_mouse_button(GLFWwindow *window, int button, int action, int mods);
|
80
|
-
static void rb_glfw_window_cursor_mouse_scroll(GLFWwindow *window, double xoffset, double yoffset);
|
81
|
-
static void rb_glfw_window_key(GLFWwindow *window, int key, int scancode, int action, int mods);
|
82
|
-
static void rb_glfw_window_char(GLFWwindow *window, unsigned int codepoint);
|
83
|
-
static void rb_glfw_window_char_mods(GLFWwindow *window, unsigned int codepoint, int mods);
|
84
|
-
static void rb_glfw_window_file_drop(GLFWwindow *window, int count, const char** files);
|
85
|
-
static void rb_glfw_window_mouse_enter(GLFWwindow *window, int entered);
|
86
|
-
|
1
|
+
|
2
|
+
#ifndef GLFW_RB_WINDOW_H
|
3
|
+
#define GLFW_RB_WINDOW_H 1
|
4
|
+
|
5
|
+
#include "common.h"
|
6
|
+
|
7
|
+
void Init_glfw_window(VALUE mmodule);
|
8
|
+
|
9
|
+
static VALUE rb_glfw_window_alloc(VALUE klass);
|
10
|
+
VALUE rb_glfw_window_initialize(int argc, VALUE *argv, VALUE self);
|
11
|
+
VALUE rb_glfw_window_destroy(VALUE self);
|
12
|
+
VALUE rb_glfw_window_show(VALUE self);
|
13
|
+
VALUE rb_glfw_window_hide(VALUE self);
|
14
|
+
VALUE rb_glfw_window_minimize(VALUE self);
|
15
|
+
VALUE rb_glfw_window_maximize(VALUE self);
|
16
|
+
VALUE rb_glfw_window_restore(VALUE self);
|
17
|
+
VALUE rb_glfw_window_focus(VALUE self);
|
18
|
+
VALUE rb_glfw_window_swap_buffers(VALUE self);
|
19
|
+
VALUE rb_glfw_window_make_current(VALUE self);
|
20
|
+
VALUE rb_glfw_window_dimensions(VALUE self);
|
21
|
+
VALUE rb_glfw_window_get_pos(VALUE self);
|
22
|
+
VALUE rb_glfw_window_set_pos(VALUE self, VALUE x, VALUE y);
|
23
|
+
VALUE rb_glfw_window_get_size(VALUE self);
|
24
|
+
VALUE rb_glfw_window_set_size(VALUE self, VALUE width, VALUE height);
|
25
|
+
VALUE rb_glfw_window_get_x(VALUE self);
|
26
|
+
VALUE rb_glfw_window_get_y(VALUE self);
|
27
|
+
VALUE rb_glfw_window_set_x(VALUE self, VALUE x);
|
28
|
+
VALUE rb_glfw_window_set_y(VALUE self, VALUE y);
|
29
|
+
VALUE rb_glfw_window_get_width(VALUE self);
|
30
|
+
VALUE rb_glfw_window_get_height(VALUE self);
|
31
|
+
VALUE rb_glfw_window_set_width(VALUE self, VALUE width);
|
32
|
+
VALUE rb_glfw_window_set_height(VALUE self, VALUE height);
|
33
|
+
VALUE rb_glfw_window_get_framebuffer_size(VALUE self);
|
34
|
+
VALUE rb_glfw_window_closing_p(VALUE self);
|
35
|
+
VALUE rb_glfw_window_close(int argc, VALUE *argv, VALUE self);
|
36
|
+
VALUE rb_glfw_window_get_monitor(VALUE self);
|
37
|
+
VALUE rb_glfw_window_set_monitor(int argc, VALUE *argv, VALUE self);
|
38
|
+
VALUE rb_glfw_window_set_title(VALUE self, volatile VALUE title);
|
39
|
+
VALUE rb_glfw_window_focused_p(VALUE self);
|
40
|
+
VALUE rb_glfw_window_minimized_p(VALUE self);
|
41
|
+
VALUE rb_glfw_window_maximized_p(VALUE self);
|
42
|
+
VALUE rb_glfw_window_visible_p(VALUE self);
|
43
|
+
VALUE rb_glfw_window_resizable_p(VALUE self);
|
44
|
+
VALUE rb_glfw_window_decorated_p(VALUE self);
|
45
|
+
VALUE rb_glfw_window_floating_p(VALUE self);
|
46
|
+
VALUE rb_glfw_window_aspect_ratio(VALUE self, VALUE numerator, VALUE denominator);
|
47
|
+
VALUE rb_glfw_window_limits(VALUE self, VALUE minWidth, VALUE minHeight, VALUE maxWidth, VALUE maxHeight);
|
48
|
+
VALUE rb_glfw_window_frame_size(VALUE self);
|
49
|
+
VALUE rb_glfw_window_get_clipboard(VALUE self);
|
50
|
+
VALUE rb_glfw_window_set_clipboard(VALUE self, VALUE str);
|
51
|
+
VALUE rb_glfw_window_set_icon(VALUE self, VALUE args);
|
52
|
+
VALUE rb_glfw_window_get_input_cursor(VALUE self);
|
53
|
+
VALUE rb_glfw_window_set_input_cursor(VALUE self, VALUE value);
|
54
|
+
VALUE rb_glfw_window_get_input_sticky_keys(VALUE self);
|
55
|
+
VALUE rb_glfw_window_set_input_sticky_keys(VALUE self, VALUE value);
|
56
|
+
VALUE rb_glfw_window_get_input_sticky_mouse(VALUE self);
|
57
|
+
VALUE rb_glfw_window_set_input_sticky_mouse(VALUE self, VALUE value);
|
58
|
+
VALUE rb_glfw_window_cursor_pos(VALUE self);
|
59
|
+
VALUE rb_glfw_window_set_cursor_pos(VALUE self, VALUE x, VALUE y);
|
60
|
+
VALUE rb_glfw_window_set_cursor(VALUE self, VALUE cursor);
|
61
|
+
VALUE rb_glfw_window_get_key(VALUE self, VALUE key);
|
62
|
+
VALUE rb_glfw_window_get_mouse_button(VALUE self, VALUE mbtn);
|
63
|
+
|
64
|
+
/////////////////////////////////////////////////////////////////////////////
|
65
|
+
// Callbacks
|
66
|
+
/////////////////////////////////////////////////////////////////////////////
|
67
|
+
|
68
|
+
VALUE rb_glfw_window_enable_callback(VALUE self, VALUE sym, VALUE enable);
|
69
|
+
VALUE rb_glfw_window_empty_method(int argc, VALUE *argv, VALUE self);
|
70
|
+
|
71
|
+
static void rb_glfw_window_closing(GLFWwindow *window);
|
72
|
+
static void rb_glfw_window_moved(GLFWwindow *window, int x, int y);
|
73
|
+
static void rb_glfw_window_resized(GLFWwindow *window, int width, int height);
|
74
|
+
static void rb_glfw_window_refreshed(GLFWwindow *window);
|
75
|
+
static void rb_glfw_window_focus_changed(GLFWwindow *window, int focus);
|
76
|
+
static void rb_glfw_window_minimize_changed(GLFWwindow *window, int minimized);
|
77
|
+
static void rb_glfw_window_frame_buffer_resized(GLFWwindow *window, int width, int height);
|
78
|
+
static void rb_glfw_window_cursor_mouse_move(GLFWwindow *window, double x, double y);
|
79
|
+
static void rb_glfw_window_cursor_mouse_button(GLFWwindow *window, int button, int action, int mods);
|
80
|
+
static void rb_glfw_window_cursor_mouse_scroll(GLFWwindow *window, double xoffset, double yoffset);
|
81
|
+
static void rb_glfw_window_key(GLFWwindow *window, int key, int scancode, int action, int mods);
|
82
|
+
static void rb_glfw_window_char(GLFWwindow *window, unsigned int codepoint);
|
83
|
+
static void rb_glfw_window_char_mods(GLFWwindow *window, unsigned int codepoint, int mods);
|
84
|
+
static void rb_glfw_window_file_drop(GLFWwindow *window, int count, const char** files);
|
85
|
+
static void rb_glfw_window_mouse_enter(GLFWwindow *window, int entered);
|
86
|
+
|
87
87
|
#endif /* GLFW_RB_WINDOW_H */
|
data/lib/glfw.rb
CHANGED
@@ -1,32 +1,14 @@
|
|
1
1
|
require_relative "glfw/version"
|
2
2
|
require_relative "glfw/glfw"
|
3
3
|
|
4
|
-
|
4
|
+
# GLFW::Window.new(800, 600, "Hello World!") do |window|
|
5
5
|
|
6
|
+
# window.make_current
|
6
7
|
|
8
|
+
# until window.closing?
|
9
|
+
# GLFW.poll_events
|
10
|
+
# window.swap_buffers
|
11
|
+
# end
|
12
|
+
# end
|
7
13
|
|
8
|
-
|
9
|
-
|
10
|
-
p Vulkan.supported?
|
11
|
-
|
12
|
-
|
13
|
-
Window.new(800, 600, "Hello, World!") do |window|
|
14
|
-
|
15
|
-
|
16
|
-
window.make_current
|
17
|
-
self.swap_interval(1)
|
18
|
-
pixels32 = [0, 0, 255, 255].pack('C*') * (32 * 32)
|
19
|
-
pixels16 = [0, 255, 255, 255].pack('C*') * (16 * 16)
|
20
|
-
|
21
|
-
window.set_icon(Image.new(32, 32, pixels32), Image.new(16, 16, pixels16))
|
22
|
-
|
23
|
-
until window.closing?
|
24
|
-
self.poll_events
|
25
|
-
window.swap_buffers
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
self.terminate
|
31
|
-
end
|
32
|
-
|
14
|
+
# GLFW.terminate
|
data/lib/glfw/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glfw
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Freed
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -102,7 +102,6 @@ files:
|
|
102
102
|
- ext/glfw/glfw3native.h
|
103
103
|
- ext/glfw/image.c
|
104
104
|
- ext/glfw/image.h
|
105
|
-
- ext/glfw/lib/libglfw3.a
|
106
105
|
- ext/glfw/monitor.c
|
107
106
|
- ext/glfw/monitor.h
|
108
107
|
- ext/glfw/video_mode.c
|
@@ -135,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
134
|
version: '0'
|
136
135
|
requirements: []
|
137
136
|
rubyforge_project:
|
138
|
-
rubygems_version: 2.6
|
137
|
+
rubygems_version: 2.7.6
|
139
138
|
signing_key:
|
140
139
|
specification_version: 4
|
141
140
|
summary: GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and
|
data/ext/glfw/lib/libglfw3.a
DELETED
Binary file
|