Removed unused clean-shader functionality (which is now done by
shader.?pp), removed global shader name variable.
This commit is contained in:
parent
51fb693455
commit
2f287fbee6
@ -90,8 +90,6 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define SHADER_NAMES
|
|
||||||
|
|
||||||
#include "graphics/shaders.hpp"
|
#include "graphics/shaders.hpp"
|
||||||
|
|
||||||
#include "graphics/callbacks.hpp"
|
#include "graphics/callbacks.hpp"
|
||||||
@ -111,9 +109,13 @@ bool Shaders::m_has_been_initialised = false;
|
|||||||
video::IShaderConstantSetCallBack *Shaders::m_callbacks[ES_COUNT];
|
video::IShaderConstantSetCallBack *Shaders::m_callbacks[ES_COUNT];
|
||||||
int Shaders::m_shaders[ES_COUNT];
|
int Shaders::m_shaders[ES_COUNT];
|
||||||
|
|
||||||
using namespace video;
|
// Use macro FOREACH_SHADER from shaders.hpp to create an array
|
||||||
|
// with all shader names.
|
||||||
|
#define STR(a) #a,
|
||||||
|
const char *Shaders::shader_names[] = { FOREACH_SHADER(STR) };
|
||||||
|
#undef STR
|
||||||
|
|
||||||
std::vector<void(*)()> CleanTable;
|
using namespace video;
|
||||||
|
|
||||||
void Shaders::init()
|
void Shaders::init()
|
||||||
{
|
{
|
||||||
@ -305,19 +307,9 @@ void Shaders::loadShaders()
|
|||||||
}
|
}
|
||||||
|
|
||||||
initGL();
|
initGL();
|
||||||
CleanTable.clear();
|
|
||||||
SharedGPUObjects::init();
|
SharedGPUObjects::init();
|
||||||
} // loadShaders
|
} // loadShaders
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
/** C
|
|
||||||
*/
|
|
||||||
void Shaders::killShaders()
|
|
||||||
{
|
|
||||||
for (unsigned i = 0; i < CleanTable.size(); i++)
|
|
||||||
CleanTable[i]();
|
|
||||||
} // killShaders
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
void Shaders::check(const int num)
|
void Shaders::check(const int num)
|
||||||
{
|
{
|
||||||
|
@ -52,24 +52,19 @@ class ParticleSystemProxy;
|
|||||||
ACT(ES_DISPLACE) \
|
ACT(ES_DISPLACE) \
|
||||||
|
|
||||||
#define ENUM(a) a,
|
#define ENUM(a) a,
|
||||||
#define STR(a) #a,
|
|
||||||
|
|
||||||
enum ShaderType
|
enum ShaderType
|
||||||
{
|
{
|
||||||
FOREACH_SHADER(ENUM)
|
FOREACH_SHADER(ENUM)
|
||||||
|
|
||||||
ES_COUNT
|
ES_COUNT
|
||||||
};
|
};
|
||||||
|
#undef ENUM
|
||||||
|
|
||||||
#ifdef SHADER_NAMES
|
|
||||||
static const char *shader_names[] = {
|
|
||||||
FOREACH_SHADER(STR)
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class Shaders
|
class Shaders
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
static const char *shader_names[];
|
||||||
static bool m_has_been_initialised;
|
static bool m_has_been_initialised;
|
||||||
|
|
||||||
static int m_shaders[ES_COUNT];
|
static int m_shaders[ES_COUNT];
|
||||||
@ -99,11 +94,6 @@ public:
|
|||||||
{
|
{
|
||||||
return m_has_been_initialised ? m_callbacks[num] : NULL;
|
return m_has_been_initialised ? m_callbacks[num] : NULL;
|
||||||
} // getCallback
|
} // getCallback
|
||||||
// ------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void killShaders();
|
|
||||||
|
|
||||||
// ========================================================================
|
// ========================================================================
|
||||||
/** Shader to draw a colored line.
|
/** Shader to draw a colored line.
|
||||||
@ -166,8 +156,4 @@ public:
|
|||||||
|
|
||||||
}; // class Shaders
|
}; // class Shaders
|
||||||
|
|
||||||
#undef ENUM
|
|
||||||
#undef STR
|
|
||||||
#undef FOREACH_SHADER
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user