However, I can't even get the sample code to compile. I'm using Visual Studio 2010 and this is what I get:
1>main.obj : error LNK2019: unresolved external symbol __imp__glGetError@0 referenced in function "bool __cdecl init_GL(void)" (?init_GL@@YA_NXZ)
1>main.obj : error LNK2019: unresolved external symbol __imp__glOrtho@48 referenced in function "bool __cdecl init_GL(void)" (?init_GL@@YA_NXZ)
1>main.obj : error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function "bool __cdecl init_GL(void)" (?init_GL@@YA_NXZ)
1>main.obj : error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function "bool __cdecl init_GL(void)" (?init_GL@@YA_NXZ)
1>main.obj : error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function "bool __cdecl init_GL(void)" (?init_GL@@YA_NXZ)
1>main.obj : error LNK2019: unresolved external symbol __imp__glEnd@0 referenced in function "public: void __thiscall Square::show(void)" (?show@Square@@QAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol __imp__glVertex3f@12 referenced in function "public: void __thiscall Square::show(void)" (?show@Square@@QAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol __imp__glColor4f@16 referenced in function "public: void __thiscall Square::show(void)" (?show@Square@@QAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol __imp__glBegin@4 referenced in function "public: void __thiscall Square::show(void)" (?show@Square@@QAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol __imp__glTranslatef@12 referenced in function "public: void __thiscall Square::show(void)" (?show@Square@@QAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function _SDL_main
Probably overlooking something really simple here. I tried searching whether I missed something I should have set up, but so far no luck.
On a related note, is OpenGL the way to go for 2D games with SDL or are there alternatives? (not looking to get into 3D just yet) I have read that the SDL renderer is rather slow, so I imagine I want some sort of hardware acceleration in any case.
On the other hand I'm not looking for a full blown engine, though; I need some programming practice and making a simple engine with a basic game (more of a tech demo) seems like a good place to start.
Thanks for any help.