Class: SDL2::Version
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- SDL2::Version
- Defined in:
- lib/sdl2/version.rb
Overview
Used to identify linked versions of libraries. Used by SDL2, SDL_Image, SDL_ttf, and etc.
Class Method Summary collapse
-
.release(pointer) ⇒ Object
Release memory held by a Version struct.
Instance Method Summary collapse
-
#major ⇒ Object
The major X.0.0 part.
-
#minor ⇒ Object
The minor 0.X.0 part.
-
#patch ⇒ Object
the patch 0.0.X part.
-
#to_s ⇒ Object
Human-readable version string.
Class Method Details
.release(pointer) ⇒ Object
Release memory held by a Version struct
13 14 15 |
# File 'lib/sdl2/version.rb', line 13 def self.release(pointer) pointer.free end |
Instance Method Details
#major ⇒ Object
The major X.0.0 part
18 19 20 |
# File 'lib/sdl2/version.rb', line 18 def major self[:major] end |
#minor ⇒ Object
The minor 0.X.0 part
23 24 25 |
# File 'lib/sdl2/version.rb', line 23 def minor self[:minor] end |
#patch ⇒ Object
the patch 0.0.X part
28 29 30 |
# File 'lib/sdl2/version.rb', line 28 def patch self[:patch] end |
#to_s ⇒ Object
Human-readable version string
33 34 35 |
# File 'lib/sdl2/version.rb', line 33 def to_s "v#{major}.#{minor}.#{patch}" end |