Discussion:
DirectX in a UserControl
(too old to reply)
PaulH
2008-08-12 08:48:11 UTC
Permalink
Hi,

I am trying to accomodate myself to DirectX. So I had installed the
Tutorial#3 ("Using Matrices (Managed)") which worked fine: I had the rotating
triangle.

The next step was then to convert that example to make it run in a
UserControl.

Bad luck. The UserControl appears in the window but only the background is
drawn as specified in the device.Clear.

Next try: "Tao" had appearently a very similar problem (Microsoft Direct X
-- Managed Win32 Programming -- Use DirectX in Picturebox (2006-08-29)) and I
tried to solve my problem according to Stephan Rose's post.

No change.

My UserControl is still drawn but only the DirectX background color appears,
no triangle to be seen.

Here's now my (modified) example from the tutorial.
Does anybody have an idea what I am doing wrong? Thanks.
PaulH
2008-08-12 08:56:01 UTC
Permalink
Sorry, missed the link:
http://www.file-upload.net/download-1037879/TestDirectX.zip.html
PaulH
2008-08-13 11:40:02 UTC
Permalink
Identified the problem:

It seems that the vertices were lost before rendering. So I moved the
generation of the vertex buffer and the vertices into function OnResetDevice.

Works now as expected.

PaulH

Loading...