<commit_before>﻿using OpenTK.Graphics.OpenGL;

namespace Fruitless {
    public delegate void RenderState(bool enable);

    public static class RenderStates {
        public static void Sprite(bool enable) {
            if (enable) {
                GL.Enable(EnableCap.CullFace);
                GL.FrontFace(FrontFaceDirection.Cw);
                GL.PolygonMode(MaterialFace.Front, PolygonMode.Fill);

                GL.Enable(EnableCap.DepthTest); // necessary for proper ordering of sprites (across different textures!)
                GL.Enable(EnableCap.Texture2D);
                GL.Enable(EnableCap.Blend);

                GL.DepthFunc(DepthFunction.Lequal);
                GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
            } else {
                GL.Disable(EnableCap.DepthTest);
                GL.Disable(EnableCap.CullFace);
                GL.Disable(EnableCap.Texture2D);
                GL.Disable(EnableCap.Blend);
            }
        }
    }
}<commit_msg>Removed depth testing. I don't think it was actually necessary.<commit_after>﻿using OpenTK.Graphics.OpenGL;

namespace Fruitless {
    public delegate void RenderState(bool enable);

    public static class RenderStates {
        public static void Sprite(bool enable) {
            if (enable) {
                GL.Enable(EnableCap.CullFace);
                GL.FrontFace(FrontFaceDirection.Cw);
                GL.PolygonMode(MaterialFace.Front, PolygonMode.Fill);

                GL.Enable(EnableCap.Texture2D);
                GL.Enable(EnableCap.Blend);

                GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
            } else {
                GL.Disable(EnableCap.CullFace);
                GL.Disable(EnableCap.Texture2D);
                GL.Disable(EnableCap.Blend);
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.09027777777777778, 'fraction_numerical': 0.002136752136752137, 'mean_word_length': 1.9683042789223455, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4479039', 'n_tokens_mistral': 526, 'n_tokens_neox': 494, 'n_words': 85}