This project is read-only.

GetData() not working

Jan 17, 2010 at 10:06 AM

Hi!

I'm using the GetData() function in Texture2D for use in Farseer. But when I do so I get an exception saying that GetData() is not implented. Is there any other way of doing the same thing as the GetData() function or do I have to go another way?

Jan 17, 2010 at 11:19 AM

Hi

Well, in short, if it works in XNA for you with this method, it should work in SilverSprite too. Apparently nobody have implemented this method yet, which is why it doesn't work. 

If you are up for it you could implement it in SilverSprite? Just download the source, implement the method and apply it as a patch, then I'll make sure to put it in the source.

For more information about the method: http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.graphics.texture2d.getdata.aspx

I sadly don't have time my self to look into it these days, but maybe some of the other guys on the team have. At least I have now told you how to look into it your self and why it doesn't work for you right now.

Feel free to ask questions :)

Jan 17, 2010 at 3:06 PM

GetData has a lot of combinations because of the generics and the overloads, which data type are you trying to return and which overload are you using?

Jan 17, 2010 at 7:54 PM

I'm using the uint one.

Jan 17, 2010 at 10:15 PM

uint returning the entire texture?

Jan 23, 2010 at 8:22 AM

You could say so it's returning it to an array of the size of the texture. I also found out that I need the color one too.

Anyone know where to find this code, so I can maybe add it?

Jan 23, 2010 at 1:43 PM

Color should work, but I was looking at the code and I don't think it will do the right thing for partially transparent colors. I will fix this and add support for uint but it will be sometime later next week.

Jan 23, 2010 at 6:54 PM
Edited Jan 23, 2010 at 6:56 PM

Thank you very much!

Now I can continue with my game!

Feb 5, 2010 at 4:32 PM
Edited Feb 5, 2010 at 4:32 PM

I've tested a couple of times but it doesn't seem to work yet. But it's probably couse of the partally transparent colours!

Mar 1, 2010 at 2:07 PM

I've checked in a fix for this, but I don't have a good test for it, so please try it out.

Mar 6, 2010 at 9:08 AM

Sorry, but I can't open the project.

Can you please post the compiled version on the site.

Mar 9, 2010 at 4:22 PM

It still doesn't seem to work.

Do you want me to send any code e.t.c.??

Mar 9, 2010 at 7:06 PM

Sure that would be helpful if you have a sample, or if it's small enough you can just post the code here

Mar 14, 2010 at 9:04 AM
Edited Mar 14, 2010 at 9:12 AM

The code is about 500 lines of code so I've put it up here: http://cid-08f85137554dd4cd.skydrive.live.com/browse.aspx/Downhill%20Madness%20Source?nl=1&uc=1&isFromRichUpload=1

Obs! It's not the full code, things like the objects and the LogoHandler is not inside!

EDIT: I've removed unnecessary code from the file and made it "only" 300 lines big.

Mar 26, 2010 at 7:24 AM

If noones answearyng, so where to go from now. Do you want me to comment out the file or what do you mean???

Apr 4, 2010 at 6:01 PM

Can you give me a little more to go on than "it doesn't work", I looked at your code and it looks like you're just getting all of the data as an array of Color, are the colors wrong, in the worng positions, or does it give you an error?

Apr 7, 2010 at 7:26 AM

Sorry, but it seems as VWDExpress didn't really change the assembly when I changed it to a newer version. It works now after I deleted the web version and made a new one.

Thanks for your replys!