iuzunok Posted October 21, 2010 Posted October 21, 2010 (edited) Re: C# - Drawing an image (sprite) with Direct3D Split from http://www.xtremedotnettalk.com/showthread.php?t=92593 Note: Please do not reply in old threads. You may create a new thread with a link to the old thread if necessary. hi everybody 1) i try to code game 2D program using c# and directx i creat a sprite and it move on screet it is fine (frame rate about 60 fps) but i try to add more sprite it getting slower (frame rate about 2,3 fps up to sprite count) i load sprite image with texture object and draw it sprite.Draw(texture ... 2) which file format is faster i use png in project thaks a lot Edited October 21, 2010 by snarfblam Quote
Leaders snarfblam Posted October 21, 2010 Leaders Posted October 21, 2010 Re: C# - Drawing an image (sprite) with Direct3D We can't identify what is wrong with your code based only on knowing that it is running slowly. I recommend you post the code that is run each frame. I wouldn't worry about which file format is faster. The texture should only be loaded once, either when the program starts or when it is first needed. Once a texture is loaded, it is stored as a texture, not a PNG, BMP, or whatever. So unless you are experiencing an extraordinarily long load time when the program starts, I wouldn't worry about which format loads the fastest. Quote [sIGPIC]e[/sIGPIC]
iuzunok Posted October 22, 2010 Author Posted October 22, 2010 Re: C# - Drawing an image (sprite) with Direct3D We can't identify what is wrong with your code based only on knowing that it is running slowly. I recommend you post the code that is run each frame. I wouldn't worry about which file format is faster. The texture should only be loaded once, either when the program starts or when it is first needed. Once a texture is loaded, it is stored as a texture, not a PNG, BMP, or whatever. So unless you are experiencing an extraordinarily long load time when the program starts, I wouldn't worry about which format loads the fastest. thank i actualy dispose the texture when i show it on screen for every image my i use one texture? for animate hero move my i use 4 texture (4 diff position)? texture1 = posti1 texture2 = posti2 texture3 = posti3 texture4 = posti4 Quote
Leade Posted April 1, 2011 Posted April 1, 2011 Re: C# - Drawing an image (sprite) with Direct3D do not dispose the texture as that releases its resources and will need to be reloaded again, if you know you will be using the sprites allot, there is no need to dispose them. if you have already solved it, sorry for posting to an old thread. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.