well, i've been browsing directx help file and I really am grasping at straws. I'm just guessing at all the code im writing and dunno if i make it work wether it will actually do what I want
I've taken a blind guess and got IDirect3DDevice9::UpdateSurface() as the most likely function of use. Its description is:
Copies rectangular subsets of pixels from one surface to another.
It takes two RECT objects to say which pixels to copy to where.
So what i'm intending is if a sprite is set to a region, then to grab its surface pointer, basically make a new image using directx commands and then fill my new image with the old ones pixels but calculate the rect to copy by taking into account the region boundaries, thus clipping it. At least thats the idea >>;
I've been guessing my way through ALL the code I have written so im obviously making a stupid mistake (years of programming experiance and alot of that is c/c++, but i have NEVER used directX before) and im getting a nice crash atm trying to get a pointer to the surface of a darkbasic sprite. Im using alot of internal darksdk commands that arnt documented, so bare with me if im fouling it up stupidly.
The line my program hangs on (some sort of memory leak i think) is: darksprite->GetSurfaceLevel(0, darksurface);
which i was hoping would copy the surface of the db Sprite to my own little surface pointer so i can use updatesurface to read from it.
All my code is attached, its obvious incomplete without any code to do the clipping yet, but you should see where I was trying to take it.
Can anyone explain to me how I can use these commands properly to do what I want? Or is my whole idea of using UpdateSurface() to copy calculated rectangles not going to work because i either miss understood the command completly or im just plain stupid?
Please help me out here, I feel all cold and alone with directX...
Thanks in advance.
[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol