17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-29 04:37:30 +01:00

Require OpenGL 4.6 core context and regenerate glad

This commit is contained in:
2026-10-15 01:39:32 +02:00
parent 61bfc6eb1a
commit 9e64244ebd
14 changed files with 1787 additions and 3998 deletions

View File

@@ -12,6 +12,14 @@ http://mozilla.org/MPL/2.0/.
#include <stack>
#include <vector>
// matrix modes of the fixed pipeline, which isn't part of the core profile; the stack below keeps them on the cpu side
#ifndef GL_MODELVIEW
#define GL_MODELVIEW 0x1700
#endif
#ifndef GL_PROJECTION
#define GL_PROJECTION 0x1701
#endif
// encapsulation of the fixed pipeline opengl matrix stack
class opengl_matrices {
@@ -82,8 +90,9 @@ public:
private:
// methods:
// the core profile has no fixed pipeline matrices to upload to; the renderer passes the matrices to its shaders itself
void
upload() { ::glLoadMatrixf( glm::value_ptr( m_stack.back() ) ); }
upload() {}
// members:
std::vector<glm::mat4> m_stack;
@@ -110,8 +119,7 @@ public:
case GL_MODELVIEW: { m_mode = stack_mode::gl_modelview; break; }
case GL_PROJECTION: { m_mode = stack_mode::gl_projection; break; }
case GL_TEXTURE: { m_mode = stack_mode::gl_texture; break; }
default: { break; } }
if( m_upload ) {::glMatrixMode( Mode ); } }
default: { break; } } }
glm::mat4 const &
data( GLuint const Mode = -1 ) const {
switch( Mode ) {