class RbSDL2::DisplayMode

Public Class Methods

new(format: 0, h: 0, height: h, refresh_rate: 0, w: 0, width: w) click to toggle source
# File lib/rb_sdl2/display_mode.rb, line 3
def initialize(format: 0, h: 0, height: h, refresh_rate: 0, w: 0, width: w)
  @st = ::SDL2::SDL_DisplayMode.new
  @st[:format] = PixelFormatEnum.to_num(format)
  @st[:w] = width
  @st[:h] = height
  @st[:refresh_rate] = refresh_rate
end

Public Instance Methods

format(= @st[:format]) click to toggle source
# File lib/rb_sdl2/display_mode.rb, line 11
   def format = @st[:format]

   require_relative 'pixel_format_enum'
   include PixelFormatEnum

   def inspect
     "#<#{self.class.name} pixel_format_name=#{pixel_format_name} w=#{w} h=#{h}\
refresh_rate=#{refresh_rate}>"
   end

   def width = @st[:w]

   alias w width

   def height = @st[:h]

   alias h height

   def refresh_rate = @st[:refresh_rate]

   def to_h = {format: format, w: w, h: h, refresh_rate: refresh_rate}

   def to_ptr = 
height(= @st[:h]) click to toggle source
# File lib/rb_sdl2/display_mode.rb, line 25
def height = @st[:h]

alias h height

def refresh_rate = @st[:refresh_rate]

def to_h = {format: format, w: w, h: h, refresh_rate: refresh_rate}

def to_ptr = @st.to_ptr
inspect() click to toggle source
# File lib/rb_sdl2/display_mode.rb, line 16
   def inspect
     "#<#{self.class.name} pixel_format_name=#{pixel_format_name} w=#{w} h=#{h}\
refresh_rate=#{refresh_rate}>"
   end
refresh_rate(= @st[:refresh_rate]) click to toggle source
# File lib/rb_sdl2/display_mode.rb, line 29
  def refresh_rate = @st[:refresh_rate]

  def to_h = {format: format, w: w, h: h, refresh_rate: refresh_rate}

  def to_ptr = @st.to_ptr
end
to_h(= {format: format, w: w, h: h, refresh_rate: refresh_rate}) click to toggle source
# File lib/rb_sdl2/display_mode.rb, line 31
    def to_h = {format: format, w: w, h: h, refresh_rate: refresh_rate}

    def to_ptr = @st.to_ptr
  end
end
to_ptr(= @st.to_ptr) click to toggle source
# File lib/rb_sdl2/display_mode.rb, line 33
  def to_ptr = @st.to_ptr
end
width(= @st[:w]) click to toggle source
# File lib/rb_sdl2/display_mode.rb, line 21
def width = @st[:w]

alias w width

def height = @st[:h]

alias h height

def refresh_rate = @st[:refresh_rate]

def to_h = {format: format, w: w, h: h, refresh_rate: refresh_rate}

def to_ptr = @st.