Jump to content
  • Advertisement
Sign in to follow this  
Scoregraphic

[SlimDX] Resize window - Objects gone

This topic is 3619 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

Hey guys! I just discovered the SlimDX library and it looks pretty cool. I also like the SampleFramework which comes aside. But nevertheless, I have a first problem with it. If i resize my window, the device is reset and recreated. I used the architecture from the SampleFramework for this task, which calls UnloadContent and LoadContent during this task. Here are my overrides of these functions:
protected override void LoadContent()
{
    base.LoadContent();
    player = new Player(Color.Red);
    Components.Add(player);
}

protected override void UnloadContent()
{
    base.UnloadContent();
    Components.Remove(player);
    player.Dispose();
    player = null;
}


In the constructor of the player, a VertexBuffer is created and filled with vertex data.
buffer = new VertexBuffer(deviceManager.Direct3D9.Device, vertices.Length * PositionColoredTextured.SizeInBytes,
    Usage.WriteOnly, PositionColoredTextured.Format, Pool.Default);


This creation method works for the first time until I resize the window. After this very moment, the object is no longer drawn on the screen, but the Object is located in the ObjectTable. DX Debug runtimes don't give me any more information, as no error occurs there. So the question is...where does the object go? Btw...I don't adjust the projection/view/world-matrices in any way, so things should look stretched (as they do while resizing the window (until I release the mouse button). Any help is appreciated. Thank you. Scoregraphic

Share this post


Link to post
Share on other sites
Advertisement
Argh...I'm too damn stupid! I forgot to set RenderStates after recreation of the device. So the result was that the object never was visible when rendering.

Someone may close this issue. Thanks.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!