Hey there, I am having this issue understanding how the data flow of opengl works, I couldn’t find any information on google either. So again I am coming to the opengl forums.
This is a basic example of my code
##Shader.h
class Shader {
GLuint id;
bool bCreated;
void create();
Shader();
~Shader();
}
##Shader.cpp
Shader() {
id = 0;
bCreated = false;
}
~Shader() {
if(id != 0)
glDeleteShader(id);
}
void create() {
id = glCreateShader(GL_VERTEX_SHADER);
bCreated = true;
}
This just throws access violations at me in the deconstructor.
Am I misunderstanding c++ or… What could possibly be wrong with the deconstructor is my thought.
Also I store my vertices in a pointer array which i then upload to a vbo. When my deconstructor deletes this vertice array I get weird errors.
I might be revealing too little, but my question is basically what does opengl do to the data I provide it ?