Commit c7108e6b authored by Lars Krecklau's avatar Lars Krecklau
Browse files
parents cdf5fdfd 5962ab13
......@@ -55,7 +55,7 @@ public:
inline VertexBufferObjectControl& attribute (const std::string& _name, const std::string& _nameInArray)
{
AttributeDefine a = {_name, mArrayBuffers.size()-1, _nameInArray};
AttributeDefine a = {_name, (int_t)mArrayBuffers.size()-1, _nameInArray};
mAttributeDefines.push_back(a);
return *this;
}
......
......@@ -22,6 +22,8 @@ SharedShader ShaderControlFile::create(void)
if(extension == "vsh")
mType = GL_VERTEX_SHADER;
else if(extension == "gsh")
mType = GL_GEOMETRY_SHADER;
else if(extension == "fsh")
mType = GL_FRAGMENT_SHADER;
else
......
......@@ -18,6 +18,8 @@ SharedShaderProgram ShaderProgramControlAutoFiles::create(void)
SharedShaderProgram shaderProgram(new ShaderProgram());
if(ConstSharedShader shader = ShaderFileManager::the()->get(ShaderControlFile(mFilename + ".vsh").type(GL_VERTEX_SHADER)))
shaderProgram->attachShader(shader);
if(ConstSharedShader shader = ShaderFileManager::the()->get(ShaderControlFile(mFilename + ".gsh").type(GL_GEOMETRY_SHADER)))
shaderProgram->attachShader(shader);
if(ConstSharedShader shader = ShaderFileManager::the()->get(ShaderControlFile(mFilename + ".fsh").type(GL_FRAGMENT_SHADER)))
shaderProgram->attachShader(shader);
......@@ -35,6 +37,7 @@ bool ShaderProgramControlAutoFiles::update(SharedShaderProgram& shaderProgram)
{
bool update = false;
update |= ShaderFileManager::the()->update(mFilename + ".vsh");
update |= ShaderFileManager::the()->update(mFilename + ".gsh");
update |= ShaderFileManager::the()->update(mFilename + ".fsh");
if(update)
return shaderProgram->link();
......
......@@ -18,7 +18,7 @@ void RenderObject::updateMappings (void)
{
for(VertexBufferObject::AttributeVec::size_type i = 0; i < mpVertexBufferObject->getAttributes().size(); ++i)
{
AttributeMapping mapping = {i, mpShaderProgramObject->getShaderProgram()->getAttributeLocation(mpVertexBufferObject->getAttributes()[i].name)};
AttributeMapping mapping = {(int_t)i, (int_t)mpShaderProgramObject->getShaderProgram()->getAttributeLocation(mpVertexBufferObject->getAttributes()[i].name)};
bool inserted = false;
for (AttributeMappingVec::iterator it = mAttributeMappings.begin(); it < mAttributeMappings.end() && !inserted; it++)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment