module Eagle::GPU

Overview

The layer between Eagle and the graphics API. Everything draws through GPU.device, which is OpenGL 3.3 on desktop and WebGL2 in the browser.

Game code rarely touches this module directly. You meet its enums as arguments elsewhere: BlendMode for Graphics#blend= and particles, Filter and Wrap for textures, and UniformValue for shader uniforms. Shaders are written in the common subset of GLSL 3.30 and GLSL ES 3.00, and each backend adds its own prelude.

Defined in:

eagle/gpu/device.cr
eagle/gpu/gl33.cr

Class Method Summary

Class Method Detail

def self.device : Device #

The active device. Raises if called before the engine has started, which usually means a texture or shader was created too early. Create them in App#load or Node#ready.


def self.device=(d : Device | Nil) #

Sets the active device. The engine does this.


def self.ready? : Bool #

True once a device exists.