EAGL.WindowBehaviour behaviour (eagl v0.2.0)
View SourceBehaviour for OpenGL window management. Handles window creation, OpenGL context setup, and event loop management.
Summary
Callbacks
Called when the window is being closed. Should clean up resources in state.
Called when an event occurs (keyboard, mouse, etc.). This callback is optional. If not implemented, events are ignored. Should return {:ok, new_state} to continue with updated state.
Called when the window needs to be rendered. The OpenGL context is already current and the viewport is set.
Called when the OpenGL context is ready and shaders should be created. Should return {:ok, state} or {:error, reason}
Callbacks
@callback cleanup(any()) :: :ok
Called when the window is being closed. Should clean up resources in state.
Called when an event occurs (keyboard, mouse, etc.). This callback is optional. If not implemented, events are ignored. Should return {:ok, new_state} to continue with updated state.
Called when the window needs to be rendered. The OpenGL context is already current and the viewport is set.
Called when the OpenGL context is ready and shaders should be created. Should return {:ok, state} or {:error, reason}