From 10671a702a73850f66173d0ddc0632b768affb7e Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Thu, 28 Jan 2010 09:43:04 +0000 Subject: [PATCH] Add blank background color to env --- src/plugins/env.c | 8 ++++++++ src/plugins/env.h | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/plugins/env.c b/src/plugins/env.c index d30fcb3..e0d916a 100644 --- a/src/plugins/env.c +++ b/src/plugins/env.c @@ -40,6 +40,9 @@ static gpointer expose(GisCallback *callback, gpointer _self) glClearColor(MIN(0.65,rg), MIN(0.65,rg), MIN(1,blue), 1.0f); glClear(GL_COLOR_BUFFER_BIT); + /* Clear the earth */ + gis_viewer_render_tile(self->viewer, self->background); + /* Attempt to render an atmosphere */ /* glEnable(GL_COLOR_MATERIAL); @@ -81,6 +84,11 @@ GisPluginEnv *gis_plugin_env_new(GisViewer *viewer, GisPrefs *prefs) GisPluginEnv *self = g_object_new(GIS_TYPE_PLUGIN_ENV, NULL); self->viewer = viewer; + /* Load blank background texture */ + glGenTextures(1, &self->tex); + self->background = gis_tile_new(NULL, NORTH, SOUTH, EAST, WEST); + self->background->data = &self->tex; + /* Add renderers */ GisCallback *callback = gis_callback_new(expose, self); gis_viewer_add(viewer, GIS_OBJECT(callback), GIS_LEVEL_BACKGROUND, 0); diff --git a/src/plugins/env.h b/src/plugins/env.h index e05c8bc..9ac31e6 100644 --- a/src/plugins/env.h +++ b/src/plugins/env.h @@ -34,7 +34,9 @@ struct _GisPluginEnv { GObject parent_instance; /* instance members */ - GisViewer *viewer; + GisViewer *viewer; + guint tex; + GisTile *background; }; struct _GisPluginEnvClass { -- 2.43.2