[Bf-committers] BGE: Can we have a centralized call KX_KetsjiEngine::OnResize() (please :)

Benoit Bolsee benoit.bolsee at online.be
Wed Feb 4 23:45:39 CET 2009


On Tue, 3 Feb 2009 21:07:39 -0500 Dalai Felinto <dfelinto at gmail.com>
wrote:
> 
> A lot of times I see the need of checking for viewport size 
> changes during BGE code. For example in 
> RAS_2DFilterManager.cpp and in the *wip* Fisheye code. But 
> I'm pretty sure it happens in all functions that rely on the 
> size of the viewport for render purposes.
> 
> I know that checking viewport size changes and getting 
> power-of-2 texture sizes related to that are fast. However I 
> think it would be better (easier to code/maintain) if we 
> could centralize it all in a KX_KetsjiEngine::OnResize() (or 
> any other name).
> 
Can you elaborate a bit on what would KX_KetsjiEngine::OnResize() do and
how it would be called?
If you just want a handy function to compute the largest power-of-2
texture size that fits the viewport, there is a fast algorithm in
VideoTexture (look for calcSize()).
I would of course have no problem to port that code to a centralized
function.

> Does anyone agree/have a problem with that? There is any 
> reason (historical, maybe?) to not have it? Do we already 
> have something like that (i couldn't find it)?
> 
> Cheers,
> Dalai
> 
> http://blenderecia.orgfree.com
> 



More information about the Bf-committers mailing list