• Advertisement
Sign in to follow this  

[SlimDX] Weird/Unused code in SimpleModel example?

This topic is 2648 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();


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
Sign in to follow this  

  • Advertisement