| |
| |
| |
|
Comments:
<0> Alright, I need help with resource management in manged direct x. If anyone has the time to help me I would appreciate any ***istance. <1> if you just ask your question someone might be able to answer it? <0> Well I'm trying to stop my device from leaking memory. It's not getting rid of the objects I've created. I've read up on it and you can turn off the event handlers that automatically are added to the device. The problem is that I've made a semi-complex program completely ignorant to this fact. I don't know which way is best to solve this. <0> I've tried to implement the IDisposable on the DirectX resources, however, I'm still leaking memory. I'm just doing my best to get rid of everything I have, but it is not working.
<0> So I thought a solution would be to just destroy and recreate the "view" cl*** that I'm using. To let the GC call dispose on the DirectX device so that it will clean up its own resources, but for some reason that doesn't appear to be working either. <0> Is there another way than to implement IDisposable and just hope that I get all the resources disposed? Is there another reference to objects that I'm missing in regards to try to kill the whole container object? <1> how can you tell that your device is leaking memory? <0> Well through task manager, when it's running it's not too bad. However, when I perform a load a new set of boat race data and I jump back between a low number of boats, and high number of boats, I can determine that the memory is increasing. <1> hmm.. i thought it should be able to handle it itself.. (be aware that task manager isnt a reliable way of measuring memory usage) <0> Yeah, but it's very consistant in regards to the memory increases <1> but i have only very basic knowledge of managed dx so i'm afraid i can't help you. <0> Well I appreciate your ***istance. <1> good night <2> Ello <2> I'm trying to pull RGBA out of a texture. I'm trying IDirect3DTexture9::LockRect atm, but not completely sure about the usage after I've done so. <3> you can access the memory from the pointer you get in D3DLOCKED_RECT <3> just remember to use the pitch you get as well, to get correct width offsets when you access it <3> and of course IDirect3DTexture9::UnlockRect when you're done
<3> its probably useful to make a struct holding the RGBA components, and cast the pointer to that type <3> just remember take the size into account when using the pitch <3> *taking <2> The pitch is in bits right? <2> Or perhaps I don't completely understand what the pitch is all about. <2> Ahh, bytes per row.. <2> Still not posotive on how it fits in though. <3> struct rgba{unsigned char r,g,b,a;};rgba* p=(rgba*)d3dlocked.pBits;unsigned int NewPitch=d3dlocked.Pitch/sizeof(rgba);rgba[y*NewPitch+x].r=255; <3> for example :P <3> will set the r component at x,y equal 255 <3> err <3> p[y*NewPitch+x].r=255; of course <2> Ahh <2> THanks m8 <3> np
Return to
#directx or Go to some related
logs:
python tunnelling #politics #goal #computers #politics unable to load firmware FC5 #nhl Bush Gorbachew #mirc #openbsd
|
|