Skip to content

Commit

Permalink
ColorMapManager: Fix OpenGL implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
CrossVR committed Nov 25, 2015
1 parent 55f10b5 commit d0b9aff
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Layers/xrRender/ColorMapManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,14 @@ void ColorMapManager::UpdateTexture(const shared_str &strTexName, int iTex)
map_TexIt I = m_TexCache.find(strTexName);
if (I!=m_TexCache.end())
{
#ifdef USE_OGL
GLuint e0 = I->second->surface_get();
m_CMap[iTex]->surface_set(GL_TEXTURE_2D, e0);
#else
ID3DBaseTexture* e0 = I->second->surface_get();
m_CMap[iTex]->surface_set(e0);
_RELEASE(e0);
#endif // USE_OGL
}
else
{
Expand All @@ -36,14 +41,23 @@ void ColorMapManager::UpdateTexture(const shared_str &strTexName, int iTex)

m_TexCache.insert (mk_pair(strTexName,tmp));

#ifdef USE_OGL
GLuint e0 = tmp->surface_get();
m_CMap[iTex]->surface_set(GL_TEXTURE_2D, e0);
#else
ID3DBaseTexture* e0 = tmp->surface_get();
m_CMap[iTex]->surface_set(e0);
_RELEASE(e0);
#endif // USE_OGL
}
}
else
{
#ifdef USE_OGL
m_CMap[iTex]->surface_set(GL_TEXTURE_2D, 0);
#else
m_CMap[iTex]->surface_set(0);
#endif // USE_OGL
}


Expand Down

0 comments on commit d0b9aff

Please sign in to comment.