Esempio n. 1
0
        /// <summary>
        /// Call before finalizing the memory of the renderer.
        /// </summary>
        public void Shutdown()
        {
            // Clean up shaders
            GL.UseProgram(0);

            foreach (var p in programs)
            {
                p.Value.Destroy();
            }
            programs.Clear();

            foreach (var s in shaders)
            {
                s.Value.Destroy();
            }
            shaders.Clear();

            // Clean up renderable objects
            billboard.Destory();
            staticModel.Destory();
            riggedModel.Destroy();

            GL.BindTexture(TextureTarget.Texture2D, 0);
            foreach (var t in textures)
            {
                t.Value.Destroy();
            }
            textures.Clear();
        }
Esempio n. 2
0
        private bool CreateBillboard(String name, List <float> vertexData,
                                     List <float> texData, List <uint> indexData, Logger logger)
        {
            bool result = true;

            logger.Event("Creating billboard: " + name);

            billboard = new GLBillboard();
            result    = billboard.Create(vertexData, texData, indexData);

            if (result == false)
            {
                logger.Error("Failed to create billboard: " + name);
                billboard.Destory();
            }

            return(result);
        }