Module: MilkTea::OpenGLRegistry
- Defined in:
- lib/milk_tea/bindings/opengl_registry.rb
Defined Under Namespace
Classes: BlockEntry, CommandEntry, CommandParam, EnumEntry, Error, ExtensionEntry, FeatureEntry, Generator, TypeEntry
Constant Summary
collapse
- DEFAULT_API =
"gl"
- DEFAULT_VERSION =
"4.6"
- DEFAULT_PROFILE =
"core"
- SOURCE_NAME =
"opengl_registry"
"gl_registry_helpers.h"
- IMPLEMENTATION_DEFINE =
"MT_LANG_GL_REGISTRY_HELPERS_IMPLEMENTATION"
Class Method Summary
collapse
Class Method Details
.prepare!(root: MilkTea.root, api: DEFAULT_API, version: DEFAULT_VERSION, profile: DEFAULT_PROFILE, extensions: []) ⇒ Object
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/milk_tea/bindings/opengl_registry.rb', line 37
def prepare!(root: MilkTea.root, api: DEFAULT_API, version: DEFAULT_VERSION, profile: DEFAULT_PROFILE, extensions: [])
registry_source = source(root:)
registry_source.bootstrap!
generated = Generator.new(
xml_path: registry_source.checkout_root.join("xml/gl.xml"),
api:,
version:,
profile:,
extensions:,
).generate
path = (root:)
FileUtils.mkdir_p(path.dirname)
return if File.exist?(path) && File.read(path) == generated
File.write(path, generated)
end
|
.source(root: MilkTea.root) ⇒ Object