Open a Window using GLFW

Here is some simple, basic code to open up a window in GLFW. For more tutorials on how to draw triangles and render graphics to a screen, check out: https://learnopengl.com/. The tutorials are in C++, but it might be possible to translate them into Jai.

#import "glfw";
#import "GL";

main :: () {
  if !glfwInit() then return;
  defer glfwTerminate();

  glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
  glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
  window := glfwCreateWindow(640, 480, "GLFW Window", null, null);
  if !window then return;
  defer glfwDestroyWindow(window);

  glfwMakeContextCurrent(window);
  while !glfwWindowShouldClose(window) {
    glfwSwapBuffers(window);
    glfwPollEvents();
  }
}