src/gl/basicshaderprogram.cpp

changeset 250
2837b549e616
parent 216
c7241f504117
child 259
c27612f0eac0
--- a/src/gl/basicshaderprogram.cpp	Wed Jun 22 16:13:15 2022 +0300
+++ b/src/gl/basicshaderprogram.cpp	Wed Jun 22 16:53:35 2022 +0300
@@ -52,8 +52,9 @@
 		this->vertexArrayObject.bind();
 		for (std::size_t i = 0; i < attributeSpecs.size(); ++i) {
 			const auto& spec = attributeSpecs[i];
-			this->program->enableAttributeArray(i);
-			this->program->setAttributeBuffer(i, spec.type, spec.offset, spec.tuplesize, spec.stride);
+			const int attr = narrow<int>(signed_cast(i));
+			this->program->enableAttributeArray(attr);
+			this->program->setAttributeBuffer(attr, spec.type, spec.offset, spec.tuplesize, spec.stride);
 		}
 		this->vertexArrayObject.release();
 		this->buffer.release();
@@ -88,9 +89,9 @@
 void BasicShader::bufferData(const void* data, std::size_t count, std::size_t size)
 {
 	this->buffer.bind();
-	this->buffer.allocate(data, count * size);
+	this->buffer.allocate(data, narrow<int>(signed_cast(count * size)));
 	this->buffer.release();
-	this->vertexCount = count;
+	this->vertexCount = narrow<int>(signed_cast(count));
 }
 
 void BasicShader::draw(GLenum drawMode)

mercurial