Removed texture coordinate generation
This feature was only needed by GL14 device to implement shadow mapping and is not supported by shader-based devices. Shadow mapping has been rewritten, so this feature is no longer needed.master
parent
734e6e97c0
commit
ebca89d920
|
@ -413,9 +413,6 @@ public:
|
||||||
//! Sets only the texture wrap modes (for faster than thru stage params)
|
//! Sets only the texture wrap modes (for faster than thru stage params)
|
||||||
virtual void SetTextureStageWrap(int index, TexWrapMode wrapS, TexWrapMode wrapT) = 0;
|
virtual void SetTextureStageWrap(int index, TexWrapMode wrapS, TexWrapMode wrapT) = 0;
|
||||||
|
|
||||||
//! Sets the texture coordinate generation mode for given texture unit
|
|
||||||
virtual void SetTextureCoordGeneration(int index, TextureGenerationParams ¶ms) = 0;
|
|
||||||
|
|
||||||
//! Renders primitive composed of vertices with single texture
|
//! Renders primitive composed of vertices with single texture
|
||||||
virtual void DrawPrimitive(PrimitiveType type, const Vertex *vertices , int vertexCount,
|
virtual void DrawPrimitive(PrimitiveType type, const Vertex *vertices , int vertexCount,
|
||||||
Color color = Color(1.0f, 1.0f, 1.0f, 1.0f)) = 0;
|
Color color = Color(1.0f, 1.0f, 1.0f, 1.0f)) = 0;
|
||||||
|
|
|
@ -154,10 +154,6 @@ void CNullDevice::SetTextureStageWrap(int index, TexWrapMode wrapS, TexWrapMode
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNullDevice::SetTextureCoordGeneration(int index, TextureGenerationParams ¶ms)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void CNullDevice::DrawPrimitive(PrimitiveType type, const Vertex *vertices, int vertexCount,
|
void CNullDevice::DrawPrimitive(PrimitiveType type, const Vertex *vertices, int vertexCount,
|
||||||
Color color)
|
Color color)
|
||||||
{
|
{
|
||||||
|
|
|
@ -80,7 +80,6 @@ public:
|
||||||
void SetTextureStageParams(int index, const TextureStageParams ¶ms) override;
|
void SetTextureStageParams(int index, const TextureStageParams ¶ms) override;
|
||||||
|
|
||||||
void SetTextureStageWrap(int index, Gfx::TexWrapMode wrapS, Gfx::TexWrapMode wrapT) override;
|
void SetTextureStageWrap(int index, Gfx::TexWrapMode wrapS, Gfx::TexWrapMode wrapT) override;
|
||||||
void SetTextureCoordGeneration(int index, TextureGenerationParams ¶ms) override;
|
|
||||||
|
|
||||||
void DrawPrimitive(PrimitiveType type, const Vertex* vertices, int vertexCount, Color color = Color(1.0f, 1.0f, 1.0f, 1.0f)) override;
|
void DrawPrimitive(PrimitiveType type, const Vertex* vertices, int vertexCount, Color color = Color(1.0f, 1.0f, 1.0f, 1.0f)) override;
|
||||||
void DrawPrimitive(PrimitiveType type, const VertexTex2* vertices, int vertexCount, Color color = Color(1.0f, 1.0f, 1.0f, 1.0f)) override;
|
void DrawPrimitive(PrimitiveType type, const VertexTex2* vertices, int vertexCount, Color color = Color(1.0f, 1.0f, 1.0f, 1.0f)) override;
|
||||||
|
|
|
@ -1058,48 +1058,6 @@ void CGL21Device::SetTextureStageParams(int index, const TextureStageParams &par
|
||||||
UpdateTextureParams(index);
|
UpdateTextureParams(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGL21Device::SetTextureCoordGeneration(int index, TextureGenerationParams ¶ms)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
glActiveTexture(GL_TEXTURE0 + index);
|
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++)
|
|
||||||
{
|
|
||||||
GLuint texCoordGen = TranslateTextureCoordinateGen(i);
|
|
||||||
GLuint texCoord = TranslateTextureCoordinate(i);
|
|
||||||
|
|
||||||
switch (params.coords[i].mode)
|
|
||||||
{
|
|
||||||
case TEX_GEN_NONE:
|
|
||||||
glDisable(texCoordGen);
|
|
||||||
break;
|
|
||||||
case TEX_GEN_OBJECT_LINEAR:
|
|
||||||
glEnable(texCoordGen);
|
|
||||||
glTexGeni(texCoord, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
|
|
||||||
glTexGenfv(texCoord, GL_OBJECT_PLANE, params.coords[i].plane);
|
|
||||||
break;
|
|
||||||
case TEX_GEN_EYE_LINEAR:
|
|
||||||
glEnable(texCoordGen);
|
|
||||||
glTexGeni(texCoord, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
|
|
||||||
glTexGenfv(texCoord, GL_EYE_PLANE, params.coords[i].plane);
|
|
||||||
break;
|
|
||||||
case TEX_GEN_SPHERE_MAP:
|
|
||||||
glEnable(texCoordGen);
|
|
||||||
glTexGeni(texCoord, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
|
|
||||||
break;
|
|
||||||
case TEX_GEN_NORMAL_MAP:
|
|
||||||
glEnable(texCoordGen);
|
|
||||||
glTexGeni(texCoord, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP);
|
|
||||||
break;
|
|
||||||
case TEX_GEN_REFLECTION_MAP:
|
|
||||||
glEnable(texCoordGen);
|
|
||||||
glTexGeni(texCoord, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// */
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGL21Device::UpdateTextureParams(int index)
|
void CGL21Device::UpdateTextureParams(int index)
|
||||||
{
|
{
|
||||||
assert(index >= 0 && index < static_cast<int>( m_currentTextures.size() ));
|
assert(index >= 0 && index < static_cast<int>( m_currentTextures.size() ));
|
||||||
|
|
|
@ -99,7 +99,6 @@ public:
|
||||||
void SetTextureStageParams(int index, const TextureStageParams ¶ms) override;
|
void SetTextureStageParams(int index, const TextureStageParams ¶ms) override;
|
||||||
|
|
||||||
void SetTextureStageWrap(int index, Gfx::TexWrapMode wrapS, Gfx::TexWrapMode wrapT) override;
|
void SetTextureStageWrap(int index, Gfx::TexWrapMode wrapS, Gfx::TexWrapMode wrapT) override;
|
||||||
void SetTextureCoordGeneration(int index, TextureGenerationParams ¶ms) override;
|
|
||||||
|
|
||||||
virtual void DrawPrimitive(PrimitiveType type, const Vertex *vertices , int vertexCount,
|
virtual void DrawPrimitive(PrimitiveType type, const Vertex *vertices , int vertexCount,
|
||||||
Color color = Color(1.0f, 1.0f, 1.0f, 1.0f)) override;
|
Color color = Color(1.0f, 1.0f, 1.0f, 1.0f)) override;
|
||||||
|
|
|
@ -1009,11 +1009,6 @@ void CGL33Device::SetTextureStageParams(int index, const TextureStageParams &par
|
||||||
UpdateTextureParams(index);
|
UpdateTextureParams(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGL33Device::SetTextureCoordGeneration(int index, TextureGenerationParams ¶ms)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGL33Device::UpdateTextureParams(int index)
|
void CGL33Device::UpdateTextureParams(int index)
|
||||||
{
|
{
|
||||||
assert(index >= 0 && index < static_cast<int>( m_currentTextures.size() ));
|
assert(index >= 0 && index < static_cast<int>( m_currentTextures.size() ));
|
||||||
|
|
|
@ -114,7 +114,6 @@ public:
|
||||||
void SetTextureStageParams(int index, const TextureStageParams ¶ms) override;
|
void SetTextureStageParams(int index, const TextureStageParams ¶ms) override;
|
||||||
|
|
||||||
void SetTextureStageWrap(int index, Gfx::TexWrapMode wrapS, Gfx::TexWrapMode wrapT) override;
|
void SetTextureStageWrap(int index, Gfx::TexWrapMode wrapS, Gfx::TexWrapMode wrapT) override;
|
||||||
void SetTextureCoordGeneration(int index, TextureGenerationParams ¶ms) override;
|
|
||||||
|
|
||||||
virtual void DrawPrimitive(PrimitiveType type, const Vertex *vertices , int vertexCount,
|
virtual void DrawPrimitive(PrimitiveType type, const Vertex *vertices , int vertexCount,
|
||||||
Color color = Color(1.0f, 1.0f, 1.0f, 1.0f)) override;
|
Color color = Color(1.0f, 1.0f, 1.0f, 1.0f)) override;
|
||||||
|
|
|
@ -992,46 +992,6 @@ void CGLDevice::SetTextureStageParams(int index, const TextureStageParams ¶m
|
||||||
UpdateTextureParams(index);
|
UpdateTextureParams(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGLDevice::SetTextureCoordGeneration(int index, TextureGenerationParams ¶ms)
|
|
||||||
{
|
|
||||||
glActiveTexture(GL_TEXTURE0 + m_remap[index]);
|
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++)
|
|
||||||
{
|
|
||||||
GLuint texCoordGen = TranslateTextureCoordinateGen(i);
|
|
||||||
GLuint texCoord = TranslateTextureCoordinate(i);
|
|
||||||
|
|
||||||
switch (params.coords[i].mode)
|
|
||||||
{
|
|
||||||
case TEX_GEN_NONE:
|
|
||||||
glDisable(texCoordGen);
|
|
||||||
break;
|
|
||||||
case TEX_GEN_OBJECT_LINEAR:
|
|
||||||
glEnable(texCoordGen);
|
|
||||||
glTexGeni(texCoord, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
|
|
||||||
glTexGenfv(texCoord, GL_OBJECT_PLANE, params.coords[i].plane);
|
|
||||||
break;
|
|
||||||
case TEX_GEN_EYE_LINEAR:
|
|
||||||
glEnable(texCoordGen);
|
|
||||||
glTexGeni(texCoord, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
|
|
||||||
glTexGenfv(texCoord, GL_EYE_PLANE, params.coords[i].plane);
|
|
||||||
break;
|
|
||||||
case TEX_GEN_SPHERE_MAP:
|
|
||||||
glEnable(texCoordGen);
|
|
||||||
glTexGeni(texCoord, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
|
|
||||||
break;
|
|
||||||
case TEX_GEN_NORMAL_MAP:
|
|
||||||
glEnable(texCoordGen);
|
|
||||||
glTexGeni(texCoord, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP);
|
|
||||||
break;
|
|
||||||
case TEX_GEN_REFLECTION_MAP:
|
|
||||||
glEnable(texCoordGen);
|
|
||||||
glTexGeni(texCoord, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGLDevice::UpdateTextureParams(int index)
|
void CGLDevice::UpdateTextureParams(int index)
|
||||||
{
|
{
|
||||||
assert(index >= 0 && index < static_cast<int>(m_currentTextures.size()));
|
assert(index >= 0 && index < static_cast<int>(m_currentTextures.size()));
|
||||||
|
|
|
@ -118,7 +118,6 @@ public:
|
||||||
void SetTextureStageParams(int index, const TextureStageParams ¶ms) override;
|
void SetTextureStageParams(int index, const TextureStageParams ¶ms) override;
|
||||||
|
|
||||||
void SetTextureStageWrap(int index, Gfx::TexWrapMode wrapS, Gfx::TexWrapMode wrapT) override;
|
void SetTextureStageWrap(int index, Gfx::TexWrapMode wrapS, Gfx::TexWrapMode wrapT) override;
|
||||||
void SetTextureCoordGeneration(int index, TextureGenerationParams ¶ms) override;
|
|
||||||
|
|
||||||
virtual void DrawPrimitive(PrimitiveType type, const Vertex *vertices , int vertexCount,
|
virtual void DrawPrimitive(PrimitiveType type, const Vertex *vertices , int vertexCount,
|
||||||
Color color = Color(1.0f, 1.0f, 1.0f, 1.0f)) override;
|
Color color = Color(1.0f, 1.0f, 1.0f, 1.0f)) override;
|
||||||
|
|
Loading…
Reference in New Issue