]> Pileus Git - grits/blobdiff - src/gis-opengl.c
Improve gis-demo
[grits] / src / gis-opengl.c
index d5f9cf0b6e63e151b340a3aeb05e2d0e6a697e84..30671aad9f0772aef8534de401b338bbb4f6e5e9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Andy Spencer <spenceal@rose-hulman.edu>
+ * Copyright (C) 2009-2010 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
@@ -88,7 +88,7 @@ static void _set_visuals(GisOpenGL *self)
 
        float material_ambient[]  = {0.2, 0.2, 0.2, 1.0};
        float material_diffuse[]  = {0.8, 0.8, 0.8, 1.0};
-       float material_specular[] = {0.0, 0.0, 0.0, 1.0};
+       float material_specular[] = {0.1, 0.1, 0.1, 1.0};
        float material_emission[] = {0.0, 0.0, 0.0, 1.0};
        glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT,  material_ambient);
        glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE,  material_diffuse);
@@ -102,12 +102,6 @@ static void _set_visuals(GisOpenGL *self)
        glRotatef(lat, 1, 0, 0);
        glRotatef(-lon, 0, 1, 0);
 
-       /* Misc */
-       gdouble rg   = MAX(0, 1-(elev/20000));
-       gdouble blue = MAX(0, 1-(elev/50000));
-       glClearColor(MIN(0.65,rg), MIN(0.65,rg), MIN(1,blue), 1.0f);
-       glColor4f(1, 1, 1, 1);
-
        glDisable(GL_ALPHA_TEST);
 
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -420,11 +414,11 @@ static gboolean on_idle(GisOpenGL *self)
 /*********************
  * GisViewer methods *
  *********************/
-GisViewer *gis_opengl_new(GisPlugins *plugins)
+GisViewer *gis_opengl_new(GisPlugins *plugins, GisPrefs *prefs)
 {
        g_debug("GisOpenGL: new");
        GisViewer *self = g_object_new(GIS_TYPE_OPENGL, NULL);
-       self->plugins = plugins;
+       gis_viewer_setup(self, plugins, prefs);
        return self;
 }