Sign in to follow this  

[SlimDX] Weird/Unused code in SimpleModel example?

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

I've been messing around a bit with SlimDX lately, and a weird piece of code in the SimpleModel (DX10) example caught my eye:


var rt = new Texture2D(device, new Texture2DDescription
{
ArraySize = 1,
BindFlags = BindFlags.RenderTarget | BindFlags.ShaderResource,
CpuAccessFlags = CpuAccessFlags.None,
Format = Format.R8G8B8A8_UNorm,
Height = 128,
Width = 128,
MipLevels = 1,
OptionFlags = ResourceOptionFlags.None,
SampleDescription = new SampleDescription(1, 0),
Usage = ResourceUsage.Default
});

var dxgiSurface = rt.AsSurface();

rt.Dispose();
dxgiSurface.Dispose();


This code is present in the SimpleModel constructor, the example compiles and runs fine if I remove it. It looks like it just creates a texture and surface and then disposes them.

Share this post


Link to post
Share on other sites

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