Ejemplo n.º 1
0
        public TerrainView(TerrainModel terrainmodel)
        {
            LogFile.WriteLine("TerrainView( " + terrainmodel + ")");

            this.terrainmodel = terrainmodel;

            terrainmodel.TerrainModified += new TerrainModel.TerrainModifiedHandler(terrainmodel_TerrainModified);

            GraphicsHelperGl g = new GraphicsHelperGl();

            g.CheckError();
            foreach (MapTextureStageModel maptexturestagemodel in terrainmodel.texturestages)
            {
                LogFile.WriteLine("create maptexturestageview for " + maptexturestagemodel);
                mapviewbymapmodel.Add(maptexturestagemodel, new MapTextureStageView(maptexturestagemodel));
            }
            g.CheckError();

            renderableheightmap = new RenderableHeightMap(this, terrainmodel, 1, 1);
            //renderableallfeatures = new RenderableAllFeatures(this);
            // water must be last, otherwise you cant see through it ;-)
            renderablewater = new RenderableWater(new Vector3(), new Vector2(terrainmodel.HeightMapWidth, terrainmodel.HeightMapHeight));
            // minimap last, covers everything else
            //renderableminimap = new RenderableMinimap(this, renderableheightmap);
        }
Ejemplo n.º 2
0
        // note could upgrade this to use Isomething later, but Terrain works for now
        public RenderableMinimap(TerrainModel parent, RenderableHeightMap renderableheightmap )
        {
            this.parent = parent;
            this.renderableheightmap = renderableheightmap;

            Gl.glGenTextures(1, out minimaptexture);

            RendererSdl.GetInstance().WriteNextFrameEvent += new WriteNextFrameCallback(RenderableMinimap_WriteNextFrameEvent);
        }
Ejemplo n.º 3
0
        public RenderableMinimap(TerrainModel parent, RenderableHeightMap renderableheightmap)  // note could upgrade this to use Isomething later, but Terrain works for now
        {
            this.parent = parent;
            this.renderableheightmap = renderableheightmap;

            Gl.glGenTextures(1, out minimaptexture);

            RendererSdl.GetInstance().WriteNextFrameEvent += new WriteNextFrameCallback(RenderableMinimap_WriteNextFrameEvent);
        }
Ejemplo n.º 4
0
        public TerrainView( TerrainModel terrainmodel )
        {
            LogFile.WriteLine( "TerrainView( " + terrainmodel + ")" );

            this.terrainmodel = terrainmodel;

            terrainmodel.TerrainModified += new TerrainModel.TerrainModifiedHandler( terrainmodel_TerrainModified );

            GraphicsHelperGl g = new GraphicsHelperGl();
            g.CheckError();
            foreach (MapTextureStageModel maptexturestagemodel in terrainmodel.texturestages)
            {
                LogFile.WriteLine( "create maptexturestageview for " + maptexturestagemodel );
                mapviewbymapmodel.Add( maptexturestagemodel, new MapTextureStageView( maptexturestagemodel ) );
            }
            g.CheckError();

            renderableheightmap = new RenderableHeightMap( this, terrainmodel, 1, 1 );
            //renderableallfeatures = new RenderableAllFeatures(this);
            // water must be last, otherwise you cant see through it ;-)
            renderablewater = new RenderableWater(new Vector3(), new Vector2(terrainmodel.HeightMapWidth , terrainmodel.HeightMapHeight ));
            // minimap last, covers everything else
            //renderableminimap = new RenderableMinimap(this, renderableheightmap);
        }