PDA

View Full Version : Help with Qt and SDL



bottin
29th July 2009, 21:48
Hi all,

I try to use SDL lib in a Qt Project using a Visual Studio 2008, but i cant use SDL with QT.

In SDL i make this function



void setpixel(SDL_Surface *screen, int x, int y, Uint8 r, Uint8 g, Uint8 b)
{
Uint32 *pixmem32;
Uint32 colour;

colour = SDL_MapRGB( screen->format, r, g, b );

pixmem32 = (Uint32*) screen->pixels + y + x;
*pixmem32 = colour;
}

now i cant use this function on Qt, does anyone know how i can use SDL with Qt or how i can modify this function to work on Qt?

Thanks for all!

wysota
29th July 2009, 22:01
What is it supposed to do?

ricardo
30th July 2009, 17:17
Use SDL and Qt is a bad idea. Both of them have their own event and windowing system. Try to use QGLWidget or try to look for a wrapper.

bottin
30th July 2009, 17:42
What is it supposed to do?
I have a sparse matrix with a range between -inf to inf, this function paint in a blank image diferents colors for each number of matrix.


Use SDL and Qt is a bad idea. Both of them have their own event and windowing system. Try to use QGLWidget or try to look for a wrapper.

Thanks for your help, i will see this class now! =)

ricardo
30th July 2009, 18:23
I have a sparse matrix with a range between -inf to inf, this function paint in a blank image diferents colors for each number of matrix.


In that case, the best and easiest choice is to use QGLWidget.

bottin
30th July 2009, 18:34
In that case, the best and easiest choice is to use QGLWidget.


Thanks brow, now i use QGLWidget and resolve my problem! :)