So I have this code (bear with my unexpertise of how to properly name things):
class CGame
{
private:
bool running;
SDL_Window* window;
SDL_GLContext mainContext;
//SDL_Renderer *renderer;
CPlayer thePlayer;
CWorld gameWorld;
public:
CGame();
int onExecute();
bool onInit();
void onEvent(SDL_Event* event);
void onUpdate();
void onRender();
void onCleanup();
};
I’m starting with game programming and I chose a 2D game with OpenGL, I’ve been reading some samples but got confused at some point. It seems 2D rendering is already hardware-accelerated with SDL_Renderer and stuff, it’s quite simple to use RenderCopy but I couldn’t figure out how to render a texture with OpenGL set up.
I ran into this when designing a sprite class (it will have to render the texture on the screen), so many codes that I can’t figure how to fit everything into OpenGL. I know it may sound ridiculously dumb question but I thought I’d give it a try! Thanks!