No available video device?

Hi all!

I’m using SDL 1.2 on Debian in VirtualBox with success for my project. But the new version can give a major improvement to it.
I’ve downloaded SDL2 tarball, extracted, made ./configure (with --prefix /usr); make; make install.

I’m trying to run some test program just with SDL_Init(SDL_INIT_VIDEO), but it gives me “No available video device” error.

But, when I run this program:

Code:

#include “SDL.h”

int main (int argc, char* argv[])
{
int numdrivers = SDL_GetNumRenderDrivers();

printf(“Drivers count: %i\n”);

for (int i=0;i<numdrivers;i++)
{
SDL_RendererInfo drinfo;
SDL_GetRenderDriverInfo(i, &drinfo);

printf("Driver name: %s\n", drinfo.name);

}
}

I get this result:
Drivers count: 2
Driver name: opengl
Driver name: software

What am I missing?

Unless I am missing something as well, the render drivers have “nothing” (???) to do with the video device. In SDL2, the Render API is kind of different from the “Display” API, which means that the render drivers are available, but something can be wrong with initializing your video device (screen).

The correct function is “SDL_GetNumVideoDrivers()”, not “SDL_GetNumRenderDrivers()”.

The docs state that this function returns the number of the video drivers SDL was compiled with, so it’s possible that something could not be found from your configure script.

I might be way off here, but could it be the libXi issue?? Checking what is the version of ‘libXi’ could be of help in that case…------------------------
C is the God’s Programming Language

Thank you for your reply!

I’ve run the test code from http://sdl.beuc.net/sdl.wiki/SDL-1.3_SDL_GetNumVideoDrivers and got these results:

Driver x11 doesn’t work.
Driver dummy works.

But the thing is that I use raw framebuffer, no x11. May be I must set something in ./configure part when compiling SDL2 to use it?

I’ve tested my SDL1.2 program, and by using SDL_VideoDriverName obtained, that my driver name is fbcon.

Is there any support in SDL2 for this driver?

REVERSE wrote:

I’ve tested my SDL1.2 program, and by using SDL_VideoDriverName obtained, that my driver name is fbcon.

Is there any support in SDL2 for this driver?

Do you mean ‘‘DirectFB" ??? (I don’t know for sure, that’s the closest I found). If that is the case, then pass the option ‘’–enable-video-directfb’’ when running configure:

./configure --enable-video-directfb other flags
make ; make install

Also make sure that the required development files for directfb are installed; remember that SDL is a wrapper around os-specific features, so you need the original dev files.------------------------
C is the God’s Programming Language

We removed fbcon support in SDL2.

The DirectFB code might still work, and I think can talk to the kernel
fbcon drivers behind the scenes.

–ryan.On 07/14/2013 03:35 PM, REVERSE wrote:

I’ve tested my SDL1.2 program, and by using SDL_VideoDriverName
obtained, that my driver name is fbcon.

Is there any support in SDL2 for this driver?