Page 1 of 2
Building an SDL renderer
Posted: Sun Jan 02, 2005 12:01
by CrazyEddie
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.
Re: Building an SDL renderer
Posted: Sat Feb 12, 2005 18:15
by pclouds
How's it going? Is there any source to try with SDL renderer?
Re: Building an SDL renderer
Posted: Sat Feb 12, 2005 20:42
by CrazyEddie
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.
Re: Building an SDL renderer
Posted: Sat Apr 23, 2005 16:01
by Valcar
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.
Re: Building an SDL renderer
Posted: Wed Apr 27, 2005 16:39
by lindquist
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
Re: Building an SDL renderer
Posted: Wed Apr 27, 2005 16:43
by lindquist
for those interested, here's my renderQuad function:
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
Re: Building an SDL renderer
Posted: Wed Apr 27, 2005 23:53
by lindquist
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 ???
Re: Building an SDL renderer
Posted: Tue May 03, 2005 21:30
by florian
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
Re: Building an SDL renderer
Posted: Thu May 05, 2005 12:24
by lindquist
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!
Re: Building an SDL renderer
Posted: Sat Jun 18, 2005 07:28
by florian
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
Re: Building an SDL renderer
Posted: Wed Jun 22, 2005 07:53
by jendave
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
Posted: Mon May 21, 2007 13:57
by jeff2050
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?
Posted: Tue May 29, 2007 09:46
by fiammy
I would be interested to have a look at the 80% finished renderer, as a template to try to work on an Allegro renderer.
I did some efforts in the past, but I was unsuccesfull. Hence, having a look at a renderer for a similar library might be interesting.