Skip to content

Commit d0b9aff

Browse files
committed
ColorMapManager: Fix OpenGL implementation.
1 parent 55f10b5 commit d0b9aff

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Layers/xrRender/ColorMapManager.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,14 @@ void ColorMapManager::UpdateTexture(const shared_str &strTexName, int iTex)
2525
map_TexIt I = m_TexCache.find(strTexName);
2626
if (I!=m_TexCache.end())
2727
{
28+
#ifdef USE_OGL
29+
GLuint e0 = I->second->surface_get();
30+
m_CMap[iTex]->surface_set(GL_TEXTURE_2D, e0);
31+
#else
2832
ID3DBaseTexture* e0 = I->second->surface_get();
2933
m_CMap[iTex]->surface_set(e0);
3034
_RELEASE(e0);
35+
#endif // USE_OGL
3136
}
3237
else
3338
{
@@ -36,14 +41,23 @@ void ColorMapManager::UpdateTexture(const shared_str &strTexName, int iTex)
3641

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

44+
#ifdef USE_OGL
45+
GLuint e0 = tmp->surface_get();
46+
m_CMap[iTex]->surface_set(GL_TEXTURE_2D, e0);
47+
#else
3948
ID3DBaseTexture* e0 = tmp->surface_get();
4049
m_CMap[iTex]->surface_set(e0);
4150
_RELEASE(e0);
51+
#endif // USE_OGL
4252
}
4353
}
4454
else
4555
{
56+
#ifdef USE_OGL
57+
m_CMap[iTex]->surface_set(GL_TEXTURE_2D, 0);
58+
#else
4659
m_CMap[iTex]->surface_set(0);
60+
#endif // USE_OGL
4761
}
4862

4963

0 commit comments

Comments
 (0)