<commit_before>var pex = pex || require('../../build/pex');

pex.sys.Window.create({
  settings: {
    width: 1280,
    height: 720,
    type: '3d',
    vsync: true,
    multisample: true,
    fullscreen: false,
    center: true
  },
  init: function() {
    this.material = new pex.materials.SolidColorMaterial();
  },
  draw: function() {
    var gl = pex.gl.Context.currentContext.gl;
    gl.clearColor(1, 0, 0, 1);
    gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
  }
})

/*
Pex.run([
  "pex/core/Core",
  "pex/sys/Window",
  "pex/cameras/PerspectiveCamera",
  "pex/cameras/Arcball",
  "pex/geom/Geom",
  "pex/materials/Materials"
  ],
  function(Core, Window, PerspectiveCamera, Arcball, Geom, Materials) {
    Window.create({
      settings: {
        width: 1280,
        height: 720,
        type: '3d',
        vsync: true,
        multisample: true,
        fullscreen: false,
        center: true
      },
      init: function() {
        var gl = Core.Context.currentContext.gl;

        gl.clearColor(0, 0, 0, 1);
        gl.enable(gl.DEPTH_TEST);

        this.camera = new PerspectiveCamera(60, this.width/this.height);
        this.arcball = new Arcball(this, this.camera);
        this.mesh = new Core.Mesh(new Geom.Cube(), new Materials.TestMaterial());
        this.mesh.material.uniforms.color = new Core.Vec4(1.0, 0.0, 0.0, 1.0);

        this.framerate(30);
      },
      draw: function() {
        var gl = Core.Context.currentContext.gl;
        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);

        this.mesh.draw(this.camera);
      }
    });
  }
);
*/
<commit_msg>Basic example with rotating cube<commit_after>var pex = pex || require('../../build/pex');

pex.sys.Window.create({
  settings: {
    width: 1280,
    height: 720,
    type: '3d',
    vsync: true,
    multisample: true,
    fullscreen: false,
    center: true
  },
  init: function() {
    this.camera = new pex.scene.Camera(60, this.width/this.height);
    new pex.scene.Arcball(this, this.camera, 2);
    var cube = new pex.geom.gen.Cube();
    cube.rotation = pex.geom.Quat.create();
    var solidMaterial = new pex.materials.SolidColorMaterial();
    this.mesh = new pex.gl.Mesh(cube, solidMaterial);
  },
  draw: function() {
    var gl = pex.gl.Context.currentContext.gl;
    gl.clearColor(0, 0, 0, 1);
    gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);

    this.mesh.draw(this.camera);
  }
});

{'fraction_non_alphanumeric': 0.15769867549668873, 'fraction_numerical': 0.02152317880794702, 'mean_word_length': 2.570162481536189, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6475672', 'n_tokens_mistral': 929, 'n_tokens_neox': 862, 'n_words': 164}