SDL on QtWidget

Hi,
Do you have free code example for use SDL on a Qt Widget (Linux) ?
Thank’s for advance,
Bests regards, David.

ROMEUF DAVID schrieb:

Hi,
Do you have free code example for use SDL on a Qt Widget (Linux) ?
Thank’s for advance,
Bests regards, David.

That would be interesting. Currently we convert the pixel data directly
to QImage,
to use it in our editor project.

If you want to look at some code, try the part
engine/BRANCHES/experimental/fifedit/src/renderbackend/qt
in our svn repository.

The relevant snippet is:

    QTImage::QTImage(const uint8_t *rgbaData, const unsigned int 

width, const unsigned int height) {
// RGBA to ARGB
const int image_size = widthheight4;
data = new uchar[image_size];
for (int count = 0; count < image_size; count += 4) {
data[count] = rgbaData[count+1];
data[count+1] = rgbaData[count+2];
data[count+2] = rgbaData[count+3];
data[count+3] = rgbaData[count];
}

            m_surface = QImage(data, width, height, 

QImage::Format_ARGB32);
}–
Klaus Blindert

www.fifengine.de