コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: zedr0n/testJS
        void onLoadingFrameComplete(object sender, FrameEventArgs e)
        {
            webControl.LoadingFrameComplete -= onLoadingFrameComplete;

            webControl.ExecuteJavascriptWithResult("JS.App.setText();");
            //dynamic document = (Awesomium.Core.JSObject)Html5.ExecuteJavascriptWithResult("document");
        }
コード例 #2
0
ファイル: TextureSampling.cs プロジェクト: corngood/cgnet
        /// <summary>
        /// Add your game rendering code here.
        /// </summary>
        /// <param name="e">Contains timing information.</param>
        /// <remarks>There is no need to call the base implementation.</remarks>
        protected override void DoRender(FrameEventArgs e)
        {
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            vertexProgram.Bind();
            vertexProfile.Enable();

            fragmentProgram.Bind();
            fragmentProfile.Enable();

            this.fragmentParamDecal.EnableTexture();

            GL.Begin(BeginMode.Triangles);
            GL.TexCoord2(0, 0);
            GL.Vertex2(-0.8f, 0.8f);

            GL.TexCoord2(1, 0);
            GL.Vertex2(0.8f, 0.8f);

            GL.TexCoord2(0.5f, 1);
            GL.Vertex2(0.0f, -0.8f);
            GL.End();

            vertexProfile.Disable();

            fragmentProfile.Disable();

            this.fragmentParamDecal.DisableTexture();

            SwapBuffers();
        }
コード例 #3
0
ファイル: BumpMapWall.cs プロジェクト: corngood/cgnet
        /// <summary>
        /// Add your game rendering code here.
        /// </summary>
        /// <param name="e">Contains timing information.</param>
        /// <remarks>There is no need to call the base implementation.</remarks>
        protected override void DoRender(FrameEventArgs e)
        {
            float[] lightPosition = {
                12.5f * (float)Math.Sin(this.myLightAngle),
                12.5f * (float)Math.Cos(this.myLightAngle),
                4
            };

            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            GL.LoadIdentity();
            Glu.LookAt(
                0.0, 0.0, 20.0,
                0.0, 0.0, 0.0, /* XYZ view center */
                0.0, 1.0, 0.0); /* Up is in positive Y direction */

            vertexProgram.Bind();

            this.vertexParamModelViewProj.SetStateMatrix(MatrixType.ModelviewProjectionMatrix, MatrixTransform.MatrixIdentity);

            this.vertexParamLightPosition.Set(lightPosition);

            vertexProfile.Enable();

            fragmentProgram.Bind();

            this.fragmentParamNormalMap.EnableTexture();
            this.fragmentParamNormalizeCube.EnableTexture();

            fragmentProfile.Enable();

            vertexProgram.UpdateParameters();
            fragmentProgram.UpdateParameters();

            GL.Begin(BeginMode.Quads);
            /* Counter clockwise (GL_CCW) winding */
            GL.TexCoord2(0f, 0f);
            GL.Vertex2(-7f, -7f);
            GL.TexCoord2(1f, 0f);
            GL.Vertex2(7f, -7f);
            GL.TexCoord2(1f, 1f);
            GL.Vertex2(7f, 7f);
            GL.TexCoord2(0f, 1f);
            GL.Vertex2(-7f, 7f);
            GL.End();

            fragmentParamNormalizeCube.DisableTexture();
            fragmentParamNormalMap.DisableTexture();

            vertexProfile.Disable();
            fragmentProfile.Disable();

            /*** Render light as white ball using fixed function pipe ***/
            GL.Translate(lightPosition[0], lightPosition[1], lightPosition[2]);
            GL.BindTexture(TextureTarget.Texture2D, 0);
            GL.Color3(0.8, 0.8, 0.1); /* yellow */
            NativeMethods.glutSolidSphere(0.4, 12, 12);

            this.SwapBuffers();
        }
コード例 #4
0
ファイル: GsShrinky.cs プロジェクト: corngood/cgnet
        /// <summary>
        /// Add your game rendering code here.
        /// </summary>
        /// <param name="e">Contains timing information.</param>
        /// <remarks>There is no need to call the base implementation.</remarks>
        protected override void DoRender(FrameEventArgs e)
        {
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            paramShrinkFactor.Set(myShrinkFactor);
            combinedProgram.Bind();

            // Enable all profiles needed
            for (int i = 0; i < combinedProgram.DomainsCount - 1; i++)
                combinedProgram.GetDomainProfile(i).Enable();

            DrawStars();

            // Disable all profiles needed
            for (int i = combinedProgram.DomainsCount - 1; i >= 0; i--)
                combinedProgram.GetDomainProfile(i).Disable();

            if (myShrinkFactor > 0.8)
            {
                myShrinkDirection = -0.02f;
            }
            else if (myShrinkFactor <= 0)
            {
                myShrinkFactor = 0;
                myShrinkDirection = 0.02f;
            }
            myShrinkFactor += myShrinkDirection;

            SwapBuffers();
        }
