Exemplo n.º 1
0
bool application::init()
{
	if (_initialized)
		return true;

	_config = load_config();

	// NOTE(Corralx): If something fails, everything else after will fail too, but that's not a problem
	bool ret = open_window();
	assert(ret);

	ret &= initialize_opengl();
	assert(ret);

	ret &= create_opengl_resources();
	assert(ret);

	ret &= imgui_init(_window);
	assert(ret);

	if (!ret)
	{
		cleanup();
		return false;
	}

	_initialized = true;
	return true;
}
Exemplo n.º 2
0
static void
initialize(int argc, char *argv[])
{
	srand(time(NULL));
	initialize_sdl();
	initialize_opengl();
	initialize_gameplay_data();
	initialize_mainmenu_data();
}