Quote:Original post by LorinAtzberger
Here are some flaws with that design:
Rotation and scale are kept with yeah image in the so called scene. If I have 100.000 images in the scene (not necesarrly on screen) it adds some memory usage.
So how were you planning to keep track of rotation and scale for individual sprites?
Quote:Morehowever this mean that the transformation matrix is automatically calculated for each image in the scene.
That's an implementation detail. You could, of course, provide a more restricted, optimized version of that Image class (I'll call it Sprite - an object that contains a position and that references image data).
Quote:From my point of view there is not "scene" it's a useless ambigous term that each game needs in a unique way. You load a image into the memory and if you want to draw it 5 times you just call DrawImage 5 times.
Or you create 5 Sprite objects - that keep track of position, rotation, scale, alpha, color, and whatever else that would be useful - and tuck them under the current scene. You're going to have to 'configure' those draw calls anyway, so why not automate it?
Quote:What you are saying is some sort of persistent image which in many ways is not the right thing to do since it screws up flexibility a lot. The so called action system also kills flexibility.
Well, your approach is definitely more tedious to work with, due to all the things I'd have to keep track of manually. How exactly would issch's approach kill flexibility?
One thing that I value greatly in engines/frameworks/libraries is ease of use. Flexibility is good for when I need it, but should ideally not be forced upon me when I don't need it.
As for your custom image format, does your engine also support 'standard' formats, such as .png, .jpg, .bmp, .tga?