Method: CRT#initialize

Defined in:
lib/HDLRuby/hdr_samples/ruby_program/sw_cpu_terminal.rb

#initialize(width = 640, height = 480, px_width, px_height) ⇒ CRT

Returns a new instance of CRT.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/HDLRuby/hdr_samples/ruby_program/sw_cpu_terminal.rb', line 16

def initialize(width=640,height=480,px_width,px_height)
  super(width,height,false)

  @px_width  = px_width
  @px_height = px_height
  @cols = width / @px_width
  @rows = height / @px_height
  # puts "px_width=#{px_width} px_height=#{px_height} cols=#{@cols} rows=#{@rows}"

  # The screen buffer.
  @buf = [ Gosu::Color::BLACK ] * (@cols * @rows)

  # The last pressed key
  @key = nil
end