From 87a4da40bcec1f570f145ccd121fdbf1ff75256b Mon Sep 17 00:00:00 2001 From: Lynix Date: Tue, 9 Jul 2013 01:07:26 +0200 Subject: [PATCH] Fixed compilation error Former-commit-id: d7354d3ab3de1627e7a6985f4377607c4f87607a --- src/Nazara/Graphics/ColorBackground.cpp | 4 ++++ src/Nazara/Graphics/TextureBackground.cpp | 15 +++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/Nazara/Graphics/ColorBackground.cpp b/src/Nazara/Graphics/ColorBackground.cpp index a803886c6..3dadd4759 100644 --- a/src/Nazara/Graphics/ColorBackground.cpp +++ b/src/Nazara/Graphics/ColorBackground.cpp @@ -2,6 +2,10 @@ // This file is part of the "Nazara Engine - Graphics module" // For conditions of distribution and use, see copyright notice in Config.hpp +#ifndef NAZARA_RENDERER_OPENGL +#define NAZARA_RENDERER_OPENGL // Nécessaire pour inclure les headers OpenGL +#endif + #include #include #include diff --git a/src/Nazara/Graphics/TextureBackground.cpp b/src/Nazara/Graphics/TextureBackground.cpp index e1e3986a7..987b55f59 100644 --- a/src/Nazara/Graphics/TextureBackground.cpp +++ b/src/Nazara/Graphics/TextureBackground.cpp @@ -2,6 +2,10 @@ // This file is part of the "Nazara Engine - Graphics module" // For conditions of distribution and use, see copyright notice in Config.hpp +#ifndef NAZARA_RENDERER_OPENGL +#define NAZARA_RENDERER_OPENGL // Nécessaire pour inclure les headers OpenGL +#endif + #include #include #include @@ -11,6 +15,9 @@ namespace { + static NzShader* s_shader = nullptr; + static int s_textureLocation; + NzShader* BuildShader() { const char* fragmentSource110 = @@ -76,20 +83,16 @@ namespace return nullptr; } + s_textureLocation = shader->GetUniformLocation("Texture"); + return shader.release(); } - - static NzShader* s_shader = nullptr; - static unsigned int s_textureLocation; } NzTextureBackground::NzTextureBackground() { if (!s_shader) - { s_shader = BuildShader(); - s_textureLocation = s_shader->GetUniformLocation("Texture"); - } m_shader = s_shader; }