Re: [GD-General] Was: FreeType
Brought to you by:
vexxed72
|
From: <bac...@ke...> - 2006-01-07 22:33:24
|
Sorry for my bad english... As I read this thread, I started thinking
about rewriting our text render engine... We render a lot of text, but
never though about rendering words instead of characters... at this
point, every Object in the game calls the render engine throu 2
functions: renderText, invalidateBuffer ... every time, something
changes, the invalidateBuffer function called, and only one flag for the
Object set... when the rendering starts, the window system starts
searching for visible objet.
At this point it's a little complicated so I go pseudo code :)
window system prerender loop:
for all objects
if(visible(object))
render->renderText(chache);
window system render loop:
for all objects
if(visible(object))
render->renderText(nochache);
renderText(cache)
if(cache)
{
if(!invalidbuffer)
{
cachebuffer(buffer);
}else
{
renderDataToBuffer();
}
}else
{
renderBuffer(buffer);
}
this way, if a text is unchanged, we have an
optimised(tristripped)vertex array, with some special attributes, to be
able to render a text with different fonts... but the idea is if we
render the text with colors, sizes, etc... to a buffer, and the text is
usually unchanged between frames, the only thing happening with the
graphics pipeline, is one call, wich copy's the buffer to the video card
memory, and if we know, the buffer will not change, we can even bind the
buffer up to the card...
My question is, can the render words algorithm be faster in the real
world, and more usable for a game, then our buffer algorithm? My problem
is when your text does not fit in a 2048x2048 texturemap... then you
have to store more than one texturemap, and switch between them... I
think while we are using windows :*((( cause the cost of the render
calls, we have to minimalize the calls made to the videocard...
What do you think about it?
Peter Balogh
bac...@ne...
Cheaf Programmer
Complete IT Bt.
Hungary
, and calls the renderText, with parameters to try to prechache the buffers
Brian Hook wrote:
> that's pretty interesting looking, but realistically I would probably
> be able to get the FT2 font renderer extension working faster than I
> could sort out FT2 and ctypes, particularly with all the structs and
> what not that FT2 brandishes.
>
> Brian
>
> On Wed, 4 Jan 2006 21:10:45 -0800, Nick Trout wrote:
>
>>>PyGame.Font rendering when it's not available (or until I get off
>>>my ass and write the same thing I just did for Windows for FT2 in
>>>C).
>>>
>>
>>Ft2.dll + ctypes ?
>
>
>>http://starship.python.net/crew/theller/ctypes/tutorial.html
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
> _______________________________________________
> Gamedevlists-general mailing list
> Gam...@li...
> https://lists.sourceforge.net/lists/listinfo/gamedevlists-general
> Archives:
> http://sourceforge.net/mailarchive/forum.php?forum_idU7
>
>
|