stbimage 0.2.1 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dee6483bc900314ff5c02f734ebc3ddeadfeffa3e780ee564a54fc44008406d2
4
- data.tar.gz: e95ea2ba342e53eebdc9fb1b7390bb705f6cdc7f6993af69fca0b0a0363a3dbb
3
+ metadata.gz: 32f96cdeb03fd88a7e4b6d29158af7d6ae1a646001b01914d8159d98b1765528
4
+ data.tar.gz: 1e02ba30e6eace68f587b89914109aa379fe1361830bde57af79a7fdb4c37892
5
5
  SHA512:
6
- metadata.gz: c61cbd2a8e1084834aff19e41d7245e189251feef10829eab4a8bf3676b8b1224062e5a1a2978545e0b08bf32bec59efdd05f468a4f483cc5bfb016421684bff
7
- data.tar.gz: 01af2da836ff901fa79784779d3679920d82e84ef3fde5d9dc6d7aa2ec444516d8ea0f8a0c2d40d4e5b7836e27f803f624f91918ca749f5dd396f3e5109ac287
6
+ metadata.gz: 5ac1c2781afdd7561d3d890af931a89360db9cc4cdf09ac0754cde72ffb328bd400f44f5b4b39eb5aefdb5dffeb0cb7b421cf0e7e33246f05bcb5eb7ce2a72ea
7
+ data.tar.gz: c8591f92dfbf67d77a77e6b3980392133a894f6c700d9a9e61c16842cc11571929234afda38e2afe0ee0172bcfcb1d24ec9e4e3d285a93d388d8a17e91c4a2ce
@@ -0,0 +1,46 @@
1
+ # stbimage-ruby
2
+ Binding of stb-image into the ruby programing language.
3
+
4
+ # Tutorials
5
+
6
+ 1. To use this gem first install it with:
7
+ `gem install stbimage`
8
+ 2. Require it in your project with\
9
+ `require 'stbimage'`
10
+ 3. Load your dll dynamic libary what is in your projects root folder!!! (Download the dlls: visit my webpage.)\
11
+ `STBIMAGE.load_lib()`
12
+ 4. Then you can use it :D
13
+
14
+ # About the dll libs
15
+
16
+ You can find it under [dlls](dlls) folder
17
+
18
+ # A full Example:
19
+
20
+ ```ruby
21
+ require 'stb_image'
22
+
23
+ # Note that you need to name your dll file to stbDLL.dll in this case
24
+ STBIMAGE.load_lib()
25
+ # Or if you want to specify another name for it, use:
26
+ # STBIMAGE.load_lib('your_name.dll')
27
+
28
+ # But don't forget that ruby searches your dll file in your current directory!
29
+
30
+ width = ' ' * 4
31
+ height = ' ' * 4
32
+ nr_channels = ' ' * 4
33
+
34
+ data = STBIMAGE.stbi_load("blue-poly.jpg", width, height, nr_channels, 0)
35
+
36
+ puts data
37
+
38
+ puts width.unpack('l')[0]
39
+ puts height.unpack('l')[0]
40
+ puts nr_channels.unpack('l')[0]
41
+ ```
42
+
43
+ # Credit
44
+
45
+ Credit to Vaiorabbit who made the bindings of opengl into ruby! This wrapper is based on his glfw wrapper. :D \
46
+ His repo: https://github.com/vaiorabbit/ruby-opengl
Binary file
Binary file
@@ -39,9 +39,9 @@ Load native dll libary
39
39
  def self.load_lib(lib = nil, path = nil, output_error = false)
40
40
  if lib == nil && path == nil
41
41
  if RUBY_PLATFORM == "x64-mswin64_140" || RUBY_PLATFORM == "x64-mingw32"
42
- lib, path = 'stbDLL_x64.dll', '../dlls'
42
+ lib, path = 'stbDLL_x64.dll', "#{__dir__}/../dlls"
43
43
  elsif RUBY_PLATFORM == "x86-mingw32"
44
- lib, path = 'stbDLL_x86.dll', '../dlls'
44
+ lib, path = 'stbDLL_x86.dll', "#{__dir__}/../dlls"
45
45
  end
46
46
  end
47
47
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stbimage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Keresztes
@@ -11,13 +11,18 @@ cert_chain: []
11
11
  date: 2021-01-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: "!Beta Version! Will be developed! So far compatible with: stbi_load,
14
- stbi_set_flip_vertically_on_load(). Only works with windows so far!!!!!. PLEASE
15
- CHECK OUT THE HOMEPAGE FOR MORE INFO AND EXAMPLE"
14
+ stbi_set_flip_vertically_on_load(). \n Only works with windows so far!!!!! (win32/win64).
15
+ PLEASE CHECK OUT THE HOMEPAGE FOR MORE INFO AND EXAMPLE. With 0.2.3 and above dlls
16
+ are included so 'STBIMAGE.load_lib()'\n should be enough for linking shared liaries.
17
+ So it's worth to upgrade 0.2.3! "
16
18
  email: ''
17
19
  executables: []
18
20
  extensions: []
19
21
  extra_rdoc_files: []
20
22
  files:
23
+ - README.md
24
+ - dlls/stbDLL_x64.dll
25
+ - dlls/stbDLL_x86.dll
21
26
  - lib/stbimage.rb
22
27
  homepage: https://github.com/fellowchap-samuel/stbimage-ruby
23
28
  licenses: