コード例 #1
0
        public void TestProgramClassTypeCollection_1()
        {
            ProgramClassTypeCollection collection = new ProgramClassTypeCollection();
            ProgramClass     testProgramClass;
            ProgramInterface testProgramInterface;
            List <string>    list = new List <string>();
            List <string>    testClassModifiers     = new List <string>();
            List <string>    testClassGenerics      = new List <string>();
            List <string>    testInterfaceModifiers = new List <string>();
            List <string>    testInterfaceGenerics  = new List <string>();

            testClassModifiers.Add("x");
            testClassGenerics.Add("y");
            testInterfaceModifiers.Add("x");
            testInterfaceGenerics.Add("y");

            testProgramClass     = new ProgramClass("item2", testClassModifiers, testClassGenerics);
            testProgramInterface = new ProgramInterface("item2", testInterfaceModifiers, testInterfaceGenerics);

            collection.Add(new ProgramClass("item0", list, list));
            collection.Add(new ProgramInterface("item1", list, list));
            collection.Add(new ProgramClass("item2", list, list));
            collection.Add(new ProgramClass("item3", list, list));

            Assert.AreEqual(collection[2], collection["item2"]);
            Assert.AreEqual(collection[2], testProgramClass);
            Assert.AreEqual(collection["item2"], testProgramClass);
            Assert.AreNotEqual(collection[2], testProgramInterface);
            Assert.AreNotEqual(collection["item2"], testProgramInterface);
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Program"></param>
        /// <param name="programInterface"></param>
        /// <param name="pname"></param>
        /// <param name="params"></param>
        /// <returns></returns>
        public static int GetProgramInterfaceiv(uint Program, ProgramInterface programInterface, ProgramInterfaceParameters pname)
        {
            int tmp = 0;

            Delegates.glGetProgramInterfaceiv(Program, programInterface, pname, ref tmp);
            return(tmp);
        }
コード例 #3
0
        public void TestProgramClassType_2()
        {
            string        name        = "TestInterface";
            List <string> list        = new List <string>();
            List <string> modifiers1  = new List <string>();
            List <string> modifiers2  = new List <string>();
            List <string> returnTypes = new List <string>();
            List <string> modifiers   = new List <string>();

            ProgramInterface programInterface1;
            ProgramInterface programInterface2;

            modifiers1.Add("interface");
            modifiers1.Add("1");
            modifiers1.Add("modifiers");
            modifiers2.Add("interface");
            modifiers2.Add("2");
            modifiers2.Add("modifiers");
            returnTypes.Add("int");
            modifiers.Add("public");

            programInterface1 = new ProgramInterface(name, modifiers1, list);
            programInterface2 = new ProgramInterface(name, modifiers2, list);

            programInterface1.ChildList.Add(new ProgramFunction("FunctionName", list, returnTypes, list, list, list));
            programInterface2.SubClasses.Add(new ProgramClass("ClassName", modifiers, list));

            Assert.AreEqual(programInterface1, programInterface2);
            Assert.AreEqual(programInterface1.GetHashCode(), programInterface2.GetHashCode());
        }
コード例 #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Program"></param>
        /// <param name="programInterface"></param>
        /// <param name="index"></param>
        /// <param name="Name"></param>
        /// <param name="DefaultStringBuilderSize"></param>
        /// <returns></returns>
        public static string GetProgramResourceName(uint Program, ProgramInterface programInterface, uint index, string Name, int DefaultStringBuilderSize = 64)
        {
            var sb = new StringBuilder(DefaultStringBuilderSize + 4);

            Delegates.glGetProgramResourceName(Program, programInterface, index, sb.Capacity - 2, out DefaultStringBuilderSize, sb);
            return(sb.ToString());
        }
コード例 #5
0
 public ResultTableViewModel(ProgramInterface iInterface)
 {
     _programInterface = iInterface;
     SourceTable       = new ObservableCollection <SourceTableView>();
     HandlerTable      = new ObservableCollection <HandlerTableView>();
     UpdateState();
 }
コード例 #6
0
 public ResultPaneViewModel(ProgramInterface programInterface)
 {
     _programInterface      = programInterface;
     GeneratedRequestAmount = 0;
     HandledRequestAmount   = 0;
     RejectedRequestAmount  = 0;
 }
コード例 #7
0
 public StartButtonViewModel(
     ProgramInterface programInterface,
     ResultPaneViewModel resultPaneViewModel,
     ResultTableViewModel resultTableViewModel
     )
 {
     _programInterface     = programInterface;
     _resultPaneViewModel  = resultPaneViewModel;
     _resultTableViewModel = resultTableViewModel;
 }
コード例 #8
0
        public static Int32 GetProgramResourceLocationIndexEXT(UInt32 program, ProgramInterface programInterface, String name)
        {
            Int32 retValue;

            Debug.Assert(Delegates.pglGetProgramResourceLocationIndexEXT != null, "pglGetProgramResourceLocationIndexEXT not implemented");
            retValue = Delegates.pglGetProgramResourceLocationIndexEXT(program, (Int32)programInterface, name);
            LogCommand("glGetProgramResourceLocationIndexEXT", retValue, program, programInterface, name);
            DebugCheckErrors(retValue);

            return(retValue);
        }
コード例 #9
0
        public InputStateViewModel(ProgramInterface programInterface)
        {
            _programInterface = programInterface;

            RequestAmount = 1;
            SourceAmount  = 1;
            HandlerAmount = 1;
            SourceMinArg  = 1;
            SourceMaxArg  = 2;
            HandlerMinArg = 1;
            HandlerMaxArg = 2;
            BufferSize    = 0;
        }
コード例 #10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Program"></param>
        /// <param name="programInterface"></param>
        /// <param name="Index"></param>
        /// <param name="property"></param>
        /// <returns></returns>
        public static int[] GetProgramResourceiv(uint Program, ProgramInterface programInterface, uint Index, ProgramResourceProperties property, int ResultSize = 1)
        {
            int tmp    = 1;
            var result = new int[ResultSize];

            Delegates.glGetProgramResourceiv(Program, programInterface, Index, 1, ref property, 1, out tmp, ref result[0]);
            if (tmp < result.Length)
            {
                var test = new int[tmp];
                Array.Copy(result, test, tmp);
                return(test);
            }
            else
            {
                return(result);
            }
        }
コード例 #11
0
        public void TestProgramClassType_3()
        {
            string           name      = "TestName";
            List <string>    modifiers = new List <string>();
            List <string>    list      = new List <string>();
            ProgramClass     programClass;
            ProgramInterface programInterface;
            ProgramClass     subclass;

            modifiers.Add("private");

            subclass = new ProgramClass("Subclass", list, list);

            programClass     = new ProgramClass(name, modifiers, list);
            programInterface = new ProgramInterface(name, modifiers, list);

            programClass.SubClasses.Add(subclass);
            programInterface.SubClasses.Add(subclass);

            Assert.AreNotEqual(programClass, programInterface);
            Assert.AreNotEqual(programClass.GetHashCode(), programInterface.GetHashCode());
        }
コード例 #12
0
        //-----------------------------------------------------------------------------------------
        private void _PrintInterfaceInformation(int program, ProgramInterface iface)
        {
            string[] propName = new string[] { "type", "location", "array size" };
            System.Text.StringBuilder name = new  System.Text.StringBuilder();
            int[] myParams = new int[4] {
                0, 0, 0, 0
            };
            ProgramProperty[] myProps = new ProgramProperty[] { ProgramProperty.Type,
                                                                ProgramProperty.Location,
                                                                ProgramProperty.ArraySize };
            int interfaces;

            GL.GetProgramInterface(program, iface, ProgramInterfaceParameter.ActiveResources, out interfaces);

            for (int i = 0; i < interfaces; i++)
            {
                int    dummy;
                string typeName;

                GL.GetProgramResourceName(program, iface, i, 1024, out dummy, name);
                GL.GetProgramResource(program, iface, i, 3, myProps, 3, out dummy, myParams);

                if (!Statics.typeNames.TryGetValue((All)myParams[0], out typeName))
                {
                    typeName = Statics.typeNames[All.None];
                }

                if (myParams[2] != 0)
                {
                    Console.WriteLine(String.Format("Index {0}: {1,-7} {2,-16}[{3}] @ location {4}.",
                                                    i, typeName, name, myParams[2], myParams[1]));
                }
                else
                {
                    Console.WriteLine(String.Format("Index {0}: {1,-7} {2,-16} @ location {3}.",
                                                    i, typeName, name, myParams[1]));
                }
            }
        }
コード例 #13
0
        public void TestRelationshipProcessor_ProcessRelationships()
        {
            ProgramFile   programFile;
            CodeProcessor codeProcessor;
            FileProcessor fileProcessor;
            ProgramClassTypeCollection expectedProgramClassTypeCollection = new ProgramClassTypeCollection();
            ProgramClassTypeCollection actualProgramClassTypeCollection   = new ProgramClassTypeCollection();
            List <string> empty = new List <string>();

            string filePath = Path.GetFullPath("..\\..\\..\\CodeAnalyzerTests\\TestInputFiles\\TestInputFile.cs");
            string fileName = "TestInputFile.cs";
            string fileText = "";

            if (File.Exists(filePath))
            {
                fileText = File.ReadAllText(filePath);
            }

            ProgramInterface IAnimalActions = new ProgramInterface("IAnimalActions", empty, empty);
            ProgramInterface IHumanActions  = new ProgramInterface("IHumanActions", empty, empty);
            ProgramClass     Animal         = new ProgramClass("Animal", empty, empty);
            ProgramClass     Pet            = new ProgramClass("Pet", empty, empty);
            ProgramClass     Dog            = new ProgramClass("Dog", empty, empty);
            ProgramClass     Human          = new ProgramClass("Human", empty, empty);
            ProgramClass     Car            = new ProgramClass("Car", empty, empty);

            IAnimalActions.SubClasses.Add(Dog);
            IAnimalActions.SubClasses.Add(Human);
            IHumanActions.SubClasses.Add(Human);
            Animal.SubClasses.Add(Pet);
            Animal.SubClasses.Add(Human);
            Pet.SuperClasses.Add(Animal);
            Pet.SubClasses.Add(Dog);
            Pet.OwnedByClasses.Add(Human);
            Pet.UsedByClasses.Add(Human);
            Dog.SuperClasses.Add(Pet);
            Dog.SuperClasses.Add(IAnimalActions);
            Dog.OwnedByClasses.Add(Human);
            Human.SuperClasses.Add(Animal);
            Human.SuperClasses.Add(IAnimalActions);
            Human.SuperClasses.Add(IHumanActions);
            Human.OwnedClasses.Add(Car);
            Human.OwnedClasses.Add(Pet);
            Human.OwnedClasses.Add(Dog);
            Human.UsedClasses.Add(Pet);
            Car.OwnedByClasses.Add(Human);

            expectedProgramClassTypeCollection.Add(IAnimalActions);
            expectedProgramClassTypeCollection.Add(IHumanActions);
            expectedProgramClassTypeCollection.Add(Animal);
            expectedProgramClassTypeCollection.Add(Pet);
            expectedProgramClassTypeCollection.Add(Dog);
            expectedProgramClassTypeCollection.Add(Human);
            expectedProgramClassTypeCollection.Add(Car);

            programFile   = new ProgramFile(filePath, fileName, fileText);
            fileProcessor = new FileProcessor(programFile);
            codeProcessor = new CodeProcessor(programFile, actualProgramClassTypeCollection);

            fileProcessor.ProcessFile();
            codeProcessor.ProcessFileCode();

            foreach (ProgramClassType programClassType in actualProgramClassTypeCollection)
            {
                RelationshipProcessor relationshipProcessor = new RelationshipProcessor(programClassType, actualProgramClassTypeCollection);
                relationshipProcessor.ProcessRelationships();
            }

            CollectionAssert.AreEquivalent(expectedProgramClassTypeCollection, actualProgramClassTypeCollection);

            foreach (ProgramClassType expectedProgramClassType in expectedProgramClassTypeCollection)
            {
                if (actualProgramClassTypeCollection.Contains(expectedProgramClassType.Name))
                {
                    ProgramClassType actualProgramClassType = actualProgramClassTypeCollection[expectedProgramClassType.Name];
                    CollectionAssert.AreEquivalent(expectedProgramClassType.SubClasses, actualProgramClassType.SubClasses);
                    CollectionAssert.AreEquivalent(expectedProgramClassType.SuperClasses, actualProgramClassType.SuperClasses);

                    if (expectedProgramClassType.GetType() == typeof(ProgramClass))
                    {
                        ProgramClass expectedProgramClass = (ProgramClass)expectedProgramClassType;
                        ProgramClass actualProgramClass   = (ProgramClass)actualProgramClassType;
                        CollectionAssert.AreEquivalent(expectedProgramClass.OwnedClasses, actualProgramClass.OwnedClasses);
                        CollectionAssert.AreEquivalent(expectedProgramClass.OwnedByClasses, actualProgramClass.OwnedByClasses);
                        CollectionAssert.AreEquivalent(expectedProgramClass.UsedClasses, actualProgramClass.UsedClasses);
                        CollectionAssert.AreEquivalent(expectedProgramClass.UsedByClasses, actualProgramClass.UsedByClasses);
                    }
                }
            }
        }
コード例 #14
0
 //ARB_program_interface_query
 /// <summary>
 /// Returns from a program parameters defined by program interface.
 /// </summary>
 /// <param name="Program">Program to query.</param>
 /// <param name="programInterface">Which interface to get common properties for</param>
 /// <param name="pname">Name of parameter to retrive.</param>
 /// <param name="params"></param>
 public static void GetProgramInterfaceiv(uint Program, ProgramInterface programInterface, ProgramInterfaceParameters pname, int[] @params)
 {
     Delegates.glGetProgramInterfaceiv(Program, programInterface, pname, ref @params[0]);
 }
コード例 #15
0
 public static unsafe int GetProgramResourceLocationIndex(this ExtBlendFuncExtended thisApi, [Flow(FlowDirection.In)] uint program, [Flow(FlowDirection.In)] ProgramInterface programInterface, [Count(Computed = "name"), Flow(FlowDirection.In)] ReadOnlySpan <byte> name)
 {
     // SpanOverloader
     return(thisApi.GetProgramResourceLocationIndex(program, programInterface, in name.GetPinnableReference()));
 }
コード例 #16
0
 public static unsafe void GetProgramInterface(this ArbProgramInterfaceQuery thisApi, [Flow(FlowDirection.In)] uint program, [Flow(FlowDirection.In)] ProgramInterface programInterface, [Flow(FlowDirection.In)] ProgramInterfacePName pname, [Count(Computed = "pname"), Flow(FlowDirection.Out)] Span <int> @params)
 {
     // SpanOverloader
     thisApi.GetProgramInterface(program, programInterface, pname, out @params.GetPinnableReference());
 }
コード例 #17
0
 public static unsafe void GetProgramResource(this ArbProgramInterfaceQuery thisApi, [Flow(FlowDirection.In)] uint program, [Flow(FlowDirection.In)] ProgramInterface programInterface, [Flow(FlowDirection.In)] uint index, [Flow(FlowDirection.In)] uint propCount, [Count(Parameter = "propCount"), Flow(FlowDirection.In)] ReadOnlySpan <ProgramResourceProperty> props, [Flow(FlowDirection.In)] uint count, [Count(Count = 1), Flow(FlowDirection.Out)] Span <uint> length, [Count(Parameter = "count"), Flow(FlowDirection.Out)] Span <int> @params)
 {
     // SpanOverloader
     thisApi.GetProgramResource(program, programInterface, index, propCount, in props.GetPinnableReference(), count, out length.GetPinnableReference(), out @params.GetPinnableReference());
 }
コード例 #18
0
 public unsafe partial void GetProgramInterface([Flow(FlowDirection.In)] uint program, [Flow(FlowDirection.In)] ProgramInterface programInterface, [Flow(FlowDirection.In)] ProgramInterfacePName pname, [Count(Computed = "pname"), Flow(FlowDirection.Out)] int * @params);
コード例 #19
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="Program"></param>
 /// <param name="programInterface"></param>
 /// <param name="index"></param>
 /// <param name="bufSize"></param>
 /// <param name="Lenght"></param>
 /// <param name="Name"></param>
 public static void GetProgramResourceName(uint Program, ProgramInterface programInterface, uint index, int bufSize, out int Lenght, StringBuilder Name)
 {
     Delegates.glGetProgramResourceName(Program, programInterface, index, bufSize, out Lenght, Name);
 }
コード例 #20
0
 public static void GetProgramResourceiv(uint Program, ProgramInterface programInterface, uint Index, ProgramResourceProperties[] props, out int Length, int[] @params)
 {
     Delegates.glGetProgramResourceiv(Program, programInterface, Index, props.Length, ref props[0], @params.Length, out Length, ref @params[0]);
 }
コード例 #21
0
 public static int GetProgramResourceIndex(int program, ProgramInterface intr, string pname)
 {
     unsafe
     {
         fixed(char* fparams = pname)
         {
             return glGetProgramResourceIndex(program, intr, pname);
         }
     }
 }
コード例 #22
0
        public static int GetProgramInterfaceiv(int program, ProgramInterface intr, InterfaceProperty pname)
        {
            unsafe
            {
                int result = 0;
                glGetProgramInterfaceiv(program, intr, pname, &result);

                return result;
            }
        }
コード例 #23
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="Program"></param>
 /// <param name="programInterface"></param>
 /// <param name="Index"></param>
 /// <param name="property"></param>
 /// <returns></returns>
 public static int[] GetProgramResourceiv(uint Program, ProgramInterface programInterface, uint Index, ProgramResourceProperties property, int ResultSize = 1)
 {
     int tmp = 1;
     var result = new int[ResultSize];
     Delegates.glGetProgramResourceiv(Program, programInterface, Index, 1, ref property, 1, out tmp, ref result[0]);
     if (tmp < result.Length)
     {
         var test = new int[tmp];
         Array.Copy(result, test, tmp);
         return test;
     }
     else
         return result;
 }
コード例 #24
0
 public static void GetProgramResourceiv(uint Program, ProgramInterface programInterface, uint Index, ProgramResourceProperties[] props, out int Length, int[] @params)
 {
     Delegates.glGetProgramResourceiv(Program, programInterface, Index, props.Length, ref props[0], @params.Length, out Length, ref @params[0]);
 }
コード例 #25
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="Program"></param>
 /// <param name="programInterface"></param>
 /// <param name="index"></param>
 /// <param name="Name"></param>
 /// <param name="DefaultStringBuilderSize"></param>
 /// <returns></returns>
 public static string GetProgramResourceName(uint Program, ProgramInterface programInterface, uint index, string Name, int DefaultStringBuilderSize = 64)
 {
     var sb = new StringBuilder(DefaultStringBuilderSize + 4);
     Delegates.glGetProgramResourceName(Program, programInterface, index, sb.Capacity - 2, out DefaultStringBuilderSize, sb);
     return sb.ToString();
 }
コード例 #26
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="Program"></param>
 /// <param name="programInterface"></param>
 /// <param name="pname"></param>
 /// <param name="params"></param>
 /// <returns></returns>
 public static int GetProgramInterfaceiv(uint Program, ProgramInterface programInterface, ProgramInterfaceParameters pname)
 {
     int tmp = 0;
     Delegates.glGetProgramInterfaceiv(Program, programInterface, pname, ref tmp);
     return tmp;
 }
コード例 #27
0
        public static int GetProgramResourceiv(int program, ProgramInterface intr, int index, ResourceProperty pname)
        {
            unsafe
            {
                int result = 0;
                glGetProgramResourceiv(program, intr, index, 1, &pname, 1, (int*) 0, &result);

                return result;
            }
        }
コード例 #28
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="Program"></param>
 /// <param name="programInterface"></param>
 /// <param name="Name"></param>
 /// <returns></returns>
 public static int GetProgramResourceLocationIndex(uint Program, ProgramInterface programInterface, string Name)
 {
     return Delegates.glGetProgramResourceLocationIndex(Program, programInterface, Name);
 }
コード例 #29
0
ファイル: ShaderProgram.cs プロジェクト: ScianGames/Engine
        /// <summary>
        /// Queries the interface of the program. See remarks.
        /// </summary>
        /// <remarks>
        /// This method, as all <c>GL.Get***</c>-methods, stalls the rendering pipeline and forces all previously submitted
        /// commands to be executed synchronously. Use with caution.
        /// </remarks>
        /// <param name="programInterface">The interface to query.</param>
        /// <param name="interfaceParameter">The name of the interface parameter to query.</param>
        /// <returns>The value.</returns>
        public int GetInterface(ProgramInterface programInterface, ProgramInterfaceParameter interfaceParameter)
        {
            this.VerifyAccess();

            int result;
            GL.GetProgramInterface(this, programInterface, interfaceParameter, out result);
            return result;
        }
コード例 #30
0
        public static string GetProgramResourceName(int program, ProgramInterface intr, int index)
        {
            unsafe
            {
                sbyte[] buffer = new sbyte[100];
                fixed(sbyte* pbuff = buffer)
                {

                    glGetProgramResourceName(program, intr, index, 100, (int*)0, pbuff);
                    return new string(pbuff);
                }
            }
        }
コード例 #31
0
 public partial void GetProgramInterface([Flow(FlowDirection.In)] uint program, [Flow(FlowDirection.In)] ProgramInterface programInterface, [Flow(FlowDirection.In)] ARB pname, [Count(Computed = "pname"), Flow(FlowDirection.Out)] out int @params);
コード例 #32
0
 public abstract void GetProgramInterface([Flow(FlowDirection.In)] uint program, [Flow(FlowDirection.In)] ProgramInterface programInterface, [Flow(FlowDirection.In)] ProgramInterfacePName pname, [Count(Computed = "pname"), Flow(FlowDirection.Out)] out int @params);
コード例 #33
0
 public abstract void GetProgramResource([Flow(FlowDirection.In)] uint program, [Flow(FlowDirection.In)] ProgramInterface programInterface, [Flow(FlowDirection.In)] uint index, [Flow(FlowDirection.In)] uint propCount, [Count(Parameter = "propCount"), Flow(FlowDirection.In)] Span <ProgramResourceProperty> props, [Flow(FlowDirection.In)] uint count, [Count(Count = 1), Flow(FlowDirection.Out)] out uint length, [Count(Parameter = "count"), Flow(FlowDirection.Out)] Span <int> @params);
コード例 #34
0
 public abstract unsafe void GetProgramResourceName([Flow(FlowDirection.In)] uint program, [Flow(FlowDirection.In)] ProgramInterface programInterface, [Flow(FlowDirection.In)] uint index, [Flow(FlowDirection.In)] uint bufSize, [Count(Count = 1), Flow(FlowDirection.Out)] uint *length, [Flow(FlowDirection.Out), Ultz.SuperInvoke.InteropServices.CountAttribute(Ultz.SuperInvoke.InteropServices.CountType.ParameterReference, -2)] out string name);
コード例 #35
0
 public static unsafe void GetProgramResourceName(this ArbProgramInterfaceQuery thisApi, [Flow(FlowDirection.In)] uint program, [Flow(FlowDirection.In)] ProgramInterface programInterface, [Flow(FlowDirection.In)] uint index, [Flow(FlowDirection.In)] uint bufSize, [Count(Count = 1), Flow(FlowDirection.Out)] Span <uint> length, [Count(Parameter = "bufSize"), Flow(FlowDirection.Out)] Span <string> name)
 {
     // SpanOverloader
     thisApi.GetProgramResourceName(program, programInterface, index, bufSize, out length.GetPinnableReference(), out name.GetPinnableReference());
 }
コード例 #36
0
        public void TestCodeProcessor_ProcessFileCode_Structure()
        {
            CodeProcessor codeProcessor;
            ProgramFile   expectedProgramFile;
            ProgramClassTypeCollection expectedProgramClassTypeCollection = new ProgramClassTypeCollection();
            FileProcessor fileProcessorForActual;
            ProgramFile   actualProgramFile;
            ProgramClassTypeCollection actualProgramClassTypeCollection = new ProgramClassTypeCollection();

            ProgramClassType tempProgramClassType;
            List <string>    empty = new List <string>();

            string filePath = Path.GetFullPath("..\\..\\..\\CodeAnalyzerTests\\TestInputFiles\\TestInputFile.cs");
            string fileName = "TestInputFile.cs";
            string fileText = "";

            if (File.Exists(filePath))
            {
                fileText = File.ReadAllText(filePath);
            }

            expectedProgramFile  = new ProgramFile(filePath, fileName, fileText);
            tempProgramClassType = new ProgramInterface("IAnimalActions", empty, empty);
            expectedProgramFile.ChildList.Add(tempProgramClassType);
            expectedProgramClassTypeCollection.Add(tempProgramClassType);
            tempProgramClassType = new ProgramInterface("IHumanActions", empty, empty);
            expectedProgramFile.ChildList.Add(tempProgramClassType);
            expectedProgramClassTypeCollection.Add(tempProgramClassType);
            tempProgramClassType = new ProgramClass("Animal", empty, empty);
            tempProgramClassType.ChildList.Add(new ProgramFunction("Animal", empty, empty, empty, empty, empty));
            tempProgramClassType.ChildList.Add(new ProgramFunction("Move", empty, empty, empty, empty, empty));
            expectedProgramFile.ChildList.Add(tempProgramClassType);
            expectedProgramClassTypeCollection.Add(tempProgramClassType);
            tempProgramClassType = new ProgramClass("Pet", empty, empty);
            tempProgramClassType.ChildList.Add(new ProgramFunction("Pet", empty, empty, empty, empty, empty));
            expectedProgramFile.ChildList.Add(tempProgramClassType);
            expectedProgramClassTypeCollection.Add(tempProgramClassType);
            tempProgramClassType = new ProgramClass("Dog", empty, empty);
            tempProgramClassType.ChildList.Add(new ProgramFunction("Dog", empty, empty, empty, empty, empty));
            tempProgramClassType.ChildList.Add(new ProgramFunction("Talk", empty, empty, empty, empty, empty));
            expectedProgramFile.ChildList.Add(tempProgramClassType);
            expectedProgramClassTypeCollection.Add(tempProgramClassType);
            tempProgramClassType = new ProgramClass("Human", empty, empty);
            tempProgramClassType.ChildList.Add(new ProgramFunction("Human", empty, empty, empty, empty, empty));
            tempProgramClassType.ChildList.Add(new ProgramFunction("Talk", empty, empty, empty, empty, empty));
            tempProgramClassType.ChildList.Add(new ProgramFunction("Move", empty, empty, empty, empty, empty));
            tempProgramClassType.ChildList.Add(new ProgramFunction("GoToSchool", empty, empty, empty, empty, empty));
            tempProgramClassType.ChildList.Add(new ProgramFunction("GraduateSchool", empty, empty, empty, empty, empty));
            tempProgramClassType.ChildList.Add(new ProgramFunction("GoToWork", empty, empty, empty, empty, empty));
            tempProgramClassType.ChildList.Add(new ProgramFunction("BuyPet", empty, empty, empty, empty, empty));
            tempProgramClassType.ChildList.Add(new ProgramFunction("BuyDog", empty, empty, empty, empty, empty));
            tempProgramClassType.ChildList.Add(new ProgramFunction("BuyCar", empty, empty, empty, empty, empty));
            tempProgramClassType.ChildList.Add(new ProgramFunction("SellCar", empty, empty, empty, empty, empty));
            tempProgramClassType.ChildList.Add(new ProgramFunction("FillCarFuelTank", empty, empty, empty, empty, empty));
            expectedProgramFile.ChildList.Add(tempProgramClassType);
            expectedProgramClassTypeCollection.Add(tempProgramClassType);
            tempProgramClassType = new ProgramClass("Car", empty, empty);
            tempProgramClassType.ChildList.Add(new ProgramFunction("Car", empty, empty, empty, empty, empty));
            tempProgramClassType.ChildList.Add(new ProgramFunction("FillTank", empty, empty, empty, empty, empty));
            expectedProgramFile.ChildList.Add(tempProgramClassType);
            expectedProgramClassTypeCollection.Add(tempProgramClassType);

            actualProgramFile      = new ProgramFile(filePath, fileName, fileText);
            fileProcessorForActual = new FileProcessor(actualProgramFile);
            fileProcessorForActual.ProcessFile();
            codeProcessor = new CodeProcessor(actualProgramFile, actualProgramClassTypeCollection);
            codeProcessor.ProcessFileCode();

            CheckAllChildLists(expectedProgramFile, actualProgramFile);
            CollectionAssert.AreEqual(expectedProgramClassTypeCollection, actualProgramClassTypeCollection);
        }
コード例 #37
0
ファイル: ShaderProgram.cs プロジェクト: Michael-Zp/ShaderSim
 /// <summary>Gets the index of the resource.</summary>
 /// <param name="name">The name.</param>
 /// <param name="type">The type.</param>
 /// <returns></returns>
 private int GetResourceIndex(string name, ProgramInterface type)
 {
     return(GL.GetProgramResourceIndex(this.ProgramID, type, name));
 }
コード例 #38
0
ファイル: Shader.cs プロジェクト: Jonnyf16/Framework
 public int GetResourceIndex(string name, ProgramInterface type)
 {
     return(GL.GetProgramResourceIndex(ProgramID, type, name));
 }
コード例 #39
0
 private static unsafe extern void glGetProgramInterfaceiv(int program, ProgramInterface intr, InterfaceProperty pname, int* parameters);
コード例 #40
0
    static void Main(string[] args)
    {
        ProgramInterface program = new ProgramInterface();

        program.Run();
    }
コード例 #41
0
 public abstract unsafe void GetProgramResource([Flow(FlowDirection.In)] uint program, [Flow(FlowDirection.In)] ProgramInterface programInterface, [Flow(FlowDirection.In)] uint index, [Flow(FlowDirection.In)] uint propCount, [Count(Parameter = "propCount"), Flow(FlowDirection.In)] ProgramResourceProperty *props, [Flow(FlowDirection.In)] uint count, [Count(Count = 1), Flow(FlowDirection.Out)] uint *length, [Count(Parameter = "count"), Flow(FlowDirection.Out)] int * @params);
コード例 #42
0
 private static unsafe extern int glGetProgramResourceIndex(int program, ProgramInterface intr, string name);
コード例 #43
0
 public abstract int GetProgramResourceLocationIndex([Flow(FlowDirection.In)] uint program, [Flow(FlowDirection.In)] ProgramInterface programInterface, [Flow(FlowDirection.In)] string name);
コード例 #44
0
 private static unsafe extern void glGetProgramResourceiv(int program, ProgramInterface intr, int index, int propcount, ResourceProperty* props, int buffsize, int* length, int* parameters);
コード例 #45
0
 internal BufferBinding(BufferRangeTarget bindingTarget, ProgramInterface programInterface)
 {
     BindingTarget     = bindingTarget;
     _programInterface = programInterface;
 }
コード例 #46
0
 private static unsafe extern void glGetProgramResourceName(int program, ProgramInterface intr, int index, int buffsize, int* length, sbyte* name);