No hardware accelerated driver?

Dear SDLers,

It seems that I can’t use SDL’s hardware acceleration.
The following code:

 int numdrivers = SDL_GetNumRenderDrivers ();
 cout << "Render driver count: " << numdrivers << endl;
 for (int i=0; i<numdrivers; i++) {
     SDL_RendererInfo drinfo;
     SDL_GetRenderDriverInfo (0, &drinfo);
     cout << "Driver name ("<<i<<"): " << drinfo.name << endl;
     if (drinfo.flags & SDL_RENDERER_SOFTWARE) cout << " the 

renderer is a software fallback" << endl;
if (drinfo.flags & SDL_RENDERER_ACCELERATED) cout << " the
renderer uses hardware acceleration" << endl;
if (drinfo.flags & SDL_RENDERER_PRESENTVSYNC) cout << " present
is synchronized with the refresh rate" << endl;
if (drinfo.flags & SDL_RENDERER_TARGETTEXTURE) cout << " the
renderer supports rendering to texture" << endl;
}

gives the output:

 Render driver count: 1
 Driver name (0): software
  the renderer is a software fallback
  the renderer supports rendering to texture

Trying to create a renderer with

 SDL_CreateRenderer (window, -1, SDL_RENDERER_ACCELERATED);

will fail with the message: Couldn’t find matching render driver

My system is Linux Mint 15 (amd64) and the Nvidia driver is in use.

Do I have to set any compiler flags or variables?

broepi

1 Like

Make sure you downloaded the OpenGL development libraries or SDL won’t
build with OpenGL support. I had this issue in my first try. Of course
rebuild SDL when you do that.

2013/7/12, Daniel Raufison :> Dear SDLers,

It seems that I can’t use SDL’s hardware acceleration.
The following code:

 int numdrivers = SDL_GetNumRenderDrivers ();
 cout << "Render driver count: " << numdrivers << endl;
 for (int i=0; i<numdrivers; i++) {
     SDL_RendererInfo drinfo;
     SDL_GetRenderDriverInfo (0, &drinfo);
     cout << "Driver name ("<<i<<"): " << drinfo.name << endl;
     if (drinfo.flags & SDL_RENDERER_SOFTWARE) cout << " the

renderer is a software fallback" << endl;
if (drinfo.flags & SDL_RENDERER_ACCELERATED) cout << " the
renderer uses hardware acceleration" << endl;
if (drinfo.flags & SDL_RENDERER_PRESENTVSYNC) cout << " present
is synchronized with the refresh rate" << endl;
if (drinfo.flags & SDL_RENDERER_TARGETTEXTURE) cout << " the
renderer supports rendering to texture" << endl;
}

gives the output:

 Render driver count: 1
 Driver name (0): software
  the renderer is a software fallback
  the renderer supports rendering to texture

Trying to create a renderer with

 SDL_CreateRenderer (window, -1, SDL_RENDERER_ACCELERATED);

will fail with the message: Couldn’t find matching render driver

My system is Linux Mint 15 (amd64) and the Nvidia driver is in use.

Do I have to set any compiler flags or variables?

broepi


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Change the line:

    SDL_GetRenderDriverInfo (0, &drinfo);

to:

    SDL_GetRenderDriverInfo (i, &drinfo);On Fri, Jul 12, 2013 at 1:58 PM, Daniel Raufison <mail at etglmhumyx.broepi.de> wrote:

Dear SDLers,

It seems that I can’t use SDL’s hardware acceleration.
The following code:

int numdrivers = SDL_GetNumRenderDrivers ();
cout << "Render driver count: " << numdrivers << endl;
for (int i=0; i<numdrivers; i++) {
    SDL_RendererInfo drinfo;
    SDL_GetRenderDriverInfo (0, &drinfo);
    cout << "Driver name ("<<i<<"): " << drinfo.name << endl;
    if (drinfo.flags & SDL_RENDERER_SOFTWARE) cout << " the renderer is

a software fallback" << endl;
if (drinfo.flags & SDL_RENDERER_ACCELERATED) cout << " the renderer
uses hardware acceleration" << endl;
if (drinfo.flags & SDL_RENDERER_PRESENTVSYNC) cout << " present is
synchronized with the refresh rate" << endl;
if (drinfo.flags & SDL_RENDERER_TARGETTEXTURE) cout << " the
renderer supports rendering to texture" << endl;
}

gives the output:

Render driver count: 1
Driver name (0): software
 the renderer is a software fallback
 the renderer supports rendering to texture

Trying to create a renderer with

SDL_CreateRenderer (window, -1, SDL_RENDERER_ACCELERATED);

will fail with the message: Couldn’t find matching render driver

My system is Linux Mint 15 (amd64) and the Nvidia driver is in use.

Do I have to set any compiler flags or variables?

broepi


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Alejandro Santos

That’s certainly a bug in the code, but even so, SDL_GetNumRenderDrivers is still returning 1 for him.________________________________
From: Alejandro Santos
To: SDL Development List
Sent: Friday, July 12, 2013 10:53 AM
Subject: Re: [SDL] No hardware accelerated driver?

Change the line:

? ? ? ? SDL_GetRenderDriverInfo (0, &drinfo);

to:

? ? ? ? SDL_GetRenderDriverInfo (i, &drinfo);

On Fri, Jul 12, 2013 at 1:58 PM, Daniel Raufison wrote:

Dear SDLers,

It seems that I can’t use SDL’s hardware acceleration.
The following code:

? ? int numdrivers = SDL_GetNumRenderDrivers ();
? ? cout << “Render driver count: " << numdrivers << endl;
? ? for (int i=0; i<numdrivers; i++) {
? ? ? ? SDL_RendererInfo drinfo;
? ? ? ? SDL_GetRenderDriverInfo (0, &drinfo);
? ? ? ? cout << “Driver name (”<<i<<”): " << drinfo.name << endl;
? ? ? ? if (drinfo.flags & SDL_RENDERER_SOFTWARE) cout << " the renderer is
a software fallback" << endl;
? ? ? ? if (drinfo.flags & SDL_RENDERER_ACCELERATED) cout << " the renderer
uses hardware acceleration" << endl;
? ? ? ? if (drinfo.flags & SDL_RENDERER_PRESENTVSYNC) cout << " present is
synchronized with the refresh rate" << endl;
? ? ? ? if (drinfo.flags & SDL_RENDERER_TARGETTEXTURE) cout << " the
renderer supports rendering to texture" << endl;
? ? }

gives the output:

? ? Render driver count: 1
? ? Driver name (0): software
? ? ? the renderer is a software fallback
? ? ? the renderer supports rendering to texture

Trying to create a renderer with

? ? SDL_CreateRenderer (window, -1, SDL_RENDERER_ACCELERATED);

will fail with the message: Couldn’t find matching render driver

My system is Linux Mint 15 (amd64) and the Nvidia driver is in use.

Do I have to set any compiler flags or variables?

broepi


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Alejandro Santos


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

That’s right. I have quickly coded a for-loop around it, so I missed
this argument. But that wasn’t the problem.

installing the opengl dev files did the trick like Sik said.Am 12.07.2013 19:56, schrieb Mason Wheeler:

That’s certainly a bug in the code, but even so,
SDL_GetNumRenderDrivers is still returning 1 for him.


From: Alejandro Santos
To: SDL Development List
Sent: Friday, July 12, 2013 10:53 AM
Subject: Re: [SDL] No hardware accelerated driver?

Change the line:

    SDL_GetRenderDriverInfo (0, &drinfo);

to:

    SDL_GetRenderDriverInfo (i, &drinfo);

On Fri, Jul 12, 2013 at 1:58 PM, Daniel Raufison <@Daniel_Raufison mailto:Daniel_Raufison> wrote:

Dear SDLers,

It seems that I can’t use SDL’s hardware acceleration.
The following code:

int numdrivers = SDL_GetNumRenderDrivers ();
cout << “Render driver count: " << numdrivers << endl;
for (int i=0; i<numdrivers; i++) {
SDL_RendererInfo drinfo;
SDL_GetRenderDriverInfo (0, &drinfo);
cout << “Driver name (”<<i<<”): " << drinfo.name << endl;
if (drinfo.flags & SDL_RENDERER_SOFTWARE) cout << " the
renderer is
a software fallback" << endl;
if (drinfo.flags & SDL_RENDERER_ACCELERATED) cout << " the
renderer
uses hardware acceleration" << endl;
if (drinfo.flags & SDL_RENDERER_PRESENTVSYNC) cout << “
present is
synchronized with the refresh rate” << endl;
if (drinfo.flags & SDL_RENDERER_TARGETTEXTURE) cout << " the
renderer supports rendering to texture" << endl;
}

gives the output:

Render driver count: 1
Driver name (0): software
the renderer is a software fallback
the renderer supports rendering to texture

Trying to create a renderer with

SDL_CreateRenderer (window, -1, SDL_RENDERER_ACCELERATED);

will fail with the message: Couldn’t find matching render driver

My system is Linux Mint 15 (amd64) and the Nvidia driver is in use.

Do I have to set any compiler flags or variables?

broepi


SDL mailing list
SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Alejandro Santos


SDL mailing list
SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I installed the package “mesa-common-dev” and configure script
recognized OpenGL support. :slight_smile:

Thank you, Sik!Am 12.07.2013 19:32, schrieb Sik the hedgehog:

Make sure you downloaded the OpenGL development libraries or SDL won’t
build with OpenGL support. I had this issue in my first try. Of course
rebuild SDL when you do that.

2013/7/12, Daniel Raufison <@Daniel_Raufison>:

Dear SDLers,

It seems that I can’t use SDL’s hardware acceleration.
The following code:

  int numdrivers = SDL_GetNumRenderDrivers ();
  cout << "Render driver count: " << numdrivers << endl;
  for (int i=0; i<numdrivers; i++) {
      SDL_RendererInfo drinfo;
      SDL_GetRenderDriverInfo (0, &drinfo);
      cout << "Driver name ("<<i<<"): " << drinfo.name << endl;
      if (drinfo.flags & SDL_RENDERER_SOFTWARE) cout << " the

renderer is a software fallback" << endl;
if (drinfo.flags & SDL_RENDERER_ACCELERATED) cout << " the
renderer uses hardware acceleration" << endl;
if (drinfo.flags & SDL_RENDERER_PRESENTVSYNC) cout << " present
is synchronized with the refresh rate" << endl;
if (drinfo.flags & SDL_RENDERER_TARGETTEXTURE) cout << " the
renderer supports rendering to texture" << endl;
}

gives the output:

  Render driver count: 1
  Driver name (0): software
   the renderer is a software fallback
   the renderer supports rendering to texture

Trying to create a renderer with

  SDL_CreateRenderer (window, -1, SDL_RENDERER_ACCELERATED);

will fail with the message: Couldn’t find matching render driver

My system is Linux Mint 15 (amd64) and the Nvidia driver is in use.

Do I have to set any compiler flags or variables?

broepi


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org