PDA

View Full Version : Why does reloading the TDirectDrawSurface doesnt work?



TheReanimator
10-02-2009, 05:34 PM
Ok, when you load a images to the TDirectDrawSurface the first time every thing works, but when you reload the same object with a new image the old image does not change but the width and height of the a new image is loaded? anyways is there a workarround? or maybe i could you something else?

User137
10-02-2009, 10:34 PM
Haven't followed latest DelphiX versions but i think surface uses texture in video memory now. Maybe there was a Refresh/Repaint or some other function you need to call for surface. If that fails, free current and create a new instead?

jdarling
10-02-2009, 11:01 PM
DelphiX hasn't been officially supported for years. I'm not going to go on the rant about the why's/if's and etc...

Instead you might want to look at one of the following libraries or other libraries on the market:

http://andorra.sourceforge.net/
http://www.phoenixlib.net/
http://www.afterwarp.net/forum/

TheReanimator
11-02-2009, 03:04 PM
Well yeah i kinda did about 40% of the project which is a lot! and changin libraries doesnt fell right... and about that creation and freeing i had already tried that... it gets bugged after 20 or more times... abyways every thing gets redrawed on the timer event so crating and detroing object per 1ms does not sound well...

User137
12-02-2009, 01:52 PM
I see.. changing texture should never be done in timer because its very very slow but it should work infinite times unless DelphiX bugs. Maybe there's another solution we might find (in theory) if knowing what it should draw? :)