Exemple #1
0
        public void MetaDataJsonMatches()
        {
            var metadataPointer = NativeCore.GetNativeMetadata((int)ProgrammingPlatform.dotnet);
            var metadata        = Marshal.PtrToStringUTF8(metadataPointer);

            Assert.Equal("", metadata);
        }
Exemple #2
0
        private bool RunGameLoop()
        {
            while (!NativeCore.PeekMessage(out this.message, IntPtr.Zero, 0, 0, 0))
            {
                NativeCore.QueryPerformanceCounter(ref this.updateEndCount);
                this.updateDeltaCount   = this.updateEndCount - this.updateStartCount;
                this.updateDeltaSeconds = this.updateDeltaCount / (double)this.counterFrequency;

                if (this.updateDeltaSeconds >= this.requestedUpdateDelta)
                {
                    this.Update(this.updateDeltaSeconds);
                    NativeCore.QueryPerformanceCounter(ref this.updateStartCount);
                }

                NativeCore.QueryPerformanceCounter(ref this.renderEndCount);
                this.renderDeltaCount   = this.renderEndCount - this.renderStartCount;
                this.renderDeltaSeconds = this.renderDeltaCount / (double)this.counterFrequency;

                if (this.renderDeltaSeconds >= this.requestedRenderDelta)
                {
                    this.Render(this.renderDeltaSeconds);
                    NativeCore.QueryPerformanceCounter(ref this.renderStartCount);
                }
            }

            this.OnHandleMessage(this.message);

            return(this.ExitGame);
        }
Exemple #3
0
        private void RunApplication()
        {
            NativeCore.QueryPerformanceFrequency(ref this.counterFrequency);

            NativeCore.QueryPerformanceCounter(ref this.updateStartCount);

            this.updateEndCount = this.updateStartCount;

            this.renderStartCount = this.updateEndCount;
            this.renderEndCount   = this.renderStartCount;

            while (!this.RunGameLoop())
            {
                Application.DoEvents();
            }

            Application.DoEvents();

            Application.Exit();
        }
Exemple #4
0
 public void MetaDataExceptionWorks()
 {
     var metadataPointer = NativeCore.GetNativeMetadata(5000000);
     var metadata        = Marshal.PtrToStringUTF8(metadataPointer);
 }
Exemple #5
0
 public void MetaDataJsonIsLongerThanBufferSize()
 {
     var metadataPointer = NativeCore.GetNativeMetadata((int)ProgrammingPlatform.dotnet);
     var metadata        = Marshal.PtrToStringUTF8(metadataPointer, 8200);
 }
Exemple #6
0
        public Display GetDisplay(Form window)
        {
            var deviceContext = NativeCore.GetDC(window.Handle);

            return(GetDisplay(deviceContext));
        }