<commit_before>// main.cpp - Copyright 2013-2015 <NAME>, All Rights Reserved

#include <GLFW/glfw3.h>
#include <Core/Console.h>
#include <Core/Math/Vec2.h>
#include <GLRender/GLRender.h>
#include <ExampleGame/FPSCamera.h>
#include <ExampleGame/Ghost.h>

//Define context parameters
int32 window_width = 1280;
int32 window_height = 720;

//Function Prototypes
GLFWwindow* InitGLFW();
void eventLoop(GLFWwindow* window, Scene& scene);
void cleanUp(GLFWwindow* window);

struct
{
	//////////////////
	///   Fields   ///
public:

	Vec2 Position;

	///////////////////
	///   Methods   ///
public:

	void UpdatePosition(GLFWwindow* window)
	{
		double x;
		double y;

		glfwGetCursorPos(window, &x, &y);

		Position.X = (float)x - window_width / 2;
		Position.Y = (float)y - window_height / 2;
	}
	void SetPosition(GLFWwindow* window, float x, float y)
	{
		glfwSetCursorPos(window, x + window_width / 2, y + window_height / 2);
		Position.X = x;
		Position.X = y;
	}

} Cursor;

int main(int32 /*argc*/, char** /*argv*/)
{
	Console::WriteLine("Initializing subsystems...");

	// Initialize GLFW and get a window
	GLFWwindow* window = InitGLFW();

	// Make an openGL context in window
	glfwMakeContextCurrent(window);
	InitRenderer(window_width, window_height);

	///////////////////////////////
	///   Setting up a simple   ///
	///          scene          ///

	auto scene = New<Scene>();

	//auto& sponza = test.Spawn<Prop>();
	//sponza.MeshComponent.Mesh = "data/sponza.dat";
	//sponza.MeshComponent.Mesh->SetMaterial(String("data/Sponza.mat"));

	scene->Spawn<Ghost>();
	//gun.MeshComponent.Mesh = "data/battle_rifle.dat";
	//gun.MeshComponent.Mesh->SetMaterial(String("data/Gun.mat"));

	scene->Spawn<FPSCamera>();
	//test.Cameras.Add(&cam);

	//Execute the main event loop
	eventLoop(window, *scene);

	//Cleanup the engine
	cleanUp(window);

	// Shut down the application
	Application::BeginShutdown();
}

GLFWwindow* InitGLFW()
{<commit_msg>- Fixed memory leak. But actually this time.<commit_after>// main.cpp - Copyright 2013-2015 <NAME>, All Rights Reserved

#include <GLFW/glfw3.h>
#include <Core/Console.h>
#include <Core/Math/Vec2.h>
#include <GLRender/GLRender.h>
#include <ExampleGame/FPSCamera.h>
#include <ExampleGame/Ghost.h>

//Define context parameters
int32 window_width = 1280;
int32 window_height = 720;

//Function Prototypes
GLFWwindow* InitGLFW();
void eventLoop(GLFWwindow* window, Scene& scene);
void cleanUp(GLFWwindow* window);

struct
{
	//////////////////
	///   Fields   ///
public:

	Vec2 Position;

	///////////////////
	///   Methods   ///
public:

	void UpdatePosition(GLFWwindow* window)
	{
		double x;
		double y;

		glfwGetCursorPos(window, &x, &y);

		Position.X = (float)x - window_width / 2;
		Position.Y = (float)y - window_height / 2;
	}
	void SetPosition(GLFWwindow* window, float x, float y)
	{
		glfwSetCursorPos(window, x + window_width / 2, y + window_height / 2);
		Position.X = x;
		Position.X = y;
	}

} Cursor;

int main(int32 /*argc*/, char** /*argv*/)
{
	Console::WriteLine("Initializing subsystems...");

	// Initialize GLFW and get a window
	GLFWwindow* window = InitGLFW();

	// Make an openGL context in window
	glfwMakeContextCurrent(window);
	InitRenderer(window_width, window_height);

	///////////////////////////////
	///   Setting up a simple   ///
	///          scene          ///

	auto scene = New<Scene>();

	//auto& sponza = test.Spawn<Prop>();
	//sponza.MeshComponent.Mesh = "data/sponza.dat";
	//sponza.MeshComponent.Mesh->SetMaterial(String("data/Sponza.mat"));

	scene->Spawn<Ghost>();
	//gun.MeshComponent.Mesh = "data/battle_rifle.dat";
	//gun.MeshComponent.Mesh->SetMaterial(String("data/Gun.mat"));

	scene->Spawn<FPSCamera>();
	//test.Cameras.Add(&cam);

	//Execute the main event loop
	eventLoop(window, *scene);

	// Destroy the scene
	scene = nullptr;

	//Cleanup the engine
	cleanUp(window);

	// Shut down the application
	Application::BeginShutdown();
}

GLFWwindow* InitGLFW()
{
{'fraction_non_alphanumeric': 0.1855123674911661, 'fraction_numerical': 0.014134275618374558, 'mean_word_length': 3.1238293444328824, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 33, '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': '221206', 'n_tokens_mistral': 1458, 'n_tokens_neox': 1354, 'n_words': 308}