Jump to content
  • Advertisement
Sign in to follow this  
thr

[SlimDX] Weird/Unused code in SimpleModel example?

This topic is 2767 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
Advertisement
Hah yeah, I remember seeing that when I started out on SlimDX. Puzzled me for a few moments until I just deleted it myself :)

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!