EAGL.Error (eagl v0.1.0)

View Source

OpenGL error handling utilities. Provides functions for checking and reporting OpenGL errors.

Summary

Functions

Check for OpenGL errors and print them. Similar to Wings3D's check_error/2 function.

Check for OpenGL errors and raise an exception if one is found. Useful for development and debugging.

Get a human-readable string for an OpenGL error code. Similar to Wings3D's error_string/1 function.

Functions

check(context \\ "OpenGL")

@spec check(String.t()) :: :ok | {:error, String.t()}

Check for OpenGL errors and print them. Similar to Wings3D's check_error/2 function.

Parameters

  • context: String describing the context where the error check is performed

Returns

  • :ok if no error
  • {:error, error_message} if an error occurred

Example

EAGL.Error.check("After buffer creation")
EAGL.Error.check("Shader compilation")

check!(context \\ "OpenGL")

@spec check!(String.t()) :: :ok

Check for OpenGL errors and raise an exception if one is found. Useful for development and debugging.

error_string(error_code)

@spec error_string(integer()) :: String.t()

Get a human-readable string for an OpenGL error code. Similar to Wings3D's error_string/1 function.