コード例 #5
0
ファイル: ParticleDisplay.cs プロジェクト: Gartley/ss13remake
 /// <summary>
 /// Handles the OnFrameBegin event of the Screen control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="FrameEventArgs"/> instance containing the event data.</param>
 private void Screen_OnFrameBegin(object sender, FrameEventArgs e)
 {
     // Clear the screen.
     Gorgon.Screen.Clear();
     _particleSystem.Update(e.FrameDeltaTime);
     _particleSystem.Render();
 }
コード例 #6
0
ファイル: MainForm.cs プロジェクト: Gartley/ss13remake
		/// <summary>
		/// Handles the OnFrameBegin event of the Screen control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="FrameEventArgs"/> instance containing the event data.</param>
		private void Screen_OnFrameBegin(object sender, FrameEventArgs e)
		{
			// Clear the screen.
			Gorgon.Screen.Clear();
		    txtspr.Draw();
            Gorgon.Screen.Rectangle(0,0, txtspr.Size.X, txtspr.Size.Y, Color.Brown);
		}
コード例 #7
0
        /// <summary>
        /// Add your game rendering code here.
        /// </summary>
        /// <param name="e">Contains timing information.</param>
        /// <remarks>There is no need to call the base implementation.</remarks>
        protected override void DoRender(FrameEventArgs e)
        {
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            vertexProgram.Bind();
            vertexProfile.EnableProfile();

            fragmentProgram.Bind();
            fragmentProfile.EnableProfile();

            GL.Begin(BeginMode.Triangles);
            GL.Color3(1f, 0f, 0f); /* Red */
            GL.Vertex2(-0.8f, 0.8f);

            GL.Color3(0f, 1f, 0f); /* Green */
            GL.Vertex2(0.8f, 0.8f);

            GL.Color3(0f, 0f, 1f); /* Blue */
            GL.Vertex2(0.0f, -0.8f);
            GL.End();

            vertexProfile.DisableProfile();
            fragmentProfile.DisableProfile();
            this.SwapBuffers();
        }
コード例 #8
0
ファイル: GsSimple.cs プロジェクト: corngood/cgnet
        /// <summary>
        /// Add your game rendering code here.
        /// </summary>
        /// <param name="e">Contains timing information.</param>
        /// <remarks>There is no need to call the base implementation.</remarks>
        protected override void DoRender(FrameEventArgs e)
        {
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            vertexProfile.Enable();
            geometryProfile.Enable();
            fragmentProfile.Enable();

            if (combinedProgram != null)
            {
                combinedProgram.Bind();
            }
            else
            {
                vertexProgram.Bind();
                geometryProgram.Bind();
                fragmentProgram.Bind();
            }

            DrawStars();

            vertexProfile.Disable();
            geometryProfile.Disable();
            fragmentProfile.Disable();
            SwapBuffers();
        }
コード例 #9
0
 private void WebViewLoadingFrameComplete(object sender, FrameEventArgs e)
 {
     if (e.IsMainFrame)
     {
         _WebView.LoadingFrameComplete -= WebViewLoadingFrameComplete;
         CheckCompletion();
     }
 }
コード例 #10
0
 void _IWebView_LoadingFrameComplete(object sender, FrameEventArgs e)
 {
     if (e.IsMainFrame)
     {
         _IWebView.LoadingFrameComplete -= _IWebView_LoadingFrameComplete;
         CheckCompletion();
     }
 }
コード例 #11
0
ファイル: Form1.cs プロジェクト: burnbaby/Dwar
        private void Awesomium_Windows_Forms_WebControl_LoadingFrameComplete(object sender, FrameEventArgs e)
        {
            if (e.IsMainFrame)
            {
                finishedLoading = true;
                ((WebControl)sender).LoadingFrameComplete -= Awesomium_Windows_Forms_WebControl_LoadingFrameComplete;
            }

        }
