sdl_WINDOWID in directx and window positioning...(textonly repost)

(textonly repost as requested)

hi all;
i’ve got a video player integrated into my app. My app creates a window
which gets passed to SDL via SDL_WINDOWID. this window is not
maximized, its not fullscreen.

i additionally set SDL_VIDEO_WINDOW_POS and SDL_CENTERED as "100,100"
and “yes”, respectively.

when i run the app with windib, the video appears correctly in the
window and all is fine (even though the env vars of SDL_VIDEO_WINDOW_POS
and SDL_CENTERED are ignored). except the player chews up close to 50%
cpu on a dual core 2GHz, w/2GB RAM.

When i run the app with directx driver, the video appears in the top
left hand corner of my screen and not in the window that I pass in. The
performance is close between 8 and 12%.

(BTW: I’m using FFmpeg to decode mpeg streams with mp2 audio… so the
cpu is more related to that than SDL… simply presenting as to why i
want to use Directx and not windib.

AND i am rebuilding SDL.lib and SDL.dll on my machine).

Questions:

1. Can anyone suggest why the video would appear in my app window 

properly with WinDib and not with Directx ? and how i can rectify this ??
2. also, something strange… the window in my app has the
Maximize/minimize disabled, its a little bigger than PAL 720x540. And
when the xxxx_SetVideoMode gets to point of repositioning the window, it
always bypasses it 'cause IsZoomed always returns true. And there is a
suspicious #define IsZoomed(HWND) 1 in SDL_sysevents.c but only for
WIN32_WCE (which i’m presuming is for WinCE).
3. so… anyone have success with direct rendering using
SDL_WINDOWID under DirectX, where the video does not show in the top
left hand corner of the screen (when not in fullscreen mode)?
4. there is a directx.h in the SDL code and i’ve got DirectX 9.0c
SDK installed on my machine… any reason why directx.h in windx5 ought
to be at 5.0??
5. also, any thoughts on why IsZoomed might be returning true when
the window is actually not zoomed ??

any help appreciated.

Kindest regards,
s—

** Sheshadri Mantha** | Principal Software Engineer
SeaChange International, Inc.
2655 Campus Drive, Suite 250
San Mateo, CA 94403
www.schange.com http://www.schange.com | @Sheshadri_Mantha
<mailto:<a href=>
Direct: AZ: 520-408-0521; CA: 650-645-4040
Main: 650-645-4000 | Fax: 650-645-4115
Yahoo! IM: babamantha | AIM: sheshmantha
Skype: sheshadrimantha

SeaChange International

http://www.schange.com
This e-mail and any attachments may contain information which is
SeaChange International confidential. The information enclosed is
intended only for the addressees herein and may not be copied or
forwarded without permission from SeaChange International.

OK… after a little more sleuthing…
The problem is not the IsZoomed as i was assuming.

it makes sense that if SDL_WindowID is set then SDL would bypass any
window positioning so that block - the one that computes bounds,
SDL_WindowX, etc., based on env vars and ultimately calls SetWIndowPos)
was not being called at all (due to WindowID being set).

So, now my question becomes, how is that DirectX creates a video surface
(correct terminology?) which gets positioned at 0,0 and not in the
coords of the window that I pass to?

where would i look to see what it creates (Not at all directx savvy)?

Kindest regards,
S-

Sheshadri Mantha wrote:> (textonly repost as requested)

hi all;
i’ve got a video player integrated into my app. My app creates a window
which gets passed to SDL via SDL_WINDOWID. this window is not
maximized, its not fullscreen.

i additionally set SDL_VIDEO_WINDOW_POS and SDL_CENTERED as "100,100"
and “yes”, respectively.

when i run the app with windib, the video appears correctly in the
window and all is fine (even though the env vars of SDL_VIDEO_WINDOW_POS
and SDL_CENTERED are ignored). except the player chews up close to 50%
cpu on a dual core 2GHz, w/2GB RAM.

When i run the app with directx driver, the video appears in the top
left hand corner of my screen and not in the window that I pass in. The
performance is close between 8 and 12%.

(BTW: I’m using FFmpeg to decode mpeg streams with mp2 audio… so the
cpu is more related to that than SDL… simply presenting as to why i
want to use Directx and not windib.

AND i am rebuilding SDL.lib and SDL.dll on my machine).

Questions:

  1. Can anyone suggest why the video would appear in my app window
    properly with WinDib and not with Directx ? and how i can rectify this ??
  2. also, something strange… the window in my app has the
    Maximize/minimize disabled, its a little bigger than PAL 720x540. And
    when the xxxx_SetVideoMode gets to point of repositioning the window, it
    always bypasses it 'cause IsZoomed always returns true. And there is a
    suspicious #define IsZoomed(HWND) 1 in SDL_sysevents.c but only for
    WIN32_WCE (which i’m presuming is for WinCE).
  3. so… anyone have success with direct rendering using
    SDL_WINDOWID under DirectX, where the video does not show in the top
    left hand corner of the screen (when not in fullscreen mode)?
  4. there is a directx.h in the SDL code and i’ve got DirectX 9.0c SDK
    installed on my machine… any reason why directx.h in windx5 ought to
    be at 5.0??
  5. also, any thoughts on why IsZoomed might be returning true when
    the window is actually not zoomed ??

any help appreciated.

Kindest regards,
s-

** Sheshadri Mantha** | Principal Software Engineer
SeaChange International, Inc.
2655 Campus Drive, Suite 250
San Mateo, CA 94403
www.schange.com http://www.schange.com | @Sheshadri_Mantha
<mailto:<a href=>
Direct: AZ: 520-408-0521; CA: 650-645-4040
Main: 650-645-4000 | Fax: 650-645-4115
Yahoo! IM: babamantha | AIM: sheshmantha
Skype: sheshadrimantha

SeaChange International

http://www.schange.com
This e-mail and any attachments may contain information which is
SeaChange International confidential. The information enclosed is
intended only for the addressees herein and may not be copied or
forwarded without permission from SeaChange International.