<commit_before><commit_msg>Add hello_triangle Example<commit_after>extern crate bootstrap_rs as bootstrap;
extern crate gl_util as gl;

use bootstrap::window::*;
use gl::*;

static VERTEX_POSITIONS: [f32; 9] = [
    -1.0, -1.0, 0.0,
     1.0, -1.0, 0.0,
     0.0,  1.0, 0.0,
];

fn main() {
    let mut window = Window::new("Hello, Triangle!");

    gl::init();
    let mut vertex_buffer = VertexBuffer::new();
    vertex_buffer.set_data_f32(&VERTEX_POSITIONS[..]);
    vertex_buffer.set_attrib_f32(AttributeLocation::from_index(0), 3, 0, 0);

    'outer: loop {
        while let Some(message) = window.next_message() {
            match message {
                Message::Close => break 'outer,
                _ => {},
            }

            gl::clear();
            vertex_buffer.draw(DrawMode::Triangles, 0, 3);
            gl::swap_buffers();
        }
    }
}
{'fraction_non_alphanumeric': 0.15517241379310345, 'fraction_numerical': 0.035632183908045977, 'mean_word_length': 2.4156862745098038, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '352421', 'n_tokens_mistral': 320, 'n_tokens_neox': 295, 'n_words': 62}