Sign in to follow this  
DrGUI

[.net] ref 0 as a structure?

Recommended Posts

DirectX uses that in D3DX's TextureLoader class, for the ref ImageInformation parameter, in a few of the overloads for FromFile. Of course, I realize that they do not want to duplicate the code, but I was unable to get 'ref ((Direct3D.ImageInformation) ref 0)' to compile. I got that code from Lutz Roeder's Reflector, a .net decompiler. I do not believe that section of code to be unsafe, but I wouldn't bet my life on it. Shall I just create a new (empty) structure and pass that in? I do not especially want to double my overloads for my texture restoration system. Thanks in advance!

Share this post


Link to post
Share on other sites
Quote:
Original post by RenZimE
actualy it looks to me like the lutz decompiler didnt interpret the ILasm so i dont think it would compile at all.

It seems to work on everything else.
It definately works on my code and when I tried it on Direct3DX it certainly produced logical output.
Of course, it could be a flaw. Can't expect everything to be 1200% perfect.

Share this post


Link to post
Share on other sites

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