module RbSDL2::Hint

Public Class Methods

[](name) click to toggle source
# File lib/rb_sdl2/hint.rb, line 4
def [](name)
  ptr = ::SDL2.SDL_GetHint(name.to_s)
  ptr.null? ? nil : ptr.read_string
end
[]=(name, value) click to toggle source
# File lib/rb_sdl2/hint.rb, line 9
def []=(name, value)
  bool = ::SDL2.SDL_SetHintWithPriority(name.to_s, value&.to_s, ::SDL2::SDL_HINT_OVERRIDE)
  raise RbSDL2Error, "failed to set hint" if bool == ::SDL2::SDL_FALSE
end
clear(= ::SDL2.SDL_ClearHints) click to toggle source
# File lib/rb_sdl2/hint.rb, line 14
      def clear = ::SDL2.SDL_ClearHints

      def freeze = raise(TypeError, "cannot freeze Hint")

      def include?(name) = ::SDL2.SDL_GetHintBoolean(name, -1) != -1
      alias has_key? include?
      alias member? include?
      alias key? include?
    end
  end
end
freeze(= raise(TypeError, "cannot freeze Hint")) click to toggle source
# File lib/rb_sdl2/hint.rb, line 16
    def freeze = raise(TypeError, "cannot freeze Hint")

    def include?(name) = ::SDL2.SDL_GetHintBoolean(name, -1) != -1
    alias has_key? include?
    alias member? include?
    alias key? include?
  end
end
include?(name) click to toggle source
# File lib/rb_sdl2/hint.rb, line 18
  def include?(name) = ::SDL2.SDL_GetHintBoolean(name, -1) != -1
  alias has_key? include?
  alias member? include?
  alias key? include?
end