Exemple #1
0
        public SimpleRenderer()
        {
            string title = "SharpDX Renderer (SIMD " + (Vector.IsHardwareAccelerated ? "Enabled" : "Disabled") + ")";

            title           += Environment.Is64BitProcess ? " 64-bit" : " 32-bit";
            this.renderForm  = new RenderForm(title);
            this.renderables = ImmutableArray <IRenderable> .Empty;
            CreateAndInitializeDevice();
            renderForm.Show();
            AmbientColor = new Color4f(.25f, .25f, .25f, 1);
#if TEXT_RENDERER
            this.TextRenderer = new SimpleText(this.Get2DGraphicsDevice(), "Fonts/textfont.dds");
#endif
        }
Exemple #2
0
        protected override void Initialize(SharpDxGraphicsSystem system)
        {
#if TEXT_RENDERER
            this.textRenderer = system.Renderer.TextRenderer;
#endif
            this.stopwatch = new Stopwatch();
            this.stopwatch.Start();
            this.frameTimes = new LinkedList <double>();
            for (int g = 0; g < numFramesTracked; g++)
            {
                frameTimes.AddLast(this.stopwatch.ElapsedMilliseconds / 1000.0);
            }

            system.Renderer.AddRenderable(this);
        }