pixo 0.1.1 → 0.1.2

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: f53daf509714285e3142b89c58743c51e9ee3a61
4
- data.tar.gz: dea00526ae71fda41cef239d52c7cb7baa479ad2
3
+ metadata.gz: 36d3fd67327284d98c1b2af1116fc53795fbc177
4
+ data.tar.gz: c6d741b6de85cb8568cacc1648042635fa9ca4d3
5
5
  SHA512:
6
- metadata.gz: 2b06708eb866d7457a7622334511201c5441f9a2eba155d59ab930d8af71ff1ad1ecd21a1294412ace7b8ed5e3aa3a0ed9870bccbb3bd6a7e0dbf656d944a269
7
- data.tar.gz: c1484baa8eaf8b2cc4172bbc776ec7776cc8af334fdad7360c419ed44c0ec55e12c203f844058582fc6ee719d5f046538f8dda5c47f8fdc82eae667d749e3098
6
+ metadata.gz: cfdf40df5c80cf377537a973a75d4929fa2b7f7085950518c2dc6770109365ebede55fc105101f0543c60f57e153c011af0fe7de75e214c10696ac274026904b
7
+ data.tar.gz: 257a874b085cd34a10b6076561a83d6cc12f5196da57c1d5b50cd54ba2978ed4fa4561aca071b17ce228a6f31c7eb8bd19bb02deb2f1fd72cde866c609c85d56
@@ -14,17 +14,39 @@ ApplicationHolder::~ApplicationHolder() {
14
14
  delete app;
15
15
  app = nullptr;
16
16
  }
17
+ }
18
+
19
+ VALUE application_close(VALUE self)
20
+ {
21
+ ApplicationHolder * holder;
22
+
23
+ Data_Get_Struct(self, ApplicationHolder, holder);
24
+ if(holder->window) {
25
+
26
+ for(VALUE fc : holder->fade_candies) {
27
+
28
+ FadeCandyHolder * holder;
29
+
30
+ Data_Get_Struct(fc, FadeCandyHolder, holder);
31
+ if(holder->fade_candy) {
32
+ holder->fade_candy->clear();
33
+ }
34
+ }
17
35
 
18
- if (window) {
19
- glfwMakeContextCurrent(window);
20
36
 
37
+ glfwMakeContextCurrent(holder->window);
38
+
39
+ glfwSetWindowShouldClose(holder->window, true);
40
+ glfwPollEvents();
21
41
  // Close OpenGL window and terminate GLFW
22
- glfwDestroyWindow(window);
23
- window = nullptr;
42
+ glfwDestroyWindow(holder->window);
43
+ holder->window = nullptr;
44
+ return Qtrue;
24
45
  }
25
-
46
+ return Qfalse;
26
47
  }
27
48
 
49
+
28
50
  void application_mark(ApplicationHolder * holder)
29
51
  {
30
52
  for(VALUE fc : holder->fade_candies) {
@@ -21,6 +21,8 @@ public:
21
21
 
22
22
  VALUE application_allocate(VALUE klass);
23
23
 
24
+ VALUE application_close(VALUE self);
25
+
24
26
  VALUE application_initialize(VALUE self);
25
27
 
26
28
  VALUE application_add_fadecandy(VALUE self, VALUE fc);
@@ -41,10 +41,10 @@ extern "C" void Init_libpixgem() {
41
41
  rb_define_method(PatternClass, "reset_start", (VALUE(*)(ANYARGS))pattern_reset_start, 0);
42
42
  rb_define_method(PatternClass, "elapsed", (VALUE(*)(ANYARGS))pattern_elapsed, 0);
43
43
 
44
-
45
44
  VALUE ApplicationClass = rb_define_class_under(Native, "Application", rb_cObject);
46
45
  rb_define_alloc_func(ApplicationClass, application_allocate);
47
46
  rb_define_method(ApplicationClass, "initialize", (VALUE(*)(ANYARGS))application_initialize, 0);
47
+ rb_define_method(ApplicationClass, "close", (VALUE(*)(ANYARGS))application_close, 0);
48
48
  rb_define_method(ApplicationClass, "tick", (VALUE(*)(ANYARGS))application_tick, 1);
49
49
  rb_define_method(ApplicationClass, "add_fadecandy", (VALUE(*)(ANYARGS))application_add_fadecandy, 1);
50
50
 
@@ -54,6 +54,6 @@ namespace Pixlib {
54
54
  for (LedCluster* led_cluster : led_clusters) {
55
55
  led_cluster->render(viewed_from, *pattern);
56
56
  }
57
- //scene.render(camera, width, height);
57
+ scene.render(camera, width, height);
58
58
  }
59
59
  }
data/lib/pixo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pixo
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pixo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Constantine
@@ -1511,7 +1511,6 @@ files:
1511
1511
  - lib/pixo.rb
1512
1512
  - lib/pixo/version.rb
1513
1513
  - pixo.gemspec
1514
- - pkg/pixo-0.1.0.gem
1515
1514
  homepage: https://github.com/cconstantine
1516
1515
  licenses:
1517
1516
  - MIT
data/pkg/pixo-0.1.0.gem DELETED
Binary file