feat: render spinning 3D cube with glm
- Add glm dependency for matrix transformations - Replace triangle with 6-face colored cube - Add MVP shader uniforms (model, view, projection) - Enable depth testing for proper 3D rendering - Spin cube around (1, 0.5, 0.3) axis style: fix trailing return type for move assignment operators - buffer/texture/shader/vao: use auto fn() -> T& style - Document trailing return type convention in AGENTS.md
This commit is contained in:
@@ -25,7 +25,7 @@ buffer::buffer(buffer&& other) noexcept
|
||||
other.m_id = 0;
|
||||
}
|
||||
|
||||
buffer& buffer::operator=(buffer&& other) noexcept {
|
||||
auto buffer::operator=(buffer&& other) noexcept -> buffer& {
|
||||
if (this != &other) {
|
||||
if (m_id) {
|
||||
glDeleteBuffers(1, &m_id);
|
||||
|
||||
@@ -20,7 +20,7 @@ shader::shader(shader&& other) noexcept
|
||||
other.m_id = 0;
|
||||
}
|
||||
|
||||
shader& shader::operator=(shader&& other) noexcept {
|
||||
auto shader::operator=(shader&& other) noexcept -> shader& {
|
||||
if (this != &other) {
|
||||
if (m_id) {
|
||||
glDeleteProgram(m_id);
|
||||
|
||||
@@ -25,7 +25,7 @@ texture::texture(texture&& other) noexcept
|
||||
other.m_id = 0;
|
||||
}
|
||||
|
||||
texture& texture::operator=(texture&& other) noexcept {
|
||||
auto texture::operator=(texture&& other) noexcept -> texture& {
|
||||
if (this != &other) {
|
||||
if (m_id) {
|
||||
glDeleteTextures(1, &m_id);
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ vao::vao(vao&& other) noexcept
|
||||
other.m_id = 0;
|
||||
}
|
||||
|
||||
vao& vao::operator=(vao&& other) noexcept {
|
||||
auto vao::operator=(vao&& other) noexcept -> vao& {
|
||||
if (this != &other) {
|
||||
if (m_id) {
|
||||
glDeleteVertexArrays(1, &m_id);
|
||||
|
||||
Reference in New Issue
Block a user