[mapserver-commits] r10735 - sandbox/mapserver6

svn at osgeo.org svn at osgeo.org
Wed Nov 17 18:21:20 EST 2010


Author: tamas
Date: 2010-11-17 15:21:19 -0800 (Wed, 17 Nov 2010)
New Revision: 10735

Modified:
   sandbox/mapserver6/mapogl.cpp
   sandbox/mapserver6/mapoglcontext.cpp
   sandbox/mapserver6/mapoutput.c
Log:
Couple of adjustments in the OpenGL renderer

Modified: sandbox/mapserver6/mapogl.cpp
===================================================================
--- sandbox/mapserver6/mapogl.cpp	2010-11-17 19:11:00 UTC (rev 10734)
+++ sandbox/mapserver6/mapogl.cpp	2010-11-17 23:21:19 UTC (rev 10735)
@@ -197,7 +197,7 @@
 int msPopulateRendererVTableOGL(rendererVTableObj *renderer) {
 #ifdef USE_OGL
 		renderer->supports_transparent_layers = 1;
-		renderer->supports_pixel_buffer = 0;
+		renderer->supports_pixel_buffer = 1;
 		renderer->supports_clipping = 0;
 		renderer->use_imagecache = 0;
 		renderer->supports_bitmap_fonts = 0;
@@ -224,7 +224,7 @@
 		renderer->transformShape=&msTransformShapeToPixel;
 		renderer->getTruetypeTextBBox = &msGetTruetypeTextBBoxOgl;
         
-		//renderer->getRasterBufferHandle = msGetRasterBufferHandleOgl;
+		renderer->getRasterBufferHandle = msGetRasterBufferHandleOgl;
 		renderer->getRasterBufferCopy = msGetRasterBufferCopyOgl;
 		renderer->initializeRasterBuffer = msInitializeRasterBufferOgl;
 		renderer->mergeRasterBuffer = msMergeRasterBufferOgl;		

Modified: sandbox/mapserver6/mapoglcontext.cpp
===================================================================
--- sandbox/mapserver6/mapoglcontext.cpp	2010-11-17 19:11:00 UTC (rev 10734)
+++ sandbox/mapserver6/mapoglcontext.cpp	2010-11-17 23:21:19 UTC (rev 10735)
@@ -209,11 +209,11 @@
 
 	int pixelFormat;
 	int valid = false;
-	UINT numFormats;
+	UINT numFormats = 0;
 	float fAttributes[] = {0,0};
 	int samples = MAX_MULTISAMPLE_SAMPLES;
 
-	while (!valid && samples >= 0)
+	while ((!valid || numFormats == 0) && samples >= 0)
 	{
 		int iAttributes[] =
 		{
@@ -231,7 +231,7 @@
 		};
 
 		valid = wglChoosePixelFormatARB(window,iAttributes,fAttributes,1,&pixelFormat,&numFormats);
-		if (!valid) samples -= 2;
+		if (!valid || numFormats == 0) samples -= 2;
 	}	
 
 	if(numFormats == 0)

Modified: sandbox/mapserver6/mapoutput.c
===================================================================
--- sandbox/mapserver6/mapoutput.c	2010-11-17 19:11:00 UTC (rev 10734)
+++ sandbox/mapserver6/mapoutput.c	2010-11-17 23:21:19 UTC (rev 10735)
@@ -360,6 +360,11 @@
         msCreateDefaultOutputFormat( map, "CAIRO/SVG" );
 #endif
 
+#if defined(USE_OGL)
+    if( msSelectOutputFormat( map, "oglpng24" ) == NULL )
+        msCreateDefaultOutputFormat( map, "OGL/PNG" );
+#endif 
+
 #if defined(USE_KML)
     if( msSelectOutputFormat( map, "kml" ) == NULL )
         msCreateDefaultOutputFormat( map, "kml" );



More information about the mapserver-commits mailing list