I'm going to add support for static images that are displayed with a rotation. This involves:
* StaticImage::setRotation(float) new function
* RenderableElement::draw() with extra rotation argument
* RenderableElement::draw_impl() with extra rotation argument
* Image::draw() with extra rotation argument
* ImageSet::draw() with extra rotation argument
* Renderer::addQuad() with extra rotation argument
* Rect helper function to get rotated corner points
* D3D9 render to support rotated quads
This is a big list of lots of small changes! Also, I'm only going to support the renderer I actually use, but if others are interested I'm hoping we can get this supported across the board.
The actual guts of it is simple, instead of rendering a quad with the rect's TL/TR/BL/BR, you ask the rect to give you 4 corner points for a given rotation value. Clipping is more problematic, since you wouldn't be rendering simple quads anymore (I'm not going to worry about it for now).
Another point is that this indirection is a maintenance headache, so it might be better to pass a DrawInfo struct around, which can have arguments added in a nicer way. However, I probably wont do this, as its just making a large change even larger.
Rotating Images
Moderators: CEGUI MVP, CEGUI Team
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: Rotating Images
I think this sounds like a great feature...
spinning icons would be cool
As I see it, clipping is'nt that big a problem. The feature is so specialized that the widgets using it could easily calculate bounding rects, and I don't think true diagonal clipping will be needed!
spinning icons would be cool
As I see it, clipping is'nt that big a problem. The feature is so specialized that the widgets using it could easily calculate bounding rects, and I don't think true diagonal clipping will be needed!
Re: Rotating Images
I've done the change and it works fine. I'm not sure what to do about a patch file though - I've made one up, however my d3d renderer has lots of extra code in there (I've been experimenting with a custom stl allocator for the quadlist), so that class is a bit of a mess.
If anybody is interested I can submit the patch anyway, and anyone who wants to use will have to remove the extra stl allocator class in d3drenderer after applying the patch. Alternatively, I could try snipping those changes out of the patch file, but I've probably invalidate the file since its all interwoven there.
If anybody is interested I can submit the patch anyway, and anyone who wants to use will have to remove the extra stl allocator class in d3drenderer after applying the patch. Alternatively, I could try snipping those changes out of the patch file, but I've probably invalidate the file since its all interwoven there.
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: Rotating Images
why dont you just get a fresh copy from CVS.
apply the changes there and make the patch?
apply the changes there and make the patch?
Re: Rotating Images
Yeah that would work.
Mainly because its done now, and my first priority is to get the gui working as I need for my project. As such I have made lots of changes which make it easier for myself but aren't a good idea in general.
As such I don't really want to get a clean copy of cvs, make changes there, submit a clean patch, and then somehow merge it in with my other changes.
Anyway, I put the patch up (changes plus d3d9 mess), but I don't know what use it will be.
Mainly because its done now, and my first priority is to get the gui working as I need for my project. As such I have made lots of changes which make it easier for myself but aren't a good idea in general.
As such I don't really want to get a clean copy of cvs, make changes there, submit a clean patch, and then somehow merge it in with my other changes.
Anyway, I put the patch up (changes plus d3d9 mess), but I don't know what use it will be.
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: Rotating Images
I took it back!
Re: Rotating Images
Well ok! However I agree that a patch with the extra code is a bit useless. If I have some time (which I don't, at the moment), I can clean it up and resubmit it.
Note that I think a custom allocator for the d3d9 renderer is a good idea, it just needs some cleaning up.
Note that I think a custom allocator for the d3d9 renderer is a good idea, it just needs some cleaning up.
- tgraupmann
- Quite a regular
- Posts: 78
- Joined: Thu Aug 18, 2005 00:47
- Contact:
Re: Rotating Images
Does StaticImage rotation work yet?
Re: Rotating Images
I did the changes to a clean copy from cvs and submitted a new patch, that was a few months ago.
It hasn't been merged in by the team, and Falagard has quite a few changes so it may be end up being problematic for them to do so, I'm not sure. However the patch file is there if anybody wants to use it.
It hasn't been merged in by the team, and Falagard has quite a few changes so it may be end up being problematic for them to do so, I'm not sure. However the patch file is there if anybody wants to use it.
Return to “CEGUI Library Development Discussion”
Who is online
Users browsing this forum: No registered users and 0 guests