X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fscene%2Fsky%2Fbbcache.cxx;h=66b272750fc990337d0ac9cda689b1c0dec6bffd;hb=c7cbb22667c901e6107dd099e02e9506f9fbd360;hp=da84fbce25857432e0638e1f1408b58c7f0a2136;hpb=7b5d49ef60733314a280b766a34f9ca448b956f6;p=simgear.git diff --git a/simgear/scene/sky/bbcache.cxx b/simgear/scene/sky/bbcache.cxx index da84fbce..66b27275 100644 --- a/simgear/scene/sky/bbcache.cxx +++ b/simgear/scene/sky/bbcache.cxx @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // @@ -28,10 +28,9 @@ #include #include -#include #include #include -#include SG_GLU_H +#include #include "bbcache.hxx" @@ -91,29 +90,35 @@ bool SGBbCache::allocTextureMemory(int cacheCount, int textureDimension) { SGBbCache::SGBbCache(void) : bbListCount(0), - cacheSizeKb(0), textureWH(0), + cacheSizeKb(0), builtBBCount(0), + frameNumber(0), rt(0), rtAvailable(false), - frameNumber(0), maxImpostorRegenFrame(20) { } SGBbCache::~SGBbCache(void) { - if(rt) - delete rt; + delete rt; freeTextureMemory(); } void SGBbCache::init(int cacheCount) { + GLint colorBits = 0; + glGetIntegerv( GL_BLUE_BITS, &colorBits ); rt = new RenderTexture(); // don't use default rtt on nvidia/win because of poor performance of glCopyTexSubImage2D // wihtout default pattrib params - see opengl forum - rt->Reset("rgba tex2D ctt"); + if( colorBits < 8 ) + rt->Reset("rgba=5,5,5,1 ctt"); + else + rt->Reset("rgba ctt"); + +// rt->Reset("rgba tex2D ctt"); // rt->Reset("rgba tex2D"); if( rt->Initialize(256, 256, true) ) { SG_LOG(SG_ALL, SG_INFO, "bbcache:Initialize sucessfull");