Intel rendering problem, again

More details, yesterday I tested SDL2 test apps, and they run perfectly.
So, I guess Im doing some unsafe initialization of SDL which is not
compatible with intel graphics, here is the code:

if (SDL_Init(SDL_INIT_VIDEO)< 0) {
exit(1);
}

SDL_Window *w = SDL_CreateWindow(“Labyrinth of Knowledge”,
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_WINDOW_SHOWN);

if(w==NULL){
// In the event that the window could not be made…
std::cout << "Could not create window: " << SDL_GetError() << ‘\n’;
return 1;
}

SDL_Renderer *r= SDL_CreateRenderer(w, -1, SDL_RENDERER_ACCELERATED);

I think that perhaps requesting an accelerated renderer is a mistake,
is there some safer way to initialize and get a working renderer?–
Roger D. Vargas
Using Gentoo Linux 2010
La unica forma de encontrar los limites de lo posible es yendo mas
alla de ellos, hacia lo imposible

checks his own source code

renderer = SDL_CreateRenderer(window, -1,
(settings.vsync ? SDL_RENDERER_PRESENTVSYNC : 0) |
(settings.no_hwaccel ? SDL_RENDERER_SOFTWARE : 0));

OK… What happens if you pass 0? If you do and that works then yeah,
most likely SDL is being unable to use OpenGL for some reason.
Otherwise no idea.

2013/4/20, luo_hei at yahoo.es <luo_hei at yahoo.es>:> More details, yesterday I tested SDL2 test apps, and they run perfectly.

So, I guess Im doing some unsafe initialization of SDL which is not
compatible with intel graphics, here is the code:

if (SDL_Init(SDL_INIT_VIDEO)< 0) {
exit(1);
}

SDL_Window *w = SDL_CreateWindow(“Labyrinth of Knowledge”,
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480,
SDL_WINDOW_SHOWN);

if(w==NULL){
// In the event that the window could not be made…
std::cout << "Could not create window: " << SDL_GetError() << ‘\n’;
return 1;
}

SDL_Renderer *r= SDL_CreateRenderer(w, -1, SDL_RENDERER_ACCELERATED);

I think that perhaps requesting an accelerated renderer is a mistake,
is there some safer way to initialize and get a working renderer?


Roger D. Vargas
Using Gentoo Linux 2010
La unica forma de encontrar los limites de lo posible es yendo mas
alla de ellos, hacia lo imposible


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

El 04/20/2013 10:43 AM, Sik the hedgehog escribi?:

checks his own source code

renderer = SDL_CreateRenderer(window, -1,
   (settings.vsync ? SDL_RENDERER_PRESENTVSYNC : 0) |
   (settings.no_hwaccel ? SDL_RENDERER_SOFTWARE : 0));

OK… What happens if you pass 0? If you do and that works then yeah,
most likely SDL is being unable to use OpenGL for some reason.
Otherwise no idea.

Passing 0 or SDL_RENDERER_SOFTWARE gives some result, but it is ugly,
see the attached screenshot. Anyway, at least I can work at home.–
Roger D. Vargas
Using Gentoo Linux 2010
La unica forma de encontrar los limites de lo posible es yendo mas
alla de ellos, hacia lo imposible
-------------- next part --------------
A non-text attachment was scrubbed…
Name: Pantallazo.png
Type: image/png
Size: 7668 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130421/8319f557/attachment.png

Software renderer should be always perfect (it’s the reference
renderer), so if even that gives you some visual error that means
you’re doing something wrong with the image data.

That 0 gives you the same result as SDL_RENDERER_SOFTWARE (but not
SDL_RENDERER_ACCELERATED) does imply that SDL is preferring the
software renderer though. Ouch.

2013/4/21, luo_hei at yahoo.es <luo_hei at yahoo.es>:> El 04/20/2013 10:43 AM, Sik the hedgehog escribi?:

checks his own source code

renderer = SDL_CreateRenderer(window, -1,
   (settings.vsync ? SDL_RENDERER_PRESENTVSYNC : 0) |
   (settings.no_hwaccel ? SDL_RENDERER_SOFTWARE : 0));

OK… What happens if you pass 0? If you do and that works then yeah,
most likely SDL is being unable to use OpenGL for some reason.
Otherwise no idea.

Passing 0 or SDL_RENDERER_SOFTWARE gives some result, but it is ugly,
see the attached screenshot. Anyway, at least I can work at home.


Roger D. Vargas
Using Gentoo Linux 2010
La unica forma de encontrar los limites de lo posible es yendo mas
alla de ellos, hacia lo imposible

El 04/22/2013 12:10 AM, Sik the hedgehog escribi?:

Software renderer should be always perfect (it’s the reference
renderer), so if even that gives you some visual error that means
you’re doing something wrong with the image data.

That 0 gives you the same result as SDL_RENDERER_SOFTWARE (but not
SDL_RENDERER_ACCELERATED) does imply that SDL is preferring the
software renderer though. Ouch.

Well, as I said before, it works fine with Nvidia+propietary drivers.
But maybe Im missing something here.–
Roger D. Vargas
Using Gentoo Linux 2010
La unica forma de encontrar los limites de lo posible es yendo mas
alla de ellos, hacia lo imposible

El 04/22/2013 12:10 AM, Sik the hedgehog escribi?:

Software renderer should be always perfect (it’s the reference
renderer), so if even that gives you some visual error that means
you’re doing something wrong with the image data.

I have checked my code again, I just load the image with SDL2_image (got
it from repository) and the convert to surface:

tmp = IMG_Load(“wall.png”); //tmp is SDL_Surface *
wall = SDL_CreateTextureFromSurface(renderer, tmp); //wall is SDL_Texture*–
Roger D. Vargas
Using Gentoo Linux 2010
La unica forma de encontrar los limites de lo posible es yendo mas
alla de ellos, hacia lo imposible

Sorry about the previous message…

You can also use the IMG_LoadTexture(renderer, filename) call from SDL_image to get a ready texture.?
Also, make sure that SDL_image was compiled with Png support. To see that, rerun configure and check the output(it should be clear)