#include "context.hpp"

namespace VE
{
	context::context(GLFWwindow* w) : m_win { w } 
  {
		glfwMakeContextCurrent(m_win);
		int status = gladLoadGLLoader((GLADloadproc)glfwGetProcAddress);

    hack::log(": ")("Glad loader status", status == 1 ? "Load" : "UNLOAD");
    hack::log(": ")("OpenGL Info");
    hack::log(": ")("  Vendor",       glGetString(GL_VENDOR));
    hack::log(": ")("  Renderer",     glGetString(GL_RENDERER));
    hack::log(": ")("  Version",      glGetString(GL_VERSION));
    hack::log(": ")("  GLSL Version", glGetString(GL_SHADING_LANGUAGE_VERSION));

    glfwSwapInterval(1);  

  }

	void context::swap_buffers()
	{
		glfwSwapBuffers(m_win);
	}
}

