Advertisement Jump to content
Sign in to follow this  

SlimDX and C# completely stuck

This topic is 3014 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there,

I've been bashing my head against SlimDX for some time, but I'm completely stuck. I worked of the tutorials on the SlimDX site itself and searched for quite the hours. What I want to do is pretty simple (using C#):

-Have a form with a menu, where i can choose to load a SOF model file.
-When I have selected the model file, the form displays the model from a certain angle.
- Eventually, take a snapshot from the projection of the model.

The problem I seem to get is that if I use the pump, configuration and draw methods in the constructor, I can get the default model on the screen (the triangle from the tutorial), but my menu and my option to load wil be gone.

If I however try to put the draw and configuration methods in another method, which I call after loading the SOF file, I will only get the cleared background (soothing blue as they say in the tutorial), and it will not redraw when resizing (since the draw methods are not in the pump but in another method only called during load).

I'm completely lost on how I should approach this, and any advice would be extremely welcome. Thanks!

Share this post

Link to post
Share on other sites
The problem is you want to support interaction between D3D and GDI / Win32, which is complex. The best way to handle this in a Windows Forms application is to set up the canonical ApplicationIdle/PeekMessage loop in your form (or elsewhere if you have multiple forms) and in every tick of the 'still idle' loop, draw a frame. Make sure you set up your device with a handle that does not overlap with the area that the menu bar (or other GDI controls) would be drawn or you can have airspace issues.

[Edited by - jpetrie on October 21, 2010 11:07:46 AM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!