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

namespace CSharpGL
{
    /// <summary>
    /// Render <see cref="IRenderable"/> objects.
    /// </summary>
    public class RenderAction : DependentActionBase
    {
        /// <summary>
        /// 
        /// </summary>
        public uint ClearMask { get; set; }

        /// <summary>
        /// Render <see cref="IRenderable"/> objects.
        /// </summary>
        /// <param name="scene"></param>
        /// <param name="clearMask"></param>
        public RenderAction(Scene scene, uint clearMask = GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT | GL.GL_STENCIL_BUFFER_BIT)
            : base(scene)
        {
            this.ClearMask = clearMask;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="param"></param>
        public override void Act(ActionParams param)
        {
            //int[] value = null;
            //value = new int[4];
            //GL.Instance.GetIntegerv((uint)GetTarget.ColorClearValue, value);
            vec4 clearColor = this.Scene.ClearColor;
            GL.Instance.ClearColor(clearColor.x, clearColor.y, clearColor.z, clearColor.w);
            GL.Instance.Clear(this.ClearMask);

            var arg = new RenderEventArgs(this.Scene, param, this.Scene.Camera);
            Render(this.Scene.RootElement, arg);

            //GL.Instance.ClearColor(value[0], value[1], value[2], value[3]);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sceneNodeBase"></param>
        /// <param name="arg"></param>
        public static void Render(SceneNodeBase sceneNodeBase, RenderEventArgs arg)
        {
            if (sceneNodeBase != null)
            {
                var node = sceneNodeBase as IRenderable;
                ThreeFlags flags = (node != null) ? node.EnableRendering : ThreeFlags.None;<commit_msg>render action clearmask<commit_after>﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;

namespace CSharpGL
{
    /// <summary>
    /// Render <see cref="IRenderable"/> objects.
    /// </summary>
    public class RenderAction : DependentActionBase
    {
        /// <summary>
        /// 
        /// </summary>
        public uint ClearMask { get; set; }

        /// <summary>
        /// Render <see cref="IRenderable"/> objects.
        /// </summary>
        /// <param name="scene"></param>
        /// <param name="clearMask"></param>
        public RenderAction(Scene scene, uint clearMask = GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT | GL.GL_STENCIL_BUFFER_BIT)
            : base(scene)
        {
            this.ClearMask = clearMask;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="param"></param>
        public override void Act(ActionParams param)
        {
            //int[] value = null;
            //value = new int[4];
            //GL.Instance.GetIntegerv((uint)GetTarget.ColorClearValue, value);
            if (this.ClearMask != 0)
            {
                vec4 clearColor = this.Scene.ClearColor;
                GL.Instance.ClearColor(clearColor.x, clearColor.y, clearColor.z, clearColor.w);
                GL.Instance.Clear(this.ClearMask);
            }

            var arg = new RenderEventArgs(this.Scene, param, this.Scene.Camera);
            Render(this.Scene.RootElement, arg);

            //GL.Instance.ClearColor(value[0], value[1], value[2], value[3]);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sceneNodeBase"></param>
        /// <param name="arg"></param>
        public static void Render(SceneNodeBase sceneNodeBase, RenderEventArgs arg)
        {
            if (sceneNodeBase != null)
            {
                var node = sceneNodeBase as IRenderable;
                ThreeFlags flags = (node != null) ? node.EnableRendering : ThreeFlags.None;
{'fraction_non_alphanumeric': 0.14026037828543356, 'fraction_numerical': 0.0031933185949398184, 'mean_word_length': 1.789041095890411, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 47, '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': '256579', 'n_tokens_mistral': 1144, 'n_tokens_neox': 1130, 'n_words': 236}