Module: Vulkan::Finalizer

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



27
28
29
# File 'lib/vulkan/finalizer.rb', line 27

def self.included(base)
  base.module_eval { extend Vulkan::Finalizer::ClassMethods }
end

Instance Method Details

#finalize_with(vk, cleanup_method_name, *cleanup_method_args) ⇒ Object



31
32
33
# File 'lib/vulkan/finalizer.rb', line 31

def finalize_with(vk, cleanup_method_name, *cleanup_method_args)
  ObjectSpace.define_finalizer(self, self.class.finalizer(vk, cleanup_method_name, *cleanup_method_args))
end

#hexaddrObject



39
40
41
# File 'lib/vulkan/finalizer.rb', line 39

def hexaddr
  to_ptr.to_i.to_s(16)
end

#to_ptrObject



35
36
37
# File 'lib/vulkan/finalizer.rb', line 35

def to_ptr
  @handle
end