Crate nexg

source ·
Expand description

§Nexg

§Low-level fast GPU Api

GitHub License GitHub top language dependency status GitHub code size in bytes GitHub Actions Workflow Status

§Set up Device

use nexg::{InstanceFeature,InstanceBuilder};

 let feature = InstanceFeature::empty();
 let instance = InstanceBuilder::new().feature(feature).build().unwrap();
 let connecters = instance.enumerate_connecters().unwrap();
 let mut index = 0;
 let mut found_device = false;
 for i in &connecters {
    let properties = i.get_queue_family_properties(&instance).unwrap();
    for i in properties {
        if i.is_graphic_support() {
            index = 0;
            found_device = true;
            break;
        }
    }
 }
 if !found_device {
    panic!("No suitable device found.")
 }

 let connecter = connecters[index];

 let device = connecter.create_device(&instance, index).unwrap();

§Examples

§Triangle

Code

triangle

Structs§

Enums§

Traits§

  • Implement on objects that need to be destroyed. They are called from the instance or from the destroy method of the device.

Type Aliases§