David Haley said: Twisol: I was referring to the fact that you were given a solution but deemed it "overkill". I was asking what about it was unacceptable to you.
Sprite maps work in some instances. Only effectively for static data. I don't know why I said "overkill", I think I was thinking of the effort involved to duplicate the image and rotate it, and the size of the image involved. If you have a very long base image, managing the sprite map would be verrry interesting.
David Haley said: Regarding matrices, I agree that transformations should not be stored on the images themselves. If you look at OpenGL, for instance, that's not how they do it either. You set up transformations, you draw some stuff, you might add more transformations, draw more stuff, etc. But you don't attach a transformation to an image, and then draw the image without knowing about its transformation.
But you do apply a transformation separately from drawing. With OpenGL, it's stored as the transformation matrix of the current context. I -would- like to have a transformation matrix stored with the window itself, but I'm just a little worried about possible confusion. It feels like it could be too easy to think the window itself is stretched/squashed/rotated, rather than the content. ([EDIT] And also easy to think it affects stuff drawn already.)
Hmm... Yeah, storing the matrix with the window would be better.
David Haley said: If you need images to store their own transformation information, such that when rendered they apply it before drawing, then reverse it for subsequent operations, then I would suggest making that a feature of your API, with a sprite object of some sort that stores its own transformation for when it is rendered.
Just to be clear here, you're talking about a sprite map image, where multiple "frames" of a sprite are stored in the same file?
David Haley said: What you said about composing transformations does not appear to be relevant to storing transformations on images -- in fact, as you said, OpenGL composes transformations and this is useful, but it doesn't do it by storing them on images!
I'm not sure why it's not relevant. The same thing happens; the difference is that a different matrix is applied to each image. Now though, I do agree it's better stored with the miniwindow. I realized there would be an annoying problem passing around Images with my API, because when it came time to draw it, I'd have to load the image into the target window and reconstruct the matrix somehow (probably through a hackish WindowImageInfo call). Applying transformations to the window's transformation matrix just works.
David Haley said: If anything, the conclusion of your argument is that there should be an independent transform function that you use to set up a drawing context, not that there should be transformations stored on images.
I figure that each miniwindow would effectively be its own context. I'm not sure when it would be useful to have multiple contexts for the same miniwindow?
David Haley said: I don't really understand the comments about not seeing the resulting image. If you transformed it such that it doesn't appear in the view anymore, don't you expect to not see it? Isn't that exactly the desired behavior?
I can't remember what I said that you're referring to, a quote would be appreciated. But I think(?) I was talking about how the transformation stored with an image isn't applied until the image is actually drawn. Otherwise, I don't know, because I agree with you. |