From bc1c9b5284c10d8aafc04bcd6c3597b3626a782f Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Wed, 25 Jul 2012 20:27:13 +0200 Subject: Fixed bug in texturing --- src/graphics/opengl/test/CMakeLists.txt | 3 --- src/graphics/opengl/test/texture_test.cpp | 10 ++++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src/graphics/opengl/test') diff --git a/src/graphics/opengl/test/CMakeLists.txt b/src/graphics/opengl/test/CMakeLists.txt index 58c4714..f49fbac 100644 --- a/src/graphics/opengl/test/CMakeLists.txt +++ b/src/graphics/opengl/test/CMakeLists.txt @@ -30,7 +30,6 @@ configure_file(../../../common/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/common set(TEXTURE_SOURCES ../gldevice.cpp -../../common/device.cpp ../../../common/logger.cpp ../../../common/image.cpp texture_test.cpp @@ -38,7 +37,6 @@ texture_test.cpp set(MODEL_SOURCES ../gldevice.cpp -../../common/device.cpp ../../common/modelfile.cpp ../../../common/logger.cpp ../../../common/image.cpp @@ -50,7 +48,6 @@ model_test.cpp set(TRANSFORM_SOURCES ../gldevice.cpp -../../common/device.cpp ../../../common/logger.cpp ../../../common/image.cpp ../../../common/iman.cpp diff --git a/src/graphics/opengl/test/texture_test.cpp b/src/graphics/opengl/test/texture_test.cpp index aa9817e..c3c568b 100644 --- a/src/graphics/opengl/test/texture_test.cpp +++ b/src/graphics/opengl/test/texture_test.cpp @@ -108,6 +108,16 @@ void Render(Gfx::CGLDevice *device) device->SetTextureEnabled(0, true); device->SetTextureEnabled(1, true); + tex1StageParams.colorOperation = Gfx::TEX_MIX_OPER_DEFAULT; + tex1StageParams.alphaOperation = Gfx::TEX_MIX_OPER_DEFAULT; + device->SetTextureStageParams(0, tex1StageParams); + + tex2StageParams.colorOperation = Gfx::TEX_MIX_OPER_ADD; + tex2StageParams.colorArg1 = Gfx::TEX_MIX_ARG_COMPUTED_COLOR; + tex2StageParams.colorArg2 = Gfx::TEX_MIX_ARG_TEXTURE; + tex2StageParams.alphaOperation = Gfx::TEX_MIX_OPER_DEFAULT; + device->SetTextureStageParams(1, tex2StageParams); + device->DrawPrimitive(Gfx::PRIMITIVE_TRIANGLES, quad, 6); device->EndScene(); -- cgit v1.2.3-1-g7c22