class CrystGLUT::Window

Defined in:

cryst_glut/window.cr

Constant Summary

NUM_KEYCODES = 1256

Constructors

Instance Method Summary

Constructor Detail

def self.new(width : Int32, height : Int32, title : String) #

[View source]

Instance Method Detail

def dispose #

Terminates the window


[View source]
def enable_cursor(enabled : Bool) #

Enables or disables the cursor icon


[View source]
def get_height : Int32 #

Returns the height of the window


[View source]
def get_keys_down #

returns the keys that are currently down


[View source]
def get_mouse_buttons_down #

returns the mouse buttons that are currently


[View source]
def get_mouse_x : Float32 #

returns the x coordinate of the mouse


[View source]
def get_mouse_y : Float32 #

Returns the y coordinate of the mouse


[View source]
def get_width : Int32 #

Returns the width of the window


[View source]
def is_close_requested : Bool #

Checks if the window has requested to close


[View source]
def is_key_down(key_code : Int32 | UInt8) : Bool #

checks if the key is down


[View source]
def is_mouse_down(key_code : Int32) : Bool #

checks if the mouse key is down


[View source]
def on_display(&block : -> ) #

Assigns a block to manage rendering the display


[View source]
def open #

Opens the window


[View source]
def render #

Process queued OpenGL commands


[View source]
def set_cursor(cursor : LibC::Int) #

Changes the icon of the cursor. Look up glutSetCursor for valid values.


[View source]
def set_mouse_position(x : Float32, y : Float32) #

sets the position of the mouse within the window


[View source]