Jump to content
  • Advertisement
Sign in to follow this  
samv

[SlimDX] Why is AvailableTextureMemory signed?

This topic is 3465 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 guess this is just a minor question of style, but is there a specific reason that SlimDX.Direct3D9.Device.AvailableTextureMemory is of a signed instead of an unsigned type? (The API it's based on, IDirect3DDevice9::GetAvailableTextureMem, is of type UINT and in practice can return values larger than 2147483647.)

Share this post


Link to post
Share on other sites
Advertisement
Unsigned types aren't really part of the underlying type system and so not all languages can consume them correctly (in theory). Why they didn't force them as part of the spec, I don't know exactly, but basically you can't be a CLS compliant assembly if you expose unsigned stuff. We try to stick to the rules where possible and let clients convert to unsigned as necessary.

Share this post


Link to post
Share on other sites
Unsigned types are not part of the CLS, because the CLS was designed to be as broadly applicable as possible, and not all languages have support for unsigned types. In theory languages that do have them could represent them differently, but I don't think that's a huge concern since actual types consumed by the underlying runtime are not necessarily the same types as those exposed by the runtime (CIL only understands 32 and 64 bit integers, "native" (e.g., unspecified) format floats and unsigned values, object references, and references to within an object, et cetera.

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!