Sign in to follow this  

[SlimDX] Resize window - Objects gone

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

This topic is 3313 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this