• Advertisement
Sign in to follow this  

[SlimDx]Write half variable into a file

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

Hi i am trying to write a half variable into a file with a binarywriter in visualbasic but when i do it the binarywriter writes into the file four bytes.Are there any other method to write halfs into files?

Share this post


Link to post
Share on other sites
Advertisement
There isn't any way at the moment. Half support is meant only for use in vertex declarations, as an optimization. There isn't much reason to avoid writing out four bytes when dealing with disk space.

On the other hand, if you think you really need it, you're free to modify the source to make the internal UInt16 value available for you to write out.

Share this post


Link to post
Share on other sites
Quote:
Original post by Mike.Popoloski
There isn't any way at the moment. Half support is meant only for use in vertex declarations, as an optimization. There isn't much reason to avoid writing out four bytes when dealing with disk space.

On the other hand, if you think you really need it, you're free to modify the source to make the internal UInt16 value available for you to write out.




I was thinking that way, put the bits of the half into an int16, but i don´t know how could i do that

Share this post


Link to post
Share on other sites
It's already done; that's how it's stored internally. If you do a check-out of the source and look in source/math/Half.h, you'll see that there's a UInt16 holding the value, it's just marked private. Make it public and you'll be able to use it.

Share this post


Link to post
Share on other sites
Quote:
Original post by Mike.Popoloski
It's already done; that's how it's stored internally. If you do a check-out of the source and look in source/math/Half.h, you'll see that there's a UInt16 holding the value, it's just marked private. Make it public and you'll be able to use it.


i am using the SlimDx dll, have i do that in the code and then build a new dll or can i make it using only the dll?

Share this post


Link to post
Share on other sites
Quote:
Original post by Mike.Popoloski
It's already done; that's how it's stored internally. If you do a check-out of the source and look in source/math/Half.h, you'll see that there's a UInt16 holding the value, it's just marked private. Make it public and you'll be able to use it.


in the folder of slimdx i don´t have that, i have to look in the directx sdk?

Share this post


Link to post
Share on other sites
Quote:
Original post by Mike.Popoloski
It's already done; that's how it's stored internally. If you do a check-out of the source and look in source/math/Half.h, you'll see that there's a UInt16 holding the value, it's just marked private. Make it public and you'll be able to use it.


Please anyone coul tell where is that directory source/math/Half.h?Or where could i downnload it?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement