Is this the right way to check if the ACCELERATION ENABLED?

Trying to figure out if the flags are enabled in the render driver, in the following way. Is this the right approach?

  SDL_RendererInfo rInfo;
  SDL_GetRendererInfo (renderer, &rInfo);

   if ( rInfo.flags & SDL_RENDERER_SOFTWARE )  printf (" enabled SDL_RENDERER_SOFTWARE ");
   if ( rInfo.flags & SDL_RENDERER_ACCELERATED ) printf(" enabled SDL_RENDERER_ACCELERATED ");
   if ( rInfo.flags & SDL_RENDERER_PRESENTVSYNC ) printf("enabled SDL_RENDERER_PRESENTVSYNC ");
   if ( rInfo.flags & SDL_RENDERER_TARGETTEXTURE ) printf("enabled SDL_RENDERER_TARGETTEXTURE ");

If you’re using openGL I usually use

int i;
SDL_GL_GetAttribute( SDL_GL_ACCELERATED_VISUAL, &i );

keestu wrote:> Trying to figure out if the flags are enabled in the render driver, in the following way. Is this the right approach?

  SDL_RendererInfo rInfo;
  SDL_GetRendererInfo (renderer, &rInfo);

   if ( rInfo.flags & SDL_RENDERER_SOFTWARE )  printf (" enabled SDL_RENDERER_SOFTWARE ");
   if ( rInfo.flags & SDL_RENDERER_ACCELERATED ) printf(" enabled SDL_RENDERER_ACCELERATED ");
   if ( rInfo.flags & SDL_RENDERER_PRESENTVSYNC ) printf("enabled SDL_RENDERER_PRESENTVSYNC ");
   if ( rInfo.flags & SDL_RENDERER_TARGETTEXTURE ) printf("enabled SDL_RENDERER_TARGETTEXTURE ");

Tanks for reply. I am not using OpenGL, but does that matter?, What i understood is SDL internally uses OpenGL. ?

In Windows you have a choice of OpenGL and DirectX, elsewhere its OpenGL. Soo unless you are on windows and using DirectX you can use the opengl codes or your own. Its all just preference.

keestu wrote:> Tanks for reply. I am not using OpenGL, but does that matter?, What i understood is SDL internally uses OpenGL. ?