I was wondering what the best way to use transformation matrices with SDL2, Previously I have had success with SDL_RenderCopyEx, but now in order to get the desired effect, I need to do several transformations in order to get the effect I want:
glPushMatrix();
glTranslatef(xTranslation, yTranslation, 0);
glRotatef(imageRotation, 0,0,1);
glScalef(xScale, yScale, 1);
glRotatef(rotation, 0,0,1);
SDL_RenderCopy(renderer, texture, NULL, &(SDL_Rect){-rotationCenterX, -rotationCenterY,textureWidth, textureHeight});
glPopMatrix();
Is this safe to do? is there anyway to ensure that a renderer is using OpenGL? or should I check the rendererInfo for which driver is being used (OpenGL, DirectX, or GLES) and modify my code accordingly?