pixo 0.1.3 → 0.1.4

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: 6e56b9a583b7ea9db97ea230b400a9f85cb3afbf
4
- data.tar.gz: 498d1a8eca5fc00d7923a3ee310cc5d20c11b73c
3
+ metadata.gz: a444740a2f108681ab80d667312e292dd4636939
4
+ data.tar.gz: 2c029fc83f3daa384909d61f5c08293f1312ac76
5
5
  SHA512:
6
- metadata.gz: 03d25ddfd83655027de8326453e9f9a62d67f51f27b73aa961f1b334582b1360225a46d329b55f233bf5f6dae4fa69b422f2d87ea4e0976963b9e4bba158a3ae
7
- data.tar.gz: 6cc7803b4abb46612c60808eff2447896b29bdbf5986fee827fbd6979592c3accc469276e1eac20e7800753fd8942cc49d6574432498220d6bb745d171df4406
6
+ metadata.gz: 64b419177900e6b30a2ccaae9ebdf843f1cbcc5e4c65f2f0a15d078436be7bec0493162155f941ad931999bd7c28ae4168f8d1b4d608752b92057acbe82e3b6c
7
+ data.tar.gz: 942e391caa23842fa73e331516a42b7d739fe668ce8a9d33ffa7b01822633bfc5248b95031ae6083a25d717338256ecfd26fcbbaf4640488b7f1608d7276709e
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pixo (0.1.3)
4
+ pixo (0.1.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -2,6 +2,10 @@
2
2
  cmake_minimum_required(VERSION 3.0)
3
3
  project(pixo)
4
4
 
5
+ if (APPLE)
6
+ set(CMAKE_FIND_FRAMEWORK LAST)
7
+ set(CMAKE_FIND_APPBUNDLE LAST)
8
+ endif()
5
9
 
6
10
  include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/libpixgem/include )
7
11
  add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/pixo EXCLUDE_FROM_ALL)
@@ -25,7 +29,17 @@ add_library(pixgem SHARED
25
29
  libpixgem/src/fade_candy.cpp
26
30
  libpixgem/src/camera.cpp
27
31
  )
28
- target_link_libraries(pixgem glfw libglew_static pthread pixlib)
32
+
33
+
34
+ if (APPLE)
35
+ set_target_properties(pixgem
36
+ PROPERTIES
37
+ SUFFIX ".bundle"
38
+ LINK_FLAGS "-flat_namespace" )
39
+ endif()
40
+
41
+
42
+ target_link_libraries(pixgem glfw libglew_static pthread pixlib ${RUBY_LIBRARY})
29
43
 
30
44
  # Ruby gems require a install target.
31
45
  install(TARGETS pixgem
@@ -4,4 +4,54 @@ require File.expand_path('../libpixgem', __FILE__)
4
4
 
5
5
  module Pixo
6
6
 
7
+ class Application < Pixo::Native::Application
8
+ attr_accessor :running
9
+
10
+ def initialize()
11
+ super
12
+ self.running = true
13
+
14
+ add_fadecandy(Pixo::Native::FadeCandy.new('localhost', 8))
15
+ end
16
+
17
+ def run
18
+ p active_pattern
19
+ while(
20
+ running &&
21
+ tick(active_pattern))
22
+ if (active_pattern.elapsed > 10 * 60)
23
+ self.active_pattern = random_pattern
24
+ end
25
+ end
26
+ close
27
+ end
28
+
29
+
30
+ def patterns
31
+ unless @patterns
32
+ @patterns = Hash.new
33
+ patterns_dir = File.join(File.dirname(__FILE__), "..", 'ext', 'pixo', 'patterns')
34
+ Dir.entries(patterns_dir).each do | pattern_file|
35
+ next unless pattern_file.end_with?('.glsl')
36
+ @patterns[pattern_file] = Pixo::Native::Pattern.new(File.read(File.join(patterns_dir, pattern_file)))
37
+ end
38
+ end
39
+ @patterns
40
+ end
41
+
42
+ def active_pattern
43
+ @active_pattern ||= random_pattern
44
+ end
45
+
46
+ def random_pattern
47
+ patterns[patterns.keys.sample]
48
+ end
49
+
50
+ def active_pattern=(pattern)
51
+ pattern.reset_start
52
+ @active_pattern = pattern
53
+ end
54
+
55
+ end
56
+
7
57
  end
@@ -1,3 +1,3 @@
1
1
  module Pixo
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
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.1.3
4
+ version: 0.1.4
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-09-11 00:00:00.000000000 Z
11
+ date: 2017-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -1531,7 +1531,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1531
1531
  version: '0'
1532
1532
  requirements: []
1533
1533
  rubyforge_project:
1534
- rubygems_version: 2.6.11
1534
+ rubygems_version: 2.6.13
1535
1535
  signing_key:
1536
1536
  specification_version: 4
1537
1537
  summary: Write a short summary, because Rubygems requires one.