Would appreciate a pointer here (pun intended).
It's been a long time since I've touched anything low-level. Apologies if this is simple. I didn't post this in GD because it's basic C, not game related. I'm receiving errors with an app that uses SDL. I've found the error seems to vary based on platform. I'm not sure, it looks like a simple declaration issue, causing error on assignment.
error: cannot convert ‘void (*)(GLuint)’ to ‘void ()(GLuint)’ in assignment
Code:
middle of SDL_opengl.h
Code:
GLAPI void APIENTRY glUseProgram (GLuint);
top of renderer_ogl.cpp
Code:
typedef void (APIENTRY* PFNGLUSEPROGRAMPROC) (GLuint program);
PFNGLUSEPROGRAMPROC glUseProgram = 0;
middle of renderer_ogl.cpp
Code:
glUseProgram = (PFNGLUSEPROGRAMPROC) SDL_GL_GetProcAddress("glUseProgram");
I changed the last one to dereference:
Code:
glUseProgram = *(PFNGLUSEPROGRAMPROC) SDL_GL_GetProcAddress("glUseProgram");
It said
error: cannot convert ‘void ()(GLuint)’ to ‘void ()(GLuint)’ in assignment
I actually recall function pointers were suppose to be pointers... the error doesn't really make sense, and I'm just confusing myself. Until tomorrow.
Thanks