SDL with MFC MDI?

Warning! Newbie questions follow

Does a tutorial, article, or example exist using SDL and MFC Multi Document
Interface (Doc/View) together? I am not concerned about the cross-platform
capabilities of SDL, but I do what I have seen of the library. I am
completely confused as to how to map the Surface to a Cview.
This is not for a game, it would be a graphics viewer.

Thanx
Robert H. Oujesky—
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.435 / Virus Database: 244 - Release Date: 12/30/2002
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: image/png
Size: 16923 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030116/104743f3/attachment.png
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: image/jpeg
Size: 13255 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030116/104743f3/attachment.jpeg

That’s gonna be tricky…

  1. SDL isn’t designed for that. It’s designed to set video
    modes/windows, blit graphics, handle audio, and do kb/mouse/joystick
    input.
  2. SDL is crossplatform, theoretically letting you compile an identical
    program unmodified on dozens of platforms; naturally, that means a lot
    of data hiding so only the SDL code itself is dependent on system-level
    stuff. Though SDL still allows you some access to window-level stuff if
    you really really want to.

Right now, this seems to boil down to a chicken-or-the-egg problem…
which comes first, SDL or MFC? Can one feed a plain-vanilla window
handle into an MFC class and generate an MFC window with it? Or do we
have to create a MFC window first, and feed it’s window handle into SDL
somehow? Either way, it won’t be pretty.

If it gets done, though… that would be REALLY COOL. :slight_smile:

“Robert H. Oujesky” wrote:> Warning!Newbie questions follow

Does a tutorial, article, or example exist using SDL and MFC Multi
Document Interface (Doc/View) together?I am not concerned about the
cross-platform capabilities of SDL, but I do what I have seen of the
library.I am completely confused as to how to map the Surface to a
Cview.

This is not for a game, it would be a graphics viewer.

Thanx

Robert H. Oujesky

Or do we have to create a MFC window first, and feed it’s window handle
into SDL somehow?
I think so - if I remember correctly MFC creates the m->hWnd. I played with
this a long time ago and i was able to
swap the window handle for another one but I had problems with events, and
controlling when repaints happened.

I think the area to look at is Attach() and search internet for custom
controls.

hi ,
to deal with the mfc window, you have to pass the handle of the window on to which you want to show video, to the SDL
then SDL will manage the event of that window such as paint and button and key messages.

regds
Anupam----- Original Message -----
From: Cullum, Steve
To: 'sdl at libsdl.org
Sent: Friday, January 17, 2003 4:25 PM
Subject: RE: [SDL] SDL with MFC MDI?

Or do we have to create a MFC window first, and feed it’s window handle into SDL somehow?

I think so - if I remember correctly MFC creates the m->hWnd. I played with this a long time ago and i was able to

swap the window handle for another one but I had problems with events, and controlling when repaints happened.

I think the area to look at is Attach() and search internet for custom controls.