abstract struct Gloop::Object

Overview

Base class for all OpenGL objects.

Objects are identified by their name (an integer).

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

Included Modules

Direct Known Subclasses

Defined in:

gloop/object.cr

Constructors

Instance Method Summary

Instance methods inherited from module Gloop::Labelable

label : String label, label=(label : Nil)
label=(label)
label=
, max_label_size : Int32 max_label_size, name name, object_type object_type

Constructor Detail

def self.new(context : Context, name : Name) #

Creates a reference to an existing object.

Requires a reference to the content that owns the object and its name.


[View source]
def self.none(context) : self #

Non-existent instance to be used as a null object.


[View source]

Instance Method Detail

def context : Context #

Context the object belongs to.


[View source]
def name : Name #

Unique identifier of this object.


[View source]
def none? #

Checks if this is a null object.


[View source]
abstract def object_type #

Enum indicating which type of object this is.


[View source]
def to_s(io) #

Constructs a string representation of the object.

Contains the object type and its name (unique identifier).


[View source]
def to_unsafe : UInt32 #

Retrieves a reference to the object that can be used in C bindings.

This returns the object name.


[View source]