Hi,
I don't have much experience with SDL, so am not able to advise on specifics. The approach of having the renderer dependant upon a theme (or themes) is certainly possible, although you would lose a lot of flexabiliy by having such a coupling.
You may be able to use some external stretching routines, there are, I believe, such extensions already available; though I'm not 100% certain about how these integrate with things.
With regards to the forum registration issue; first try deleting your sourceforge.net cookies (especially the one named 'username') and trying the registration again. If it still does not work, email me your requested username, email address, and a temporary password, and I'll set the account up for you manually.
Building an SDL renderer
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Building an SDL renderer
How's it going? Is there any source to try with SDL renderer?
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Building an SDL renderer
Not specifically, as I have not seen an SDL renderer to test
The important parts of the demos are renderer and OS neutral, so should be fairly simple to translate to another renderer...
The only bits that change are app initialisation and closedown, and the method used to feed inputs into the system. Once the required renderer object and CEGUI::System objects are created, everything else CEGUI related is the same for all renderers.
CE.
The important parts of the demos are renderer and OS neutral, so should be fairly simple to translate to another renderer...
The only bits that change are app initialisation and closedown, and the method used to feed inputs into the system. Once the required renderer object and CEGUI::System objects are created, everything else CEGUI related is the same for all renderers.
CE.
Re: Building an SDL renderer
I've spent the past few hours building an SDL renderer to use with CEGUI.
I spent the last two days trying to do the same thing...
After initial issues with getting coordinates as uv 0..1 range I have a basic system working, although I do get a few glitches.
Yep, having this difficulty myself.
There seems to be a lack of a good GUI library for SDL (I know, I spent a week searching for one)
Me too, I was about to give up when someone suggested ceGUI. So I took a look at ceGUI and it appears to be able to do exactly what I wanted. Although there is a severe lack of documentation regarding implementation for a '2d renderer'.
Has anyone already solved these problems whilst writing a renderer for some 2d API and would care to share their notes?
I was hoping that I could get my hands on what you've come up with for the sdl renderer, either submit it or post a link somewhere. I'm sure there are a lot of people interested in this.
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: Building an SDL renderer
Hi all.
I thought this sounded like a fun challenge, so I've working on 2D SDL renderer too.
It works pretty well now.
I have two issues that I need solved before this is really useable:
1. the windowslook titlebar does something weird with the right frame image. (my CEGUI has a patch I wrote to fix some scaling issues applied. did I create this bug?)
a screenshot:
but if I move the window so that just 1 pixel or more from the left side is clipped, its fine:
2. theres no support for any colouring. all text is white and all images match the tga's.
Have any of you guys solved any of these issues? as this would push my renderer very much closer to completion
I thought this sounded like a fun challenge, so I've working on 2D SDL renderer too.
It works pretty well now.
I have two issues that I need solved before this is really useable:
1. the windowslook titlebar does something weird with the right frame image. (my CEGUI has a patch I wrote to fix some scaling issues applied. did I create this bug?)
a screenshot:
but if I move the window so that just 1 pixel or more from the left side is clipped, its fine:
2. theres no support for any colouring. all text is white and all images match the tga's.
Have any of you guys solved any of these issues? as this would push my renderer very much closer to completion
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: Building an SDL renderer
for those interested, here's my renderQuad function:
d_shadow is a sw-surface with the same pixelformat and dimension as the screen.
It's ALOT faster this way. and no alpha-blending-stretch issues
Code: Select all
// render a quad directly
void SDLRenderer::renderQuad(QuadInfo* quadinfo)
{
// is stretching needed?
if (quadinfo->src.w!=quadinfo->dst.w || quadinfo->src.h!=quadinfo->dst.h)
{
SDL_SoftStretch(quadinfo->image,&quadinfo->src, d_shadow,&quadinfo->dst);
SDL_BlitSurface(d_shadow,&quadinfo->dst,d_screen,&quadinfo->dst);
return;
}
// not stretching
SDL_BlitSurface(quadinfo->image,&quadinfo->src,d_screen,&quadinfo->dst);
}
d_shadow is a sw-surface with the same pixelformat and dimension as the screen.
It's ALOT faster this way. and no alpha-blending-stretch issues
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: Building an SDL renderer
ok. I made a gradient filler that also does the multiplicative blending needed for colouring the windows.
It's in fixed point math, but it's slow as hell anyway.
currently a fullscreen (640x480) WindowsLook framewindow drops the framerate to <15
I'm not really sure how improve this. My current gui renderer only supports 0xAARRGGBB pixel formats and writing these gradient fillers, stretchers etc. for all pixelformats seems like way too much work.
especially when you have to resort to asm coding to get the performance bareable.
And even MMX optimization would probably not do any good, since CEGUI imagesets (sub-images) could easily defy mem-alignments.
hmm... does anyone have the solution ???
It's in fixed point math, but it's slow as hell anyway.
currently a fullscreen (640x480) WindowsLook framewindow drops the framerate to <15
I'm not really sure how improve this. My current gui renderer only supports 0xAARRGGBB pixel formats and writing these gradient fillers, stretchers etc. for all pixelformats seems like way too much work.
especially when you have to resort to asm coding to get the performance bareable.
And even MMX optimization would probably not do any good, since CEGUI imagesets (sub-images) could easily defy mem-alignments.
hmm... does anyone have the solution ???
Re: Building an SDL renderer
This seems to be the best place to ask this question: Are there any usable SDL renderers for CeGUI currently available?
I am currently trying to write a renderer for the CeGUI# port, unfortunately I have zero experience with 3D engines and thus have real problems converting the coordinates, that get passed to the AddQuad function to something usable on a 2D surface.
I was thinking, that maybe looking at the sourcecode of an existing SDL renderer for the original CeGUI could help. Is there such a thing yet? If yes, can anyone point me to a download location?
Thanks in advance,
Florian
I am currently trying to write a renderer for the CeGUI# port, unfortunately I have zero experience with 3D engines and thus have real problems converting the coordinates, that get passed to the AddQuad function to something usable on a 2D surface.
I was thinking, that maybe looking at the sourcecode of an existing SDL renderer for the original CeGUI could help. Is there such a thing yet? If yes, can anyone point me to a download location?
Thanks in advance,
Florian
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: Building an SDL renderer
unfortunately. no 2D SDL renderer is working at the moment.
And I actually doubt that there ever will be.
But if you want, you can have my 80% finished renderer.
I won't do anything to it - at least not until I get some feedback here.
There's a little demo app in the zip.
Do whatever you want with the code. I don't care!
And I actually doubt that there ever will be.
But if you want, you can have my 80% finished renderer.
I won't do anything to it - at least not until I get some feedback here.
There's a little demo app in the zip.
Do whatever you want with the code. I don't care!
Re: Building an SDL renderer
Thanks for posting your code.
Jendave over at cs-sdl.sourceforge.net rewrote my non-functioning version of the renderer for the C#-Version. Seems there were some things that needed to be added to the SDLDotNet Api to get it working. Perhaps he could tell you how he got his version to work.
Flo
Jendave over at cs-sdl.sourceforge.net rewrote my non-functioning version of the renderer for the C#-Version. Seems there were some things that needed to be added to the SDLDotNet Api to get it working. Perhaps he could tell you how he got his version to work.
Flo
Re: Building an SDL renderer
I took a look at lindquist's version and ported that to C# to get the latest screenshot of CEGUI SDL.NET renderer. The main thing was to create a Stretch method for the Surface. That made things look a lot better. I just got svn access to RealmForge and will be checking in my work so far. I wil l be taking over CEGUI/C# development to some extent over at RealmForge.
Re: Building an SDL renderer
lindquist wrote:unfortunately. no 2D SDL renderer is working at the moment.
And I actually doubt that there ever will be.
But if you want, you can have my 80% finished renderer.
I won't do anything to it - at least not until I get some feedback here.
There's a little demo app in the zip.
Do whatever you want with the code. I don't care!
Where can I get the zip package?
Return to “Offtopic Discussion”
Who is online
Users browsing this forum: No registered users and 2 guests