Class: SDL2::Window::Data

Inherits:
Object
  • Object
show all
Defined in:
lib/sdl2/window.rb

Overview

A simple wrapper for data objects associated with a window.

Instance Method Summary collapse

Constructor Details

#initialize(for_window) ⇒ Data

Create a data object manager for a given window



117
118
119
# File 'lib/sdl2/window.rb', line 117

def initialize(for_window)
  @for_window = for_window
end

Instance Method Details

#named(name) ⇒ Object Also known as: []

Return the data named



122
123
124
# File 'lib/sdl2/window.rb', line 122

def named(name)
  SDL2.get_window_data(@for_window, name.to_s)
end

#named=(name, value) ⇒ Object Also known as: []=

Set the data named to value specified.



129
130
131
# File 'lib/sdl2/window.rb', line 129

def named=(name, value)
  SDL2.set_window_data(@for_window, name.to_s, value.to_s)
end