glfw3 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c71879992988bff0b3bd240651241e68c5f6315c
4
- data.tar.gz: 6de12532188d628f437867a407d7dd0dd26d8921
3
+ metadata.gz: 197903711fa3522d32955dca8172d60d7f3b5a54
4
+ data.tar.gz: 6fa9a291165798a578aca51f943ccd467b3fb22b
5
5
  SHA512:
6
- metadata.gz: aecf77997284f61fc094da9ae5aa7d89b75ad2f1a474e4ba3fb8e9004a9316298e3b9fa8059639e6c7f5492be5d7fac8e874d7afb08a75e5759dc2f0d6300f13
7
- data.tar.gz: cec9e493ec9a01b0d45ebb5bb004aa3840340dbbd43edd85c013ddeb484a1f1b1240eedb295f92925818f71f8ca64067bb3f8ac09016158c51c6e1e86da28f50
6
+ metadata.gz: 0f8165aa744318363832f74fde53762086ab1ba65c470ede8bfed41cac5bc14ce8b4464f503aafe05978bff2c615ce15cda576eb2793cdd2661fcc7eda26d729
7
+ data.tar.gz: 8e7134f82f4d78128b2b170e49daee6e2a323c7ae04677ae82eb1394a2382d2380f662ef38305a3c54bf620a629d46478566a6b55fcaa358ad766744a8344dbe
@@ -452,8 +452,11 @@ static GLFWwindow *rb_get_window(VALUE rb_window)
452
452
  * Creates a new window with the given parameters. If a shared window is
453
453
  * provided, the new window will use the context of the shared window.
454
454
  *
455
+ * If GLFW fails to create the window or an error occurred, this function will
456
+ * return nil.
457
+ *
455
458
  * call-seq:
456
- * new(width, height, title='', monitor=nil, shared_window=nil) -> Glfw::Window
459
+ * new(width, height, title='', monitor=nil, shared_window=nil) -> Glfw::Window or nil
457
460
  *
458
461
  * Wraps glfwCreateWindow.
459
462
  */
@@ -494,6 +497,9 @@ static VALUE rb_window_new(int argc, VALUE *argv, VALUE self)
494
497
 
495
498
  // Create GLFW window
496
499
  window = glfwCreateWindow(width, height, title, monitor, share);
500
+ if (window == NULL) {
501
+ return Qnil;
502
+ }
497
503
 
498
504
  // Allocate the window wrapper (only used to store the window pointer)
499
505
  rb_window_data = Data_Wrap_Struct(s_glfw_window_internal_klass, 0, 0, window);
@@ -1,8 +1,8 @@
1
1
  require 'glfw3/glfw3'
2
2
 
3
3
  module Glfw
4
- @@error_callback__ = nil
5
- @@monitor_callback__ = nil
4
+ @@__error_callback = nil
5
+ @@__monitor_callback = nil
6
6
 
7
7
  #
8
8
  # Gets the current error callback object.
@@ -11,7 +11,7 @@ module Glfw
11
11
  # error_callback -> obj or nil
12
12
  #
13
13
  def self.error_callback
14
- @@error_callback
14
+ @@__error_callback
15
15
  end
16
16
 
17
17
  #
@@ -28,7 +28,7 @@ module Glfw
28
28
  # }
29
29
  #
30
30
  def self.error_callback=(lambda)
31
- @@error_callback = lambda
31
+ @@__error_callback = lambda
32
32
  end
33
33
 
34
34
  #
@@ -45,7 +45,7 @@ module Glfw
45
45
  # monitor_callback -> obj or nil
46
46
  #
47
47
  def self.monitor_callback
48
- @@monitor_callback
48
+ @@__monitor_callback
49
49
  end
50
50
 
51
51
  #
@@ -62,7 +62,7 @@ module Glfw
62
62
  # }
63
63
  #
64
64
  def self.monitor_callback=(lambda)
65
- @@monitor_callback = lambda
65
+ @@__monitor_callback = lambda
66
66
  end
67
67
 
68
68
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glfw3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noel Raymond Cower
@@ -57,3 +57,4 @@ signing_key:
57
57
  specification_version: 4
58
58
  summary: GLFW3
59
59
  test_files: []
60
+ has_rdoc: true