コード例 #12
0
ファイル: MainWindow.cs プロジェクト: Gartley/ss13remake
        private void GorgonIdle(object sender, FrameEventArgs e)
        {
            _networkManager.UpdateNetwork();
            _stateManager.Update(e);

            _userInterfaceManager.Update(e.FrameDeltaTime);
            _userInterfaceManager.Render();

            _netGrapher.Update();
        }
コード例 #13
0
ファイル: Balltest.cs プロジェクト: Gartley/ss13remake
 private void Gorgon_Idle(object sender, FrameEventArgs e)
 {
     Gorgon.Screen.Clear(Color.Black);
     screenTarget.Clear(Color.Black);
     Gorgon.CurrentRenderTarget = screenTarget;
     foreach (BounceySprite spr in bounceysprites)
     {
         spr.Draw();
     }
     Gorgon.CurrentRenderTarget = null;
     screenTarget.Image.Blit(0,0);
 }
コード例 #14
0
ファイル: Form1.cs プロジェクト: Gartley/ss13remake
        private void Gorgon_Idle(object sender, FrameEventArgs e)
        {
            Gorgon.Screen.Clear(System.Drawing.Color.Black);
            //Gorgon.CurrentShader = decalShader.Techniques["drawWithDecal"];

            Gorgon.CurrentShader = decalShader.Techniques["drawWithDecal"];
            foreach (BounceySprite spr in bounceysprites)
            {
                spr.Draw();
                
            }
            Gorgon.CurrentShader = null;
            //Gorgon.CurrentShader = null;
        }
コード例 #15
0
        /// <summary>
        /// Add your game rendering code here.
        /// </summary>
        /// <param name="e">Contains timing information.</param>
        /// <remarks>There is no need to call the base implementation.</remarks>
        protected override void DoRender(FrameEventArgs e)
        {
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            vertexProgram.Bind();
            vertexProfile.EnableProfile();

            fragmentProgram.Bind();
            fragmentProfile.EnableProfile();

            DrawStars();

            vertexProfile.DisableProfile();
            fragmentProfile.DisableProfile();
            SwapBuffers();
        }
コード例 #16
0
ファイル: TwoTextureAccesses.cs プロジェクト: corngood/cgnet
        /// <summary>
        /// Add your game rendering code here.
        /// </summary>
        /// <param name="e">Contains timing information.</param>
        /// <remarks>There is no need to call the base implementation.</remarks>
        protected override void DoRender(FrameEventArgs e)
        {
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            if (mySeparation > 0)
            {
                /* Separate in the horizontal direction. */
                this.vertexParamLeftSeparation.Set(-mySeparation, 0);
                this.vertexParamRightSeparation.Set(mySeparation, 0);
            }
            else
            {
                /* Separate in the vertical direction. */
                this.vertexParamLeftSeparation.Set(0, -mySeparation);
                this.vertexParamRightSeparation.Set(0, mySeparation);
            }

            vertexProgram.Bind();

            vertexProfile.Enable();

            fragmentProgram.Bind();

            fragmentProfile.Enable();

            this.fragmentParamDecal.EnableTexture();

            GL.Begin(BeginMode.Triangles);
            GL.TexCoord2(0, 0);
            GL.Vertex2(-0.8f, 0.8f);

            GL.TexCoord2(1, 0);
            GL.Vertex2(0.8f, 0.8f);

            GL.TexCoord2(0.5f, 1);
            GL.Vertex2(0.0f, -0.8f);
            GL.End();

            vertexProfile.Enable();

            fragmentProfile.Disable();

            this.fragmentParamDecal.DisableTexture();

            this.SwapBuffers();
        }
コード例 #17
0
        /// <summary>
        /// Add your game rendering code here.
        /// </summary>
        /// <param name="e">Contains timing information.</param>
        /// <remarks>There is no need to call the base implementation.</remarks>
        protected override void DoRender(FrameEventArgs e)
        {
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            vertexProgram.Bind();
            vertexProfile.EnableProfile();

            /* Rendering code verbatim from Chapter 1, Section 2.4.1 "Rendering
               a Triangle with OpenGL" (page 57). */
            GL.Begin(BeginMode.Triangles);
            GL.Vertex2(-0.8f, 0.8f);
            GL.Vertex2(0.8f, 0.8f);
            GL.Vertex2(0.0f, -0.8f);
            GL.End();

            vertexProfile.DisableProfile();
            this.SwapBuffers();
        }
コード例 #18
0
ファイル: VertexTwisting.cs プロジェクト: corngood/cgnet
        /// <summary>
        /// Add your game rendering code here.
        /// </summary>
        /// <param name="e">Contains timing information.</param>
        /// <remarks>There is no need to call the base implementation.</remarks>
        protected override void DoRender(FrameEventArgs e)
        {
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
            vertexParam_twisting.Set(myTwisting);

            vertexProgram.Bind();
            vertexProfile.Enable();

            fragmentProgram.Bind();
            fragmentProfile.Enable();

            DrawSubDividedTriangle(5);

            vertexProfile.Disable();
            fragmentProfile.Disable();

            this.SwapBuffers();
        }
コード例 #19
0
ファイル: ParticleSystem.cs プロジェクト: corngood/cgnet
        /// <summary>
        /// Add your game rendering code here.
        /// </summary>
        /// <param name="e">Contains timing information.</param>
        /// <remarks>There is no need to call the base implementation.</remarks>
        protected override void DoRender(FrameEventArgs e)
        {
            GL.Clear(ClearBufferMask.ColorBufferBit);

            const float Acceleration = -9.8f;
            float viewAngle = myGlobalTime * 2.8f;
            int i;

            GL.LoadIdentity();
            Glu.LookAt((float)Math.Cos(viewAngle), 0.3f, (float)Math.Sin(viewAngle),
                       0, 0, 0, 0, 1, 0);
            /* Set uniforms before glGLProgram bind. */
            this.vertexParamGlobalTime.Set(myGlobalTime);
            this.vertexParamAcceleration.Set(0, Acceleration, 0, 0);
            this.vertexParamModelViewProj.SetStateMatrix(MatrixType.ModelviewProjectionMatrix, MatrixTransform.MatrixIdentity);

            vertexProgram.Bind();

            vertexProfile.Enable();

            fragmentProfile.Enable();

            /* Render live particles. */
            GL.Begin(BeginMode.Points);
            for (i = 0; i < 800; i++)
            {
                if (myParticleSystem[i].Alive)
                {
                    /* initial velocity */
                    GL.TexCoord3(myParticleSystem[i].VInitial);
                    /* initial time */
                    GL.MultiTexCoord1(TextureUnit.Texture1, myParticleSystem[i].Initial);
                    /* initial position */
                    GL.Vertex3(myParticleSystem[i].PInitial);
                }
            }
            GL.End();

            vertexProfile.Disable();

            fragmentProfile.Disable();

            SwapBuffers();
        }
コード例 #20
0
        public void RenderUpdate(object sender, FrameEventArgs e)
        {
            if ((_isPlaying))
            {
                if (_buffer != null)
                {
                    //TODO: Sync video to audio
                    _frame++;
                    _buffer.Fill();
                }
                else
                    _frame++;

                trackBar1.Value = _frame;

                if (_frame >= _targetSource.NumFrames)
                    if (!_loop)
                        Stop();
                    else
                        _frame = -1;
            }
        }
コード例 #21
0
 protected abstract void DoRender(FrameEventArgs e);
コード例 #22
0
ファイル: MainMenu.cs プロジェクト: Gartley/ss13remake
        public void Update(FrameEventArgs e)
        {
            _connectTextbox.Position = new Point(_titleImage.ClientArea.Left + 40, _titleImage.ClientArea.Bottom + 50);
            _buttConnect.Position = new Point(_connectTextbox.Position.X, _connectTextbox.ClientArea.Bottom + 20);
            _buttOptions.Position = new Point(_buttConnect.Position.X, _buttConnect.ClientArea.Bottom + 20);
            _buttExit.Position = new Point(_buttOptions.Position.X, _buttOptions.ClientArea.Bottom + 20);

            if (_isConnecting)
            {
                TimeSpan dif = DateTime.Now - _connectTime;
                if (dif.TotalMilliseconds > ConnectTimeOut)
                {
                    _isConnecting = false;
                    NetworkManager.Disconnect();
                }
            }
        }
コード例 #23
0
ファイル: TextureSampling.cs プロジェクト: corngood/cgnet
 /// <summary>
 /// Add your game logic here.
 /// </summary>
 /// <param name="e">Contains timing information.</param>
 /// <remarks>There is no need to call the base implementation.</remarks>
 protected override void OnUpdateFrame(FrameEventArgs e)
 {
     if (Keyboard[Key.Escape])
     {
         this.Exit();
     }
 }
コード例 #24
0
ファイル: LobbyMenu.cs プロジェクト: Gartley/ss13remake
        public void Update(FrameEventArgs e)
        {
            _mainbg.Position = new Point(
                (int) ((Gorgon.Screen.Width/2f) - (_mainbg.ClientArea.Width/2f)),
                (int) ((Gorgon.Screen.Height/2f) - (_mainbg.ClientArea.Height/2f)));

            _recStatus = new RectangleF(_mainbg.Position.X + 10, _mainbg.Position.Y + 63, 785, 21);

            _imgStatus.Position = new Point((int) _recStatus.Left, (int) _recStatus.Top);

            _lblServer.Position = new Point((int) _recStatus.Left + 5, (int) _recStatus.Top + 2);
            _lblServerInfo.Position = new Point(_lblServer.ClientArea.Right, _lblServer.ClientArea.Y);
            _lblServerInfo.Text.Text = _serverName;

            _lblMode.Position = new Point(_lblServerInfo.ClientArea.Right + (int) _lastLblSpacing,
                                          _lblServerInfo.ClientArea.Y);
            _lblModeInfo.Position = new Point(_lblMode.ClientArea.Right, _lblMode.ClientArea.Y);
            _lblModeInfo.Text.Text = _gameType;

            _lblPlayers.Position = new Point(_lblModeInfo.ClientArea.Right + (int) _lastLblSpacing,
                                             _lblModeInfo.ClientArea.Y);
            _lblPlayersInfo.Position = new Point(_lblPlayers.ClientArea.Right, _lblPlayers.ClientArea.Y);
            _lblPlayersInfo.Text.Text = _serverPlayers.ToString() + " / " + _serverMaxPlayers.ToString();

            _lblPort.Position = new Point(_lblPlayersInfo.ClientArea.Right + (int) _lastLblSpacing,
                                          _lblPlayersInfo.ClientArea.Y);
            _lblPortInfo.Position = new Point(_lblPort.ClientArea.Right, _lblPort.ClientArea.Y);
            _lblPortInfo.Text.Text = _serverPort.ToString();

            _tabs.Position = _mainbg.Position + new Size(5, 90);

            _lobbyChat.Position = new Point(_mainbg.ClientArea.Left + 12, _mainbg.ClientArea.Bottom - _lobbyChat.ClientArea.Height - 12); //Wish the chat box wasnt such shit. Then i wouldnt have to do this here.
            _imgChatBg.Position = new Point(_lobbyChat.ClientArea.Left - 6, _lobbyChat.ClientArea.Top - 9);
        }
コード例 #25
0
ファイル: LobbyMenu.cs プロジェクト: Gartley/ss13remake
 public void GorgonRender(FrameEventArgs e)
 {
     _background.Draw(new Rectangle(0, 0, Gorgon.CurrentClippingViewport.Width,
                                    Gorgon.CurrentClippingViewport.Height));
     UserInterfaceManager.Render();
 }
コード例 #26
0
 private void webcontrol1_LoadingFrameComplete(object sender, FrameEventArgs e)
 {
     //LatestUrl = webcontrol1.Source.ToString();
     if (!webcontrol1.Source.ToString().Equals(LatestUrl))
     {
         //StreamWriter history = new StreamWriter("History.hst", true);
         //history.WriteLine(webcontrol1.Source.ToString());
         //history.Close();
         LatestUrl = webcontrol1.Source.ToString();
     }
     Title = webcontrol1.Title;
 }
コード例 #27
0
        /// <summary>
        /// Add your game logic here.
        /// </summary>
        /// <param name="e">Contains timing information.</param>
        /// <remarks>There is no need to call the base implementation.</remarks>
        protected override void OnUpdateFrame(FrameEventArgs e)
        {
            lightAngle += 0.008f; /* Add a small angle (in radians). */
            if (lightAngle > my2Pi)
            {
                lightAngle -= my2Pi;
            }

            if (this.Keyboard[Key.Escape])
            {
                this.Exit();
            }
        }
コード例 #28
0
 private void web_LoadingFrameComplete(object sender, FrameEventArgs e)
 {
     flatTextBox.RightContent = Resources["appbar_heart"];
 }
コード例 #29
0
ファイル: MainMenu.cs プロジェクト: Gartley/ss13remake
 public void GorgonRender(FrameEventArgs e)
 {
     _background.Draw(new Rectangle(0, 0, Gorgon.Screen.Width, Gorgon.Screen.Height));
 }
コード例 #30
0
 protected override void OnRenderFrame(FrameEventArgs e)
 {
     base.OnRenderFrame(e);
     DoRender(e);
     System.Windows.Forms.Application.DoEvents();
 }