File indexing completed on 2026-04-09 07:49:38
0001 #pragma once
0002
0003
0004
0005
0006
0007
0008
0009 struct SGLFW_VAO
0010 {
0011 const char* name ;
0012 GLuint id ;
0013
0014 SGLFW_VAO(const char* name);
0015 void init();
0016 void bind();
0017 void unbind();
0018 };
0019
0020 inline SGLFW_VAO::SGLFW_VAO(const char* _name)
0021 :
0022 name(_name ? strdup(_name) : nullptr),
0023 id(-1)
0024 {
0025 init();
0026 }
0027
0028 inline void SGLFW_VAO::init()
0029 {
0030 glGenVertexArrays (1, &id); SGLFW__check(__FILE__, __LINE__, name, id, "glGenVertexArrays/init" );
0031 }
0032
0033 inline void SGLFW_VAO::bind()
0034 {
0035 glBindVertexArray(id); SGLFW__check(__FILE__, __LINE__, name, id, "glBindVertexArray/bind" );
0036 }
0037 inline void SGLFW_VAO::unbind()
0038 {
0039 glBindVertexArray(0); SGLFW__check(__FILE__, __LINE__, name, id, "glBindVertexArray/unbi" );
0040 }
0041
0042
0043