Module: Vulkan::Platform

Included in:
Vulkan, DispatchTable
Defined in:
lib/vulkan/platform.rb

Instance Method Summary collapse

Instance Method Details

#calling_conventionObject



16
17
18
19
20
21
22
23
# File 'lib/vulkan/platform.rb', line 16

def calling_convention
  case Vulkan.os
  when :windows then Fiddle::Function::STDCALL
  else Fiddle::Function::DEFAULT
  end
rescue NameError
  Fiddle::Function::DEFAULT
end

#calling_convention_humanObject



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

def calling_convention_human
  case calling_convention
  when Fiddle::Function::STDCALL then :stdcall
  when Fiddle::Function::DEFAULT then :default
  else raise "BUG: can't identify calling convention???"
  end
rescue NameError
  :default
end

#osObject



25
26
27
28
29
30
31
32
# File 'lib/vulkan/platform.rb', line 25

def os
  case RbConfig::CONFIG['host_os']
  when /mswin|msys|mingw|cygwin|bccwin|wince|emc/ then :windows
  when /darwin|mac os/                            then :osx
  when /linux/, /solaris|bsd/                     then :linux
  else raise 'could not determine vulkan library to load for this OS'
  end
end