Class: Vulkan::Semaphore

Inherits:
Object
  • Object
show all
Includes:
Checks, Finalizer
Defined in:
lib/vulkan/semaphore.rb

Instance Method Summary collapse

Methods included from Finalizer

#finalize_with, #hexaddr, included, #to_ptr

Methods included from Checks

#check_result

Constructor Details

#initialize(vk) ⇒ Semaphore

Returns a new instance of Semaphore.



6
7
8
9
10
11
12
13
14
# File 'lib/vulkan/semaphore.rb', line 6

def initialize(vk)
  @vk = vk
  semaphore_info = VkSemaphoreCreateInfo.malloc
  semaphore_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
  sem_p = Vulkan.create_value('void *', nil)
  check_result @vk.vkCreateSemaphore(@vk.device, semaphore_info, nil, sem_p)
  @handle = sem_p.value
  finalize_with @vk, :vkDestroySemaphore, @vk.device, @handle, nil
end