[GRASS-SVN] r72966 - in grass/trunk: include lib/nviz

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jul 8 12:51:27 PDT 2018


Author: hcho
Date: 2018-07-08 12:51:27 -0700 (Sun, 08 Jul 2018)
New Revision: 72966

Modified:
   grass/trunk/include/nviz.h
   grass/trunk/lib/nviz/render.c
Log:
nviz: Add width & height to render_window struct; Make sure to set the viewport on renderer initialization

Modified: grass/trunk/include/nviz.h
===================================================================
--- grass/trunk/include/nviz.h	2018-07-08 18:37:14 UTC (rev 72965)
+++ grass/trunk/include/nviz.h	2018-07-08 19:51:27 UTC (rev 72966)
@@ -136,6 +136,7 @@
     HGLRC contextId;		/* rendering context */
     HBITMAP bitmapId;
 #endif
+    int width, height;
 };
 
 #include <grass/defs/nviz.h>

Modified: grass/trunk/lib/nviz/render.c
===================================================================
--- grass/trunk/lib/nviz/render.c	2018-07-08 18:37:14 UTC (rev 72965)
+++ grass/trunk/lib/nviz/render.c	2018-07-08 19:51:27 UTC (rev 72966)
@@ -52,6 +52,9 @@
     rwin->contextId = NULL;
     rwin->bitmapId = NULL;
 #endif
+
+    rwin->width = 0;
+    rwin->height = 0;
 }
 
 /*!
@@ -174,6 +177,10 @@
     rwin->contextId = wglCreateContext(rwin->displayId);
     /* TODO */
 #endif
+
+    rwin->width = width;
+    rwin->height = height;
+
     return 0;
 }
 
@@ -211,5 +218,7 @@
     wglMakeCurrent(rwin->displayId, rwin->contextId);
 #endif
 
+    GS_set_viewport(0, rwin->width, 0, rwin->height);
+
     return 1;
 }



More information about the grass-commit mailing list