File: caption.rb

package info (click to toggle)
ruby-sdl 2.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,344 kB
  • ctags: 4,200
  • sloc: cpp: 7,598; ansic: 4,475; ruby: 2,258; sh: 102; makefile: 97
file content (21 lines) | stat: -rw-r--r-- 469 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- coding: euc-jp -*-
require 'sdl'
SDL.init(SDL::INIT_VIDEO)
screen = SDL::Screen.open(640, 480, 16, SDL::SWSURFACE)
SDL::WM::set_caption('ץΥƥ','ץ')

s,* = SDL::WM.caption
STDOUT.puts s.encode('external')
p s.encoding
loop do
  while event = SDL::Event.poll
    case event
    when SDL::Event::KeyDown, SDL::Event::Quit
      exit
    end
  end
  screen.fill_rect(0, 0, 640, 480, 0)
  screen.update_rect(0, 0, 0, 0)

  SDL.delay(10)
end