src/layers/axeslayer.cpp

changeset 377
e1c5e4310f8b
parent 264
76a025db4948
--- a/src/layers/axeslayer.cpp	Tue Apr 11 22:39:18 2023 +0300
+++ b/src/layers/axeslayer.cpp	Tue Apr 11 22:51:12 2023 +0300
@@ -69,7 +69,7 @@
 		{{0, 0, 0}, {0, 0, 0.5}},
 	};
 	constexpr int stride = sizeof(VertexType);
-	this->shader.initialize(
+	gl::initialize_basic_shader(&this->shader,
 		::vertexShaderSource,
 		::fragmentShaderSource,
 		QOpenGLBuffer::StaticDraw,
@@ -87,7 +87,7 @@
 				.stride = stride,
 			},
 		});
-	this->shader.bufferData(&data[0], countof(data), sizeof data[0]);
+	gl::buffer_shader_data(&this->shader, &data[0], countof(data), sizeof data[0]);
 }
 
 void AxesLayer::overpaint(QPainter* painter)
@@ -152,11 +152,11 @@
 	glLineWidth(5);
 	glEnable(GL_LINE_SMOOTH);
 	glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
-	this->shader.draw(GL_LINES);
+	gl::draw_shader(&this->shader, GL_LINES);
 	glDisable(GL_LINE_SMOOTH);
 }
 
 void AxesLayer::mvpMatrixChanged(const glm::mat4& mvpMatrix)
 {
-	this->shader.setMvpMatrix(mvpMatrix);
+	gl::set_shader_matrix_uniform(&this->shader, "mvp", mvpMatrix);
 }

mercurial