<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using OpenTK;
using OpenTK.Graphics.OpenGL;
using GLO = OpenTK.Graphics.OpenGL.GL;
using GL = SamSeifert.GLE.GLR;
using SamSeifert.Utilities;
using SamSeifert.Utilities.Extensions;

namespace SamSeifert.GLE
{
    public class Shaders : DeleteableObject
    {
        private int _GL_Program  = 0;
        private int _GL_Vertex = 0;
        private int _GL_Frag = 0;

        private Dictionary<String, int> UniformLocations = new Dictionary<String, int>();
       
        public void GLDelete()
        {
            if (this._GL_Vertex != 0)
            {
                GL.DeleteShader(this._GL_Vertex);
                this._GL_Vertex = 0;
            }
            if (this._GL_Frag != 0)
            {
                GL.DeleteShader(this._GL_Frag);
                this._GL_Frag = 0;
            }
            if (this._GL_Program != 0)
            {
                GL.DeleteShader(this._GL_Program);
                this._GL_Program = 0;
            }
        }

        private int UniformLocation(String key)
        {
            int of_the_king;
            if (this.UniformLocations.TryGetValue(key, out of_the_king))<commit_msg>Delete Shader Bug<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using OpenTK;
using OpenTK.Graphics.OpenGL;
using GLO = OpenTK.Graphics.OpenGL.GL;
using GL = SamSeifert.GLE.GLR;
using SamSeifert.Utilities;
using SamSeifert.Utilities.Extensions;

namespace SamSeifert.GLE
{
    public class Shaders : DeleteableObject
    {
        private int _GL_Program  = 0;
        private int _GL_Vertex = 0;
        private int _GL_Frag = 0;

        private Dictionary<String, int> UniformLocations = new Dictionary<String, int>();
       
        public void GLDelete()
        {
            if (this._GL_Vertex != 0)
            {
                GL.DeleteShader(this._GL_Vertex);
                this._GL_Vertex = 0;
            }
            if (this._GL_Frag != 0)
            {
                GL.DeleteShader(this._GL_Frag);
                this._GL_Frag = 0;
            }
            if (this._GL_Program != 0)
            {
                // The next line is commented because of 
                // ARCS 2018 / 03 / 15 Error when deleting shader (Sam Desktop)
                // Occurs when switching environments in debug

                // GL.DeleteShader(this._GL_Program);
                this._GL_Program = 0;
            }
        }

        private int UniformLocation(String key)
        {
            int of_the_king;
            if (this.UniformLocations.TryGetValue(key, out of_the_king))
{'fraction_non_alphanumeric': 0.08576709796672828, 'fraction_numerical': 0.009611829944547136, 'mean_word_length': 1.7223340040241448, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4568334', 'n_tokens_mistral': 831, 'n_tokens_neox': 772, 'n_words': 180}