class GL::Registry::FeatureProvider

@abstract Base class for objects that add definitions to the API.

Attributes

additions[R]

@return [Array<Feature>] an array of features that this instance provides.

api[R]

@return [Symbol] the name of the API this feature is defined within.

name[R]

@return [String] the name of the feature set.

Public Class Methods

new(node) click to toggle source

Creates a new instance of the {FeatureProvider} class.

@param node [Ox::Element] The XML element defining the instance.

Calls superclass method
# File lib/opengl/registry/feature_provider.rb, line 24
def initialize(node)
  super(node)

  @api = node[Words::API]&.to_sym || :none
  @name = node[Words::NAME]

  @additions = []
  node.locate('require').each do |child|

    api = child[Words::API]&.to_sym || @api
    profile = child[Words::PROFILE]&.to_sym

    child.nodes.each do |item|
      next unless item.is_a?(Ox::Element)
      @additions << Feature.new(item, api, profile)
    end
  end
end