-
Loadfromfile or not?
Mostly, I'm interested in opinions for owner drawn controls and skins. Which method, MakeIntresource or loading directly is best? I like using intresource since you don't need to worry about graphics being removed from folders, being edited or deleted, though how wise is it to pack all of the graphics inside an executable? Speed wise, I can't detect any difference (at least nothing noticeable by the naked eye).
-
I don't think there is a difference. But if there is, it's so trivial, that you don't need to worry about it, as you are only loading them once. (I think) If there is a difference, loading from resources is probably faster.
If you are worried about size, you could try stuffing your bitmaps in a resource-only DLL, and load them from there. But putting them in the executable is the best option. (unless you have a file size limit, use the DLL)
-
Thanks for your opinion, Yarin. With the textures packed with the executable it's only 3mbs, so it isn't all that large. I was mostly curious to see if there were some performance issues to consider.
-
As long as you handle load fails (null handles etc) you should not have a problem either way.
I tend to use load from resource, so the images can not be removed / replaced / resized.
-
I'd think including them as resources would be better performance wise than including them as files, since it's almost always faster to access data in memory than it is to access it on disk.
as far as I know, Windows versions < Vista lack I/O prioritization, meaning that by avoiding heavy disk operations you'll also be ensuring efficient operation on all versions of Windows.
http://www.microsoft.com/whdc/Driver/priorityio.mspx
-
Thanks again, I appreciate the opinions. Looks like I'll go with loading from resources.