I switched to Glew, including GL/glew.h and linking GLEW instead of glee, then putting this in the init_gl() function (called after a context is obtained through SDL)
Also removed glu.h/lib, because apparently glew includes that also.
glewExperimental = true;
GLenum err = glewInit();
if (GLEW_OK != err) {
std::cout << "glewinit FAILED";
}
fprintf(stdout, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));
And it reports that glew is indeed, OK.
GLEW_ARB_vertex_buffer_object == true also!
Eclipse still fails to realise that glGenBuffers et al can be used, as well as GLEW_* bool values, underlining them in red, but it compiles.....
And fails to run, segfaulting at the use of:
glGenBuffers(1, &vertexBuffer);
here's a (decidedly more useful this time) backtrace:
(gdb) backtrace #0 0x0000000000000000 in ?? () #1 0x0000000000401a11 in Entity::Entity (this=0x607750, x=100, y=100, width=20, height=20, collision=true) at ../src/Entity.cpp:20 #2 0x000000000040183a in main () at ../src/Crysis.cpp:20
Am I using glew wrong still?
EDIT: Damn!! I've been stupid. stupid stupid stupid!!! I queried the GL_VERSION with glGetString before glGenBuffers, just to quickly see what context I had, and the program returned.... NULL. What the.... I thought... But I was.... Drawing to the.... Wait.... IT CAN'T BE!!
I instantiated the Entity BEFORE I ran the init function, at the top of main, generating and filling a buffer before I had a context!! So I guess the buffer generated didn't really exist, so when I bound nothing nothing was reported, but when I tried to draw it OpenGL (understandably) freaked out.
It's not crashing and it's reporting 'finished drawing' so I'll assume it's been drawn (hasn't been translated of colored, or gluLooked at so I'll assume it's being 'shown' somewhere, I'll report back if it's not!)
Thanks so much, I really appreciated the help! Any other advice about anything I'm doing really badly here, please say!
EDIT2: Wasn't drawing, you have to bind the buffer before you send the data, then again before you draw, I was binding just pre-draw! Awesome.