Class: BeltsOpengl::WindowSystem

Inherits:
BeltsEngine::System
  • Object
show all
Defined in:
lib/belts_opengl/systems/window_system.rb

Instance Method Summary collapse

Instance Method Details

#startObject



3
4
5
6
7
8
9
# File 'lib/belts_opengl/systems/window_system.rb', line 3

def start
  GLFW.WindowHint(GLFW::ALPHA_BITS, 0)
  @window = GLFW.CreateWindow(640, 480, "Belts Demo", nil, nil)
  GLFW.MakeContextCurrent(@window)

  @input_manager = BeltsOpengl::InputManager.new(@game, @window)
end

#updateObject



11
12
13
14
15
16
17
18
# File 'lib/belts_opengl/systems/window_system.rb', line 11

def update
  update_window_size

  GLFW.SwapBuffers(@window)
  GLFW.PollEvents()

  @input_manager.update
end