Inheritance: IDisposable
コード例 #1
0
ファイル: PerformanceLog.cs プロジェクト: dsrbecky/ColladaDOM
 public PerformanceLog(string description, LogType logType)
 {
     this.description = description;
     this.logType = logType;
     this.startTime = HighPrecisionTimer.Now;
     this.parent = current;
     current = this;
     if (parent != null) {
         this.level = parent.level + 1;
         if (IsVerbose || logType != LogType.Verbose) {
             parent.childs.Add(this);
         }
     } else {
         this.level = 0;
     }
 }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: dsrbecky/ColladaDOM
        void Display()
        {
            GlobalSettings.RunningTime = DateTime.Now - startTime;
            using(PerformanceLog log = new PerformanceLog("Frame " + (framesRendered++))) {
                using(new PerformanceLog("Clear")) {
                    Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);
                }

                Gl.glMatrixMode(Gl.GL_MODELVIEW);
                Gl.glLoadIdentity();

                using(new PerformanceLog("Render")) {
                    collada.Render();
                }

                using(new PerformanceLog("Swap")) {
                    Glut.glutSwapBuffers();
                }

                log.Stop();
                Glut.glutSetWindowTitle(String.Format("Collada Viewer - {0:f1} FPS", 1 / log.Duration.TotalSeconds));
            }
        }
コード例 #3
0
ファイル: PerformanceLog.cs プロジェクト: dsrbecky/ColladaDOM
 static PerformanceLog()
 {
     current = null;
     Root = new PerformanceLog("Root");
     current = Root;
 }
コード例 #4
0
ファイル: PerformanceLog.cs プロジェクト: dsrbecky/ColladaDOM
 public void Stop()
 {
     endTime = HighPrecisionTimer.Now;
     current = parent;
     PrintOnConsole();
 }