struct Gloop::Debug

Overview

Interacts with OpenGL's debugging features.

See: https://www.khronos.org/opengl/wiki/Debug_Output

Included Modules

Defined in:

gloop/debug.cr
gloop/debug/message.cr
gloop/debug/message_iterator.cr
gloop/debug/severity.cr
gloop/debug/source.cr
gloop/debug/type.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(context : Gloop::Context) #

Creates a resource associated with a context.


[View source]

Instance Method Detail

def allow(ids : Indexable(UInt32), *, source : Source = :dont_care, type : Type = :dont_care) : Nil #

Specifies IDs of debug messages to receive.

Messages can be allowed by specifying any combination of source and type flags.

NOTE Severity cannot be set with this method.

See: #reject

  • OpenGL function: glDebugMessageControl
  • OpenGL version: 4.3

[View source]
def allow(*, source : Source = :dont_care, type : Type = :dont_care, severity : Severity = :dont_care) : Nil #

Specifies debug messages to receive.

Messages can be allowed by specifying any combination of source, type, and severity flags.

See: #reject

  • OpenGL function: glDebugMessageControl
  • OpenGL version: 4.3

[View source]
def clear : Nil #

Removes all pending debug messages from the queue.


[View source]
def clear_on_message : Nil #

Clears a previously set callback.

This effectively undoes #on_message.

It is recommended to call this method before cleaning up the OpenGL context.

  • OpenGL function: glDebugMessageCallback
  • OpenGL version: 4.3

[View source]
def disable : Nil #

Disables the capability.

  • OpenGL function: glDisable
  • OpenGL enum: GL_DEBUG_OUTPUT
  • OpenGL version: 4.3

[View source]
def disable_sync #

Disables the sync capability.

  • OpenGL function: glDisable
  • OpenGL enum: GL_DEBUG_OUTPUT_SYNCHRONOUS
  • OpenGL version: 4.3

[View source]
def enable : Nil #

Enables the capability.

  • OpenGL function: glEnable
  • OpenGL enum: GL_DEBUG_OUTPUT
  • OpenGL version: 4.3

[View source]
def enable_sync #

Enables the sync capability.

  • OpenGL function: glEnable
  • OpenGL enum: GL_DEBUG_OUTPUT_SYNCHRONOUS
  • OpenGL version: 4.3

[View source]
def enabled=(flag) #

Enables or disables the capability depending on flag.


[View source]
def enabled? #

Checks if the capability is enabled.

  • OpenGL function: glIsEnabled
  • OpenGL enum: GL_DEBUG_OUTPUT
  • OpenGL version: 4.3

[View source]
def group(message, source : Source = :application, id : UInt32 = 0, &) #

Pushes a debug group onto the stack and yields. Pops the debug group after the block returns.

See: #push, #pop


[View source]
def insert(message) : Nil #

Sends a debug message to OpenGL's debug message queue.

See: Message#insert


[View source]
def log(message, *, severity : Severity = :notification, type : Type = :other, source : Source = :application, id : UInt32 = 0) : Nil #

Sends a debug message to OpenGL's debug message queue.

See: Message#insert


[View source]
def messages : MessageIterator #

Provides access to all pending debug messages in the queue.


[View source]
def on_message(&block : Message -> ) : Nil #

Sets a callback to be invoked when OpenGL sends a debug message.

The block provided to this method will be called when a message is received. This method returns immediately after the callback has been established. Subsequent calls to this method will overwrite the previous callback. Only one callback (the latest) will be invoked. The block will be given a Message instance containing the debug message as an argument.

  • OpenGL function: glDebugMessageCallback
  • OpenGL version: 4.3

[View source]
def pop : Nil #

Pops a debug group off of the stack.

  • OpenGL function: glPopDebugGroup
  • OpenGL version: 4.3

[View source]
def push(message, source : Source = :application, id : UInt32 = 0) : Nil #

Pushes a debug group onto the stack.

  • OpenGL function: glPushDebugGroup
  • OpenGL version: 4.3

[View source]
def reject(ids : Indexable(UInt32), *, source : Source = :dont_care, type : Type = :dont_care) : Nil #

Specifies IDs of debug messages to ignore.

Messages can be ignored by specifying any combination of source and type flags.

NOTE Severity cannot be set with this method.

See: #reject

  • OpenGL function: glDebugMessageControl
  • OpenGL version: 4.3

[View source]
def reject(*, source : Source = :dont_care, type : Type = :dont_care, severity : Severity = :dont_care) : Nil #

Specifies debug messages to ignore.

Messages can be ignored by specifying any combination of source, type, and severity flags.

See: #reject

  • OpenGL function: glDebugMessageControl
  • OpenGL version: 4.3

[View source]
def sync=(flag) #

Enables or disables the sync capability depending on flag.


[View source]
def sync? #

Checks if the sync capability is enabled.

  • OpenGL function: glIsEnabled
  • OpenGL enum: GL_DEBUG_OUTPUT_SYNCHRONOUS
  • OpenGL version: 4.3

[View source]