I never used SDL before but I’m trying to compile and run some simple code on Centos 7.
First, running:
glxinfo | grep renderer
OpenGL renderer string: GeForce GTX TITAN Black/PCIe/SSE2
There are actually 2 GeForce GTX TITAN Black cards in the machine. They are not connected in SLI. And work fine with other applications.
This is how my test program starts:
#include <SDL.h>
#include
int main( int argc, char argv[])
{
SDL_Window sdlWin;
SDL_Renderer* sdlRenderer;
SDL_Surface* sdlSurf;
bool running = true;
if (SDL_Init(SDL_INIT_VIDEO) < 0)
{
std::cout << "[ERROR:] SDL could not initialize! SDL Error: " << SDL_GetError() << std::endl;
exit(1);
}
sdlWin = SDL_CreateWindow (
"SDL_tut",
SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED,
640, 480,
SDL_WINDOW_OPENGL
);
sdlRenderer = SDL_CreateRenderer( sdlWin, -1, 0);
if (sdlRenderer == NULL)
{
std::cout << "[ERROR:] SDL_CreateRenderer: " << SDL_GetError() << std::endl;
exit(1);
}
sdlSurf = SDL_GetWindowSurface(sdlWin);
if (sdlSurf == NULL)
{
std::cout << "[ERROR:] SDL_CreateRenderer: " << SDL_GetError() << std::endl;
exit(1);
}
code continues…
I compile the program with:
g++ …/SDL_tut.cpp -o ~/SDL_tut -g -Og
sdl2-config --cflags --libs
sdl2-config expands to:
-I/usr/include/SDL2 -D_REENTRANT -lSDL2
Compilation goes fine and generates no warnings.
The program fails on the line: “sdlRenderer = SDL_CreateRenderer( sdlWin, -1, 0);” with my message:
“[ERROR:] SDL_CreateRenderer: No hardware accelerated renderers available”
Any ideas on how to fix that or how to investigate further?
By the way, the program compiles and runs fine on windows 10…