[SDL] Convert opencv IplImage * to SDL_Texture * (SDL 1.3)

Alex Barry alex.barry at gmail.com
Sat Jul 17 17:18:23 PDT 2010


Well, I bit the bullet and decided to work on some software using SDL 1.3
I'm under the impression that to render to a window, you need to use
textures.  Well, after searching the wiki and SDL_video.h, there doesn't
seem to be a way to directly access pixels from a texture to convert an
image.  I noticed there seems to be a lot of code that still uses
SDL_Surface * and even found a a function that converts a surface to a
texture.  Is that the proper way to do things, so does anyone have a
suggestion?
I'm using opencv to capture a webcam and do some shape tracking, but I find
SDL has much better event handling and graphic display.
I'm also not sure of the pixel format from the IplImage - I did a few
searches and the best I hear is that it is BGR format...SDL_Texture has some
options to use that, but I'm not sure what BGR format it is (the wiki lists
a few different versions...)

Any help would be appreciated.
Take care,
-Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20100717/7facc5d0/attachment-0007.htm>


More information about the SDL mailing list