static void Main(string[] args) { Child c = new Child() { Name = "John Doe", Mobile = "188", Email = "*****@*****.**", SkinColor = Color.Yellow }; Console.WriteLine(c.GetContactInfo()); Standalone <string> s = new Standalone <string>("ss"); Console.WriteLine(s.Name); //Console.WriteLine((new Class1<string>()).GetContactInfo(c)); //Console.WriteLine((new Class2.Class3()).Name); new InterfaceImp().Execute(c.Name); var imp = new AbstractImp(); imp.Do(); Console.ReadLine(); }
public static void Main(string[] args) { var infoSink = new InfoSink { debug = new InfoSinkBase(), info = new InfoSinkBase() }; var intermediate = new GLSLIntermediate(); var preprocessor = new Standalone(infoSink, intermediate); string result = null; //const string fileName = "Sample.vert"; const string fileName = "notex.vert"; string original = null; using (var fs = File.OpenRead(fileName)) using (var sr = new StreamReader(fs)) { original = sr.ReadToEnd(); } Console.WriteLine(original); Console.WriteLine(original.Length); if (preprocessor.Run(fileName, out result)) { Console.WriteLine(result); Console.WriteLine(result.Length); } }
public static void Main(string[] args) { var infoSink = new InfoSink {debug = new InfoSinkBase(), info = new InfoSinkBase()}; var intermediate = new GLSLIntermediate (); var preprocessor = new Standalone (infoSink, intermediate); string result = null; //const string fileName = "Sample.vert"; const string fileName = "notex.vert"; string original = null; using (var fs = File.OpenRead (fileName)) using (var sr = new StreamReader(fs)) { original = sr.ReadToEnd (); } Console.WriteLine (original); Console.WriteLine (original.Length); if (preprocessor.Run (fileName, out result)) { Console.WriteLine (result); Console.WriteLine (result.Length); } }
private static string TransformTemplate( string filePath, NumDefine[] defines, PasteToken[] attributeTypes ) { var debug = new InfoSinkBase(SinkType.String); var info = new InfoSinkBase(SinkType.String); var infoSink = new InfoSink(info, debug); var intermediate = new GLSLIntermediate(); var symbols = new SymbolLookup(); symbols.SetPreambleManually(Profile.CoreProfile); foreach (var x in defines) { symbols.DefineAs(x.Name, x.Value); } foreach (var t in attributeTypes) { symbols.AddPasteToken(t.Name, t.Value); } var preprocessor = new Standalone(infoSink, intermediate, symbols); preprocessor.Run(filePath, out string result); return(result); }
private void Start() { if (m_Mode == RVInputMode.Playback) { // set maximum allowed timestep correct Time.maximumDeltaTime = Time.fixedDeltaTime; if (m_RecordStandalone) { Standalone.LoadRecordFile(); } if (m_RecordSteamVR) { SteamVR.LoadRecordFile(); } if (HasRecordPositionObject()) { ObjectPosition.LoadRecordFile(); m_ReplayCloneObject = new GameObject[m_RecordPositionObject.Length]; // clone recorded object for (int i = 0; i < m_RecordPositionObject.Length; i++) { m_ReplayCloneObject[i] = (GameObject)Instantiate(m_RecordPositionObject[i], Vector3.zero, Quaternion.identity); } } } }
/// <summary> /// Saves all record files as JSON format. /// </summary> private void SaveRecordFiles() { if (m_RecordStandalone) { if (Directory.Exists(Standalone.SaveFolderName())) { Directory.CreateDirectory(Standalone.SaveFolderName()); } Standalone.SaveRecordFile(); } if (m_RecordSteamVR) { if (Directory.Exists(SteamVR.SaveFolderName())) { Directory.CreateDirectory(SteamVR.SaveFolderName()); } SteamVR.SaveRecordFile(); } if (HasRecordPositionObject()) { if (Directory.Exists(ObjectPosition.SaveFolderName())) { Directory.CreateDirectory(ObjectPosition.SaveFolderName()); } ObjectPosition.SaveRecordFile(); } }
/// <summary> /// Returns a ProfilingTarget with the values set from the view model. /// </summary> public ProfilingTarget GetTarget() { if (IsValid) { return new ProfilingTarget { ProjectTarget = IsProjectSelected ? Project.GetTarget() : null, StandaloneTarget = IsStandaloneSelected ? Standalone.GetTarget() : null }; } else { return null; } }
public Declaration(INode parent, string version, string encoding, Standalone standalone) : base(parent) { if (version == null) { throw new ArgumentNullException("version"); } this.version = version; this.encoding = encoding; this.standalone = standalone; }
/// <summary> /// Returns a ProfilingTarget with the values set from the view model. /// </summary> public ProfilingTarget GetTarget() { if (IsValid) { return(new ProfilingTarget { ProjectTarget = IsProjectSelected ? Project.GetTarget() : null, StandaloneTarget = IsStandaloneSelected ? Standalone.GetTarget() : null, UseVTune = _useVTune }); } else { return(null); } }
public void TestCase() { var debug = new InfoSinkBase(SinkType.String); var info = new InfoSinkBase(SinkType.String); var infoSink = new InfoSink(info, debug); var intermediate = new GLSLIntermediate(); var symbols = new SymbolLookup(); symbols.SetPreambleManually(Profile.CoreProfile); symbols.DefineAs("GL_ARB_shader_storage_buffer_object", 1); var preprocessor = new Standalone(infoSink, intermediate, symbols); string result; Assert.IsTrue(preprocessor.Run("Sample.vert", out result)); Assert.IsNotNull(result); }
public static int Main(string[] args) { // try // { if (args.Length < 2) { Console.WriteLine("Invalid arguments"); Console.WriteLine("{0} {1} {n}... "); Console.WriteLine("{0} = output file"); Console.WriteLine("{1} = glsl shader file 1"); Console.WriteLine("{n} = glsl shader file n"); return(1); } foreach (var arg in args) { Console.WriteLine(arg); } IGLSLTypeLookup lookup = new OpenTKTypeLookup(); lookup.Initialize(); var extractor = new GLSLUniformExtractor(lookup); extractor.Initialize(); var debug = new InfoSinkBase(SinkType.StdOut); var info = new InfoSinkBase(SinkType.StdOut); var infoSink = new InfoSink(info, debug); var preprocessor = InitialisePreprocessor(infoSink); for (int i = 1; i < args.Length; ++i) { var fileName = args[i]; using (var fs = File.Open(fileName, FileMode.Open)) { var stage = Standalone.FindLanguage(fileName); string result; preprocessor.Run(fs, stage, out result); int actual = extractor.Extract(result); Console.WriteLine("{0} - no of blocks extracted : {1}", fileName, actual); } } GLSLAssembly output = new GLSLAssembly(); output.OutputAssembly = System.IO.Path.GetFileName(args[0]); output.Version = "1.0.0.1"; output.Namespace = ""; output.Path = System.IO.Path.GetPathRoot(args[0]); output.ReferencedAssemblies = new string[] { "OpenTK.dll" }; IGLSLStructGenerator generator = new GLSLStructGenerator(extractor); using (var provider = new CSharpCodeProvider()) { //generator.SaveAsAssembly (provider, output); var options = new CodeGeneratorOptions(); options.BlankLinesBetweenMembers = true; generator.SaveAsCode(provider, output, extractor, options); } return(0); // } // catch (Exception ex) // { // Debug.WriteLine (ex.Message); // return 1; // } // Test(); }