Example #1
0
void LoadCubeMap(const char *dir, const char *ext)
{
	char path[FILENAME_MAX];
	CubeTexParameters(GL_TEXTURE_CUBE_MAP);

	sprintf(path, "%s/left.%s", dir, ext);
	LoadCubeFace(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, path);

	sprintf(path, "%s/right.%s", dir, ext);
	LoadCubeFace(GL_TEXTURE_CUBE_MAP_POSITIVE_X, path);

	sprintf(path, "%s/bottom.%s", dir, ext);
	LoadCubeFace(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, path);

	sprintf(path, "%s/top.%s", dir, ext);
	LoadCubeFace(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, path);

	sprintf(path, "%s/back.%s", dir, ext);
	LoadCubeFace(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, path);

	sprintf(path, "%s/front.%s", dir, ext);
	LoadCubeFace(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, path);
}
Example #2
0
void LoadCubeMap(const char *dir, const char *ext)
{
	std::string path;
	CubeTexParameters(GL_TEXTURE_CUBE_MAP);

	io::sprintf(path, "{1}/left.{2}", dir, ext);
	LoadCubeFace(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, path);

	io::sprintf(path, "{1}/right.{2}", dir, ext);
	LoadCubeFace(GL_TEXTURE_CUBE_MAP_POSITIVE_X, path);

	io::sprintf(path, "{1}/bottom.{2}", dir, ext);
	LoadCubeFace(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, path);

	io::sprintf(path, "{1}/top.{2}", dir, ext);
	LoadCubeFace(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, path);

	io::sprintf(path, "{1}/back.{[2}", dir, ext);
	LoadCubeFace(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, path);

	io::sprintf(path, "{1}/front.{2}", dir, ext);
	LoadCubeFace(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, path);
}