//-------------------UNLOAD-------------- // Functions for deleting assets //--------------------------------------- void Assets::unloadAllAssets() { unloadShaders(); unloadTextures(); unloadMeshes(); unloadAnims(); }
bool GLSL_Shader::loadShaders(const char* vertexShaderName, const char* pixelShaderName) { if (glCreateProgram == NULL) throw SnowSim::Exceptions::NotSupportedException("glCreateProgram is not support by your graphics card!"); if (glLinkProgram == NULL) throw SnowSim::Exceptions::NotSupportedException("glLinkProgram is not support by your graphics card!"); // delete previously loaded shaders unloadShaders(); // create program program = glCreateProgram(); // create vertex shader if(!createVertexShader(vertexShaderName)) return false; // create pixel shader if(!createPixelShader(pixelShaderName)) return false; glLinkProgram(program); shaderLoaded = true; return shaderLoaded; }
void CloudsVisualSystemCubeCraft::selfExit() { cubeMesh.clear(); voxelVbo.clear(); unloadShaders(); }
void CloudsVisualSystemCubeCraft::loadShaders() { unloadShaders(); voxelShader.load( getVisualSystemDataPath() + "shaders/voxelShader"); cubeCraftShader.load( getVisualSystemDataPath() + "shaders/cubeCraftShader" ); mineCraftGroundShader.load( getVisualSystemDataPath() + "shaders/mineCraftGround"); mineCraftCloudsShader.load( getVisualSystemDataPath() + "shaders/mineCraftClouds"); }
GLSL_Shader::~GLSL_Shader() { m_is_destroying = true; unloadShaders(); }