]> Pileus Git - grits/blobdiff - src/roam.c
Remove a lot of callback from GritsOpenGL
[grits] / src / roam.c
index d8bff628b33f939151e1def1c2c1f069a76b17d9..806eb3f64c7d0cadcbbcdbec8608a5862357cd26 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009-2010 Andy Spencer <andy753421@gmail.com>
+ * Copyright (C) 2009-2011 Andy Spencer <andy753421@gmail.com>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -31,9 +31,8 @@
 #include <glib.h>
 #include <math.h>
 #include <string.h>
-#include <GL/gl.h>
-#include <GL/glu.h>
 
+#include "gtkgl.h"
 #include "gpqueue.h"
 #include "grits-util.h"
 #include "roam.h"
@@ -702,11 +701,15 @@ void roam_sphere_update_view(RoamSphere *sphere)
 void roam_sphere_update_errors(RoamSphere *sphere)
 {
        g_debug("RoamSphere: update_errors - polys=%d", sphere->polys);
+
+       static int version = 0;
+       if (version == sphere->view->version)
+               return;
+       version = sphere->view->version;
+
        GPtrArray *tris = g_pqueue_get_array(sphere->triangles);
        GPtrArray *dias = g_pqueue_get_array(sphere->diamonds);
 
-       roam_sphere_update_view(sphere);
-
        for (int i = 0; i < tris->len; i++) {
                RoamTriangle *triangle = tris->pdata[i];
                roam_triangle_update_errors(triangle, sphere);