Changeset View
Changeset View
Standalone View
Standalone View
source/renderer/SkyManager.cpp
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | void SkyManager::LoadSkyTextures() | ||||
static const CStrW images[NUMBER_OF_TEXTURES + 1] = { | static const CStrW images[NUMBER_OF_TEXTURES + 1] = { | ||||
L"front", | L"front", | ||||
L"back", | L"back", | ||||
L"right", | L"right", | ||||
L"left", | L"left", | ||||
L"top", | L"top", | ||||
L"top" | L"top" | ||||
}; | }; | ||||
ogl_DebugGroup group("Load sky textures"); | |||||
/*for (size_t i = 0; i < ARRAY_SIZE(m_SkyTexture); ++i) | /*for (size_t i = 0; i < ARRAY_SIZE(m_SkyTexture); ++i) | ||||
{ | { | ||||
VfsPath path = VfsPath("art/textures/skies") / m_SkySet / (Path::String(s_imageNames[i])+L".dds"); | VfsPath path = VfsPath("art/textures/skies") / m_SkySet / (Path::String(s_imageNames[i])+L".dds"); | ||||
CTextureProperties textureProps(path); | CTextureProperties textureProps(path); | ||||
textureProps.SetWrap(GL_CLAMP_TO_EDGE); | textureProps.SetWrap(GL_CLAMP_TO_EDGE); | ||||
CTexturePtr texture = g_Renderer.GetTextureManager().CreateTexture(textureProps); | CTexturePtr texture = g_Renderer.GetTextureManager().CreateTexture(textureProps); | ||||
texture->Prefetch(); | texture->Prefetch(); | ||||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | void SkyManager::LoadSkyTextures() | ||||
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | ||||
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | ||||
#if CONFIG2_GLES | #if CONFIG2_GLES | ||||
#warning TODO: fix SkyManager::LoadSkyTextures for GLES | #warning TODO: fix SkyManager::LoadSkyTextures for GLES | ||||
#else | #else | ||||
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); | glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); | ||||
#endif | #endif | ||||
glBindTexture(GL_TEXTURE_CUBE_MAP, 0); | glBindTexture(GL_TEXTURE_CUBE_MAP, 0); | ||||
/////////////////////////////////////////////////////////////////////////// | |||||
} | } | ||||
/////////////////////////////////////////////////////////////////// | /////////////////////////////////////////////////////////////////// | ||||
// Switch to a different sky set (while the game is running) | // Switch to a different sky set (while the game is running) | ||||
void SkyManager::SetSkySet(const CStrW& newSet) | void SkyManager::SetSkySet(const CStrW& newSet) | ||||
{ | { | ||||
if (newSet == m_SkySet) | if (newSet == m_SkySet) | ||||
Show All 32 Lines | std::vector<CStrW> SkyManager::GetSkySets() const | ||||
return skies; | return skies; | ||||
} | } | ||||
/////////////////////////////////////////////////////////////////// | /////////////////////////////////////////////////////////////////// | ||||
// Render sky | // Render sky | ||||
void SkyManager::RenderSky() | void SkyManager::RenderSky() | ||||
{ | { | ||||
ogl_DebugGroup group("Render sky"); | |||||
#if CONFIG2_GLES | #if CONFIG2_GLES | ||||
#warning TODO: implement SkyManager::RenderSky for GLES | #warning TODO: implement SkyManager::RenderSky for GLES | ||||
#else | #else | ||||
// Draw the sky as a small box around the map, with depth write enabled. | // Draw the sky as a small box around the map, with depth write enabled. | ||||
// This will be done before anything else is drawn so we'll be overlapped by everything else. | // This will be done before anything else is drawn so we'll be overlapped by everything else. | ||||
// Do nothing unless SetSkySet was called | // Do nothing unless SetSkySet was called | ||||
▲ Show 20 Lines • Show All 96 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator