Home All Groups Group Topic Archive Search About

DirectX rendered inside a control?

Author
24 Aug 2006 8:55 PM
PJ6
I'm asking this question here because the support in the DirectX forums is
virtually non-existant. If anyone can suggest where else I can post this
with better results, please let me know...

DirectX uses a completely different paradigm than what I'm used to painting
forms normally with GDI+. From what I can tell, you cannot have a "DirectX
control", but rather you have to pass a handle to an entire form, and then
the rendering is done on the form itself. My first tries have lead me to
beileve that I just can't incoprorate hardware-accelerated rendering into an
application with other windows controls, especially not if I want the render
area to be contained in a panel or other control. If this is true DirectX
would seem to be a completely unworkable tool to use in standard WinForms
applications.

Anyone want to share their own points of view, experiences using DirectX in
non-gaming applications?

TIA,
Paul

P.S. I'm using the version 10 SDK

Author
24 Aug 2006 10:16 PM
cSharpLess
"PJ6" <no***@nowhere.net> kirjoitti
viestissä:uoL$c%237xGHA.2***@TK2MSFTNGP05.phx.gbl...

<snip>

> DirectX uses a completely different paradigm than what I'm used to
> painting forms normally with GDI+. From what I can tell, you cannot have a
> "DirectX control", but rather you have to pass a handle to an entire form,
> and then the rendering is done on the form itself. My first tries have
> lead me to beileve that I just can't incoprorate hardware-accelerated
> rendering into an application with other windows controls, especially not
> if I want the render area to be contained in a panel or other control.

You can render to panel etc. just fine with DirectX. When you create Device
just pass it a control you wanna render into.

<snip>
Author
25 Aug 2006 12:20 AM
PJ6
"cSharpLess" <no@mails.invalid> wrote in message
news:OaCBEs8xGHA.3608@TK2MSFTNGP06.phx.gbl...
> You can render to panel etc. just fine with DirectX. When you create
> Device just pass it a control you wanna render into.
>
> <snip>

I get a very unhelpful error message when I try that (as opposed to just
passing the form handle).

If you're feeling generous, please post a simple class inheriting from
Control that renders something using DirectX 10.

Thanks,
Paul
Author
25 Aug 2006 8:05 AM
Patrice
AFAIK DX10 is not usable from Managed Code yet ? Or do I miss something ?

IMO it's generally better to mention the exact error message you have (the
debug runtime can also be helpfull) and that you provide the simplest
possible code that repro the error if needed.

A sample won't do exactly what you want and could not include som other
point that causes the problem...

You can try microsoft.public.win32.programmer.directx.managed if you don"t
have tried it already....

--
Patrice

"PJ6" <no***@nowhere.com> a écrit dans le message de news:
uB5KAx9xGHA.3***@TK2MSFTNGP06.phx.gbl...
Show quoteHide quote
> "cSharpLess" <no@mails.invalid> wrote in message
> news:OaCBEs8xGHA.3608@TK2MSFTNGP06.phx.gbl...
>> You can render to panel etc. just fine with DirectX. When you create
>> Device just pass it a control you wanna render into.
>>
>> <snip>
>
> I get a very unhelpful error message when I try that (as opposed to just
> passing the form handle).
>
> If you're feeling generous, please post a simple class inheriting from
> Control that renders something using DirectX 10.
>
> Thanks,
> Paul
>
Author
25 Aug 2006 1:58 PM
PJ6
Ahh now we're getting somewhere. I thought something was wrong when I
blue-screened myself. Well, after I had a good laugh.

I'll back up, uninstall 10 and go with 9.

Good NG suggestion, too.

Thank you!
Paul

Show quoteHide quote
"Patrice" <scr***@chez.com> wrote in message
news:elkK50ByGHA.4232@TK2MSFTNGP05.phx.gbl...
> AFAIK DX10 is not usable from Managed Code yet ? Or do I miss something ?
>
> IMO it's generally better to mention the exact error message you have (the
> debug runtime can also be helpfull) and that you provide the simplest
> possible code that repro the error if needed.
>
> A sample won't do exactly what you want and could not include som other
> point that causes the problem...
>
> You can try microsoft.public.win32.programmer.directx.managed if you don"t
> have tried it already....
>
> --
> Patrice
Author
25 Aug 2006 1:06 PM
cSharpLess
"PJ6" <no***@nowhere.com> kirjoitti
viestissä:uB5KAx9xGHA.3***@TK2MSFTNGP06.phx.gbl...

<snip>

> If you're feeling generous, please post a simple class inheriting from
> Control that renders something using DirectX 10.

Ahhh, I missed that DX10 part :)