hello,
class ShaderProgram {
public:
ShaderProgram(GLuint id) {
m_uiProgramID = id;
}
GLuint programID() {
return m_uiProgramID;
}
}; // this class is defined in another file
when i use it like this:
GLuint tmpID = create and link program; // this is correct.
ShaderProgram p(tmpID);
GLuint id = p.programID(); // this does not correct.
but it is ok like this:
ShaderProgram *p = new ShaderProgram(tmpID);
GLuint id = p->programID();
why? The program id is not just a int?? what if it is copied? the program object will lost?



