GMR::System

January 10, 2026 ยท View on GitHub

GMR Docs > Engine > Utilities > System

GMR::System

System utilities and debugging.

Table of Contents

Functions

quit

Exit the application cleanly. On native platforms, triggers proper shutdown through the main loop. On web, this is a no-op (user must close the browser tab).

Returns: nil

Example:

GMR::System.quit  # Exit the game

platform

Get the current platform identifier.

Returns: String - Platform name: "windows", "macos", "linux", "web", or "unknown"

Example:

if GMR::System.platform == "web"
  # Disable desktop-only features
end

build_type

Get the build configuration type.

Returns: String - Build type: "debug", "release", or "unknown"

Example:

if GMR::System.build_type == "debug"
  enable_debug_overlay
end

compiled_scripts?

Check if scripts were precompiled into the binary.

Returns: Boolean - true if scripts are compiled in, false if loading from files

Example:

puts "Scripts compiled: #{GMR::System.compiled_scripts?}"

raylib_version

Get the version of the underlying Raylib graphics library.

Returns: String - Raylib version string (e.g., "5.0")

Example:

puts "Raylib: #{GMR::System.raylib_version}"

gpu_vendor

Get the GPU vendor name from OpenGL.

Returns: String - GPU vendor name (e.g., "NVIDIA Corporation") or "unknown"

Example:

puts "GPU Vendor: #{GMR::System.gpu_vendor}"

gpu_renderer

Get the GPU renderer name from OpenGL.

Returns: String - GPU renderer name (e.g., "GeForce RTX 3080") or "WebGL"

Example:

puts "GPU: #{GMR::System.gpu_renderer}"

gl_version

Get the OpenGL version string.

Returns: String - OpenGL version (e.g., "4.6.0") or "WebGL 2.0"

Example:

puts "OpenGL: #{GMR::System.gl_version}"

glsl_version

Get the GLSL (shader language) version string.

Returns: String - GLSL version (e.g., "4.60") or "GLSL ES 3.00"

Example:

puts "GLSL: #{GMR::System.glsl_version}"

last_error

Get details about the last script error. Returns nil if no error occurred.

Returns: Hash, nil - Error hash with keys :class, :message, :file, :line, :backtrace, or nil

Example:

error = GMR::System.last_error
  if error
    puts "#{error[:class]}: #{error[:message]}"
    puts "  at #{error[:file]}:#{error[:line]}"
    error[:backtrace].each { |line| puts "    #{line}" }
  end

in_error_state?

Check if the scripting engine is currently in an error state.

Returns: Boolean - true if an unhandled error has occurred

Example:

if GMR::System.in_error_state?
  show_error_screen
end


Back to Utilities | Documentation Home