Jump to content
  • Advertisement
Sign in to follow this  
Programmer16

Optimizing my 2D drawing library

This topic is 4895 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

A couple of weeks ago I started working on a 2D library and I've almost finished it. I know that I shouldn't optimize prematurely, but I plan on using this library in a lot of future projects and releasing it for others to use. My question is, would the data manipulation code be much faster if I programmed it in assembly? I won't be locking memory or anything of that sort, I just have an array of data that I either create or load from a file. I then manipulate it. After that I can copy it to a texture for rendering An example of usage is my GUI. I load the GUI skin into surface A, and create a surface/texture(B & C) combo (A is CDataSurface, B is CDataSurface, and C is IDirect3DTexture9*.) Then I copy parts from A to B, then all of B to C. Then I render C.

Share this post


Link to post
Share on other sites
Advertisement
For something that you'll be releasing to others, it's almost imperative that you use a profiler of some sort. A profiler lets you see which sections of your code run the slowest, so you can know where and how to optimize. It can be built in to your library and surrounded by "#ifdef _DEBUG / #endif"'s, or external. I recommend internal.

In this case, running the profiler will probably tell you that this section of your library uses some of the least CPU time as compared to others.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!