PDA

View Full Version : Mixing an Open Inventor Window in an existing DirectDraw application.


JeffI
11-12-2008, 01:12 AM
Hi,

I'm attempting to embed an open inventor window in an existing application that uses DirectDraw surfaces.

According to the OGL FAQ, I can mix the API's in the same window.

Can I mix them if I isolate each to their own window? I'm seeing a DirectDraw crash right now.

Thanks.
Jeff

mikeheck
11-12-2008, 06:17 AM
Hi Jeff,

I think this should work, but I've never tried it.

So we can try to reproduce your result, what version of Windows are you using? 32 or 64 bit?

Thanks,
Mike

JeffI
11-12-2008, 07:35 AM
Mike,

First a correction to my post: You CAN'T mix them in the same window. See link:
http://www.opengl.org/resources/faq/technical/mswindows.htm

But, I'm trying to do this in separate windows.

We are using 32 bit windows XP.

Thanks!
Jeff

mikeheck
11-14-2008, 04:56 AM
Hi Jeff,

Here is a simple example that works. It creates a DirectX window and an Open Inventor window. It does DirectX rendering and Open Inventor rendering simultaneously (in separate windows).

This is using (approximately) the latest DirectX SDK. The base example comes from the DirectX SDK Samples. There are only two chunks of code added. Look for "//MCS".

Note: There is unfortunately a subtle problem that might cause a crash in a more realistic application. The Open Inventor DLLs are built to use the DLL version of the C++ runtime (i.e. MSVCR80D). The DirectX example's project is setup to use the non-DLL (linked in) runtime. If I change this in the project settings then the example won't run (even without the Inventor code) because it "can't find" MSVCR80D.DLL. This must be another problem with SxS and manifests, but I don't have time to figure it out right now. Right now the example runs, including the Inventor code, but if something gets allocated in one runtime and freed in the other, it may crash.

44

Regards,
-Mike

JeffI
11-14-2008, 01:15 PM
Hi Mike,

First of all, thanks so much. I tried it and it works like a charm.

I'll use that as a basis to try to repro my issue.

The things that differ with my app are:
- I'm doing OIV rendering in a thread.
- I'm using VolumeViz

I'll get back to you soon. Thanks again.
Jeff

JeffI
11-14-2008, 01:29 PM
Mike,

The one other piece of information is:
- My crash happens after running the app for 4-8 minutes
- Both windows (DX and OIV) are rendering constantly
- The crash is always in DX doing the following:

IDirectDrawSurface7_Blt(...)

Either the source or destination surface has been corrupted???

Jeff

JeffI
11-24-2008, 06:55 PM
Hi,

Thanks for the help.

Turns out the issue is in DirectDraw and my Drivers!

Your example was very helpful.
Jeff