Class: RbSDL2::RWObject::SeekCallback
- Inherits:
-
FFI::Function
- Object
- FFI::Function
- RbSDL2::RWObject::SeekCallback
- Defined in:
- lib/rb_sdl2/rw_ops/rw_object.rb
Instance Method Summary collapse
-
#initialize ⇒ SeekCallback
constructor
A new instance of SeekCallback.
Constructor Details
#initialize ⇒ SeekCallback
Returns a new instance of SeekCallback.
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/rb_sdl2/rw_ops/rw_object.rb', line 42 def initialize # Sint64 (* seek) (struct RWops * context, Sint64 offset, int whence); super(:int64, [:pointer, :int64, :int]) do |_context, offset, whence| # SDL_RWseek() の仕様によりシーク後の現在位置を戻す必要がある。 yield(offset, whence) rescue => e raise e if $DEBUG Error. = e. -1 end end |