diff --git a/lib/waterfoul/screen.rb b/lib/waterfoul/screen.rb index 0315c96..74f7b9d 100644 --- a/lib/waterfoul/screen.rb +++ b/lib/waterfoul/screen.rb @@ -1,16 +1,19 @@ module Waterfoul class Screen + WINDOW_WIDTH = 480 + WINDOW_HEIGHT = 432 + SCREEN_WIDTH = 160 SCREEN_HEIGHT = 144 def initialize SDL.InitSubSystem SDL::INIT_VIDEO @buffer = FFI::MemoryPointer.new :uint32, SCREEN_WIDTH * SCREEN_HEIGHT - @window = SDL.CreateWindow 'waterfoul', 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, SDL::SDL_WINDOW_RESIZABLE + @window = SDL.CreateWindow 'waterfoul', 0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, SDL::SDL_WINDOW_RESIZABLE @renderer = SDL.CreateRenderer @window, -1, 0 - SDL.SetHint "SDL_RENDER_SCALE_QUALITY", "linear" - SDL.RenderSetLogicalSize(@renderer, SCREEN_WIDTH, SCREEN_HEIGHT) + SDL.SetHint "SDL_HINT_RENDER_SCALE_QUALITY", "2" + SDL.RenderSetLogicalSize(@renderer, WINDOW_WIDTH, WINDOW_HEIGHT) @texture = SDL.CreateTexture @renderer, SDL::PIXELFORMAT_ARGB8888, 1, SCREEN_WIDTH, SCREEN_HEIGHT end