pixo 0.4.2 → 0.4.3

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: 031f9ec2cb9498e875515af2abfe58a4af01f47b
4
- data.tar.gz: 3108f3d5c94aa8c0cbd5cf75fd5c3dc3435ab1db
3
+ metadata.gz: 2ccf025fb1c7e0532685261b56e179535c54857a
4
+ data.tar.gz: f62b87408c091e86dbd17e2ce495edf37733fbaa
5
5
  SHA512:
6
- metadata.gz: d73ca73680ce3cb613c22ea0b3d52e5585642f798266db8f400cc6962c0c25306a81bd726c86cd7013efa41b4efae28b10ae673324a0ed282856abf26c198a1e
7
- data.tar.gz: 1b1eac96f5011bb8d315757edca36f4dab062737c77edd3149dafc610bc5b562867df44c14957eb5ad037f37e02680f2b2b0f05082bb507c99f3f66cfc9cd9b4
6
+ metadata.gz: b838da4067c73c0817dd4820ebb9bafd59be463e5dbdbeea01b4663f56e4ba8177494771605b18e6a5bd275566c91c7f16f06da134a6ef3d3890c88b18544bfb
7
+ data.tar.gz: 5b289741fd6e98eb1756fddab9ae9cacb33624bff1748895b47312a4a74ac03e281bda9fcb51988bf7212f823487645735e36c1b91c7491c82e74c7febcbed5e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pixo (0.4.2)
4
+ pixo (0.4.3)
5
5
  concurrent-ruby
6
6
 
7
7
  GEM
data/exe/pixo CHANGED
@@ -2,8 +2,16 @@
2
2
 
3
3
  require 'pixo'
4
4
  require 'pixo/application'
5
+ require 'optparse'
5
6
 
6
- app = Pixo::Application.new
7
+
8
+ options = {}
9
+ OptionParser.new do |opts|
10
+ opts.on('-f', '--fullscreen', 'Start in fullscreen mode') { |v| options[:fullscreen] = v }
11
+ end.parse!
12
+
13
+
14
+ app = Pixo::Application.new(options[:fullscreen])
7
15
 
8
16
  Signal.trap('INT') { app.shutdown }
9
17
  Signal.trap('TERM') { app.shutdown }
@@ -73,13 +73,14 @@ VALUE application_allocate(VALUE klass)
73
73
  }
74
74
 
75
75
 
76
- VALUE application_initialize(VALUE self)
76
+ VALUE application_initialize(VALUE self, VALUE rb_full_screen)
77
77
  {
78
78
  ApplicationHolder * holder;
79
79
 
80
80
  Data_Get_Struct(self, ApplicationHolder, holder);
81
81
 
82
82
  holder->self = self;
83
+
83
84
 
84
85
  glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
85
86
  glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
@@ -90,7 +91,18 @@ VALUE application_initialize(VALUE self)
90
91
  // Open a window and create its OpenGL context
91
92
  GLFWmonitor* monitor = glfwGetPrimaryMonitor();
92
93
  const GLFWvidmode* mode = glfwGetVideoMode(monitor);
93
- holder->window = glfwCreateWindow( mode->width, mode->height, "Pixo", monitor, NULL);
94
+
95
+ int width = mode->width;
96
+ int height = mode->height;
97
+
98
+ if(!RTEST(rb_full_screen) ) {
99
+ width = width / 4;
100
+ height = height / 4;
101
+ monitor = NULL;
102
+ }
103
+
104
+
105
+ holder->window = glfwCreateWindow( width, height, "Pixo", monitor, NULL);
94
106
  if( holder->window == NULL ){
95
107
  ALOGV( "Failed to open GLFW window. If you have an Intel GPU, they are not 3.3 compatible. Try the 2.1 version of the tutorials.\n" );
96
108
  getchar();
@@ -27,7 +27,7 @@ VALUE application_key_callback(VALUE self, VALUE key, VALUE scancode, VALUE acti
27
27
 
28
28
  VALUE application_close(VALUE self);
29
29
 
30
- VALUE application_initialize(VALUE self);
30
+ VALUE application_initialize(VALUE self, VALUE rb_full_screen);
31
31
 
32
32
  VALUE application_add_fadecandy(VALUE self, VALUE fc);
33
33
 
@@ -43,7 +43,7 @@ extern "C" void Init_libpixgem() {
43
43
 
44
44
  VALUE ApplicationClass = rb_define_class_under(Native, "Application", rb_cObject);
45
45
  rb_define_alloc_func(ApplicationClass, application_allocate);
46
- rb_define_method(ApplicationClass, "initialize", (VALUE(*)(ANYARGS))application_initialize, 0);
46
+ rb_define_method(ApplicationClass, "initialize", (VALUE(*)(ANYARGS))application_initialize, 1);
47
47
  rb_define_method(ApplicationClass, "close", (VALUE(*)(ANYARGS))application_close, 0);
48
48
  rb_define_method(ApplicationClass, "tick", (VALUE(*)(ANYARGS))application_tick, 2);
49
49
  rb_define_method(ApplicationClass, "key_callback", (VALUE(*)(ANYARGS))application_key_callback, 4);
@@ -8,8 +8,8 @@ module Pixo
8
8
  attr_accessor :running, :leds_on
9
9
  attr_reader :patterns
10
10
 
11
- def initialize()
12
- super
11
+ def initialize(full_screen = nil)
12
+ super(full_screen)
13
13
  @procs = Concurrent::Array.new
14
14
 
15
15
  @procs_lock = Mutex.new
data/lib/pixo/renderer.rb CHANGED
@@ -2,8 +2,8 @@ module Pixo
2
2
  class Renderer < Pixo::Rpc::Service
3
3
  attr_reader :service_thread
4
4
 
5
- def initialize
6
- i, o, t = Open3.popen2('bundle exec pixo')
5
+ def initialize(fullscreen = false)
6
+ i, o, t = Open3.popen2("bundle exec pixo #{'--fullscreen' if fullscreen}")
7
7
  super(o, i)
8
8
  @service_thread = Thread.new { self.run }
9
9
  end
data/lib/pixo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pixo
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pixo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Constantine
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-09 00:00:00.000000000 Z
11
+ date: 2017-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby