ruby_rpg 0.1.5 → 0.1.6

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
  SHA256:
3
- metadata.gz: 7b5803af2d0a171d600991aaf3b4c7ffda6a541c20605ddfa5ca148a2fa12f01
4
- data.tar.gz: a3c734a69436244dcbddfa80c7c3dcfa0d4acaf51b3ecb2e709ba11936b5ef34
3
+ metadata.gz: 487c4b9d89badfd9843134e51c8afe0d31c4a823092db591b3be82627feafbaa
4
+ data.tar.gz: 22df9bad6699dd607409ba8b629b219b55d450a3ff028b3af32afa0254619016
5
5
  SHA512:
6
- metadata.gz: f64ad3415489bb49bb5bc66795556347d68714cbb1191643cef40a5bcd53e64fe346b9dd59496b4b94cd0096b74351c9630543e9240d05bdd49d3fc3dc0d8ba6
7
- data.tar.gz: 0376c83464b5ddc5b6942d2c8260c8a555b92ce52b12dc0178da4c465eacf8bf9a5b971324b6e172dabfa5ee64555c413beb1060c1ef9449b87b87b03f36d441
6
+ metadata.gz: 2da99e8799e661e4da75d1c1b04eafe746919029a0aae71fdd09668b01c1288324bc84c8ed631250475f90fae27bd7cdcbabadbfa18740a63a14f585ddf28344
7
+ data.tar.gz: a6ca33175401d5142037ce099327c31dbd43810f284c3383323682d5de3c5c2f03964ea3707237c81da00d8effbb0f78280c4d16dd9a3189c789deb177bf772e
@@ -490,6 +490,17 @@ static VALUE rb_gl_memory_barrier(VALUE self, VALUE barriers) {
490
490
  return Qnil;
491
491
  }
492
492
 
493
+ /* Initialize GLEW (Windows only) */
494
+ static VALUE rb_gl_init_glew(VALUE self) {
495
+ #if defined(_WIN32) || defined(__MINGW32__)
496
+ GLenum err = glewInit();
497
+ if (err != GLEW_OK) {
498
+ rb_raise(rb_eRuntimeError, "Failed to initialize GLEW: %s", glewGetErrorString(err));
499
+ }
500
+ #endif
501
+ return Qnil;
502
+ }
503
+
493
504
  /* Extension init */
494
505
  void Init_gl_native(void) {
495
506
  mGLNative = rb_define_module("GLNative");
@@ -567,4 +578,7 @@ void Init_gl_native(void) {
567
578
  rb_define_module_function(mGLNative, "bind_image_texture", rb_gl_bind_image_texture, 7);
568
579
  rb_define_module_function(mGLNative, "dispatch_compute", rb_gl_dispatch_compute, 3);
569
580
  rb_define_module_function(mGLNative, "memory_barrier", rb_gl_memory_barrier, 1);
581
+
582
+ /* GLEW initialization (Windows only, no-op on other platforms) */
583
+ rb_define_module_function(mGLNative, "init_glew", rb_gl_init_glew, 0);
570
584
  }
data/lib/engine/engine.rb CHANGED
@@ -23,6 +23,7 @@ module Engine
23
23
 
24
24
  Window.create_window
25
25
  GLFW.MakeContextCurrent(Window.window)
26
+ Engine::GL.InitGLEW
26
27
 
27
28
  Input.init
28
29
  Rendering::GpuTimer.enable if ENV['GPU_PROFILE']
data/lib/engine/gl.rb CHANGED
@@ -2,6 +2,10 @@ require 'gl_native'
2
2
 
3
3
  module Engine
4
4
  module GL
5
+ # Initialize GLEW (required on Windows before using OpenGL functions)
6
+ def self.InitGLEW
7
+ GLNative.init_glew
8
+ end
5
9
  # Cached methods - avoid redundant GL state changes
6
10
 
7
11
  def self.Enable(flag)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_rpg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Hatfull