]> Pileus Git - grits/blobdiff - src/gis-opengl.c
Document GisOpenGL
[grits] / src / gis-opengl.c
index 08babe50b8617e77365cf45df64e91d5a42160b5..bb2095113d9830d2bc1ad874396b62a946136dea 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-/* Tessellation, "finding intersecting triangles" */
-/* http://research.microsoft.com/pubs/70307/tr-2006-81.pdf */
-/* http://www.opengl.org/wiki/Alpha_Blending */
+/**
+ * SECTION:gis-opengl
+ * @short_description: OpenGL based virtual globe
+ *
+ * #GisOpenGL is the core rendering engine used by libgis. Theoretically other
+ * renderers could be writte, but they have not been. GisOpenGL uses the ROAM
+ * algorithm for updating surface mesh the planet. The only thing GisOpenGL can
+ * actually render on it's own is a wireframe of a sphere.
+ *
+ * GisOpenGL relies on #GtkGlExt and requires (at least) OpenGL 2.0.
+ */
 
 #include <config.h>
 #include <math.h>
 #include "objects/gis-marker.h"
 #include "objects/gis-callback.h"
 
-#define FOV_DIST   2000.0
-#define MPPX(dist) (4*dist/FOV_DIST)
-
 // #define ROAM_DEBUG
 
+/* Tessellation, "finding intersecting triangles" */
+/* http://research.microsoft.com/pubs/70307/tr-2006-81.pdf */
+/* http://www.opengl.org/wiki/Alpha_Blending */
+
 /***********
  * Helpers *
  ***********/
@@ -198,7 +207,7 @@ static void _draw_tiles(GisOpenGL *opengl, GisTile *tile)
 
 static void _draw_marker(GisOpenGL *opengl, GisMarker *marker)
 {
-       GisPoint *point = gis_object_center(GIS_OBJECT(marker));
+       GisPoint *point = gis_object_center(marker);
        gdouble px, py, pz;
        gis_viewer_project(GIS_VIEWER(opengl),
                        point->lat, point->lon, point->elev,
@@ -465,6 +474,15 @@ static gboolean on_idle(GisOpenGL *opengl)
 /*********************
  * GisViewer methods *
  *********************/
+/**
+ * gis_opengl_new:
+ * @plugins: the plugins store to use
+ * @prefs:   the preferences object to use
+ *
+ * Create a new OpenGL renderer.
+ *
+ * Returns: the new #GisOpenGL
+ */
 GisViewer *gis_opengl_new(GisPlugins *plugins, GisPrefs *prefs)
 {
        g_debug("GisOpenGL: new");