Hi folks,

Currently, Shadows on fgfs Mac OS X 0.9.10 are disabled regardless of  
the option values.
What causes this issue is that SimGear doesn't properly recognize  
OpenGL extensions and AlphaBits/StencilBits
at SGShadowVolume::init() in ShadowVolume.cxx.

I managed to find a workaround for this but I'm not sure if it is a  
good way, so I need your help.

When I force this method recognize AlphaBits and extensions as OpenGL  
profiler says, FlightGear start drawing shadows.
This means it is not ready to check the capabilities at the time  
SGShadowVolume::init() is called on Macs.
So, I decided to call SGShadowVolume::init() when it is ready.
The candidates methods are ShadowVolume::SetupShadows() and  
ShadowVolume::endOfFrame().

I'm trying to inserted the following code to the beginning of one of  
these functions,
As far as I've tested, it apparently works fine in both cases.

#ifdef __APPLE__
        // At the time SGShadowVolume is called, OpenGL extensions and
        // AlphaBits/StencilBits are not properly recognized on Macs.
        // so I simply re-initialize it when this method is called for the  
first time
        static bool re_initialized = false;
        if (!re_initialized) {
                this->init(sim_rendering);
                re_initialized = true;
        }
#endif

So here are the questions.
Am I calling ShadowVolume::init() at an "acceptable" timing?
Are there any better means of doing this?

I know this is not the best way, but it is seems hard to make  
SGShadowVolume::init() works as it's supposed to be
without making a big change, which I don't want to do at this moment.

Thanks,

Tat

-------------------------------------------
Tatsuhiro Nishioka
Mail: [EMAIL PROTECTED]
-------------------------------------------




-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to