agate-svn-commit Mailing List for AgateLib (Page 20)
Status: Alpha
Brought to you by:
kanato
You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
(86) |
May
(77) |
Jun
|
Jul
(1) |
Aug
(31) |
Sep
(12) |
Oct
(31) |
Nov
(53) |
Dec
(39) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(53) |
Feb
(14) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
(7) |
Dec
(13) |
2011 |
Jan
(17) |
Feb
(5) |
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
(21) |
Dec
|
2012 |
Jan
(6) |
Feb
(14) |
Mar
(5) |
Apr
(4) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
(8) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
(1) |
Oct
(5) |
Nov
(9) |
Dec
(5) |
2014 |
Jan
(3) |
Feb
(2) |
Mar
(4) |
Apr
(3) |
May
|
Jun
(5) |
Jul
(33) |
Aug
(69) |
Sep
(35) |
Oct
(4) |
Nov
(1) |
Dec
|
From: <ka...@us...> - 2009-10-19 17:13:17
|
Revision: 1062 http://agate.svn.sourceforge.net/agate/?rev=1062&view=rev Author: kanato Date: 2009-10-19 17:13:05 +0000 (Mon, 19 Oct 2009) Log Message: ----------- Fix reference to AgateApplication. Modified Paths: -------------- trunk/Examples/ShootTheTraps/App.cs Modified: trunk/Examples/ShootTheTraps/App.cs =================================================================== --- trunk/Examples/ShootTheTraps/App.cs 2009-10-19 17:09:33 UTC (rev 1061) +++ trunk/Examples/ShootTheTraps/App.cs 2009-10-19 17:13:05 UTC (rev 1062) @@ -9,7 +9,7 @@ namespace ShootTheTraps { - class App : AgateApplication + class App : AgateGame { /// <summary> /// The main entry point for the application. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-10-19 17:09:44
|
Revision: 1061 http://agate.svn.sourceforge.net/agate/?rev=1061&view=rev Author: kanato Date: 2009-10-19 17:09:33 +0000 (Mon, 19 Oct 2009) Log Message: ----------- Fix text in font creator splash. Modified Paths: -------------- trunk/Tools/FontCreator/frmWarningSplash.Designer.cs trunk/Tools/FontCreator/frmWarningSplash.resx Modified: trunk/Tools/FontCreator/frmWarningSplash.Designer.cs =================================================================== --- trunk/Tools/FontCreator/frmWarningSplash.Designer.cs 2009-10-19 17:07:10 UTC (rev 1060) +++ trunk/Tools/FontCreator/frmWarningSplash.Designer.cs 2009-10-19 17:09:33 UTC (rev 1061) @@ -28,74 +28,74 @@ /// </summary> private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmWarningSplash)); - this.btnOK = new System.Windows.Forms.Button(); - this.chkSkipWarning = new System.Windows.Forms.CheckBox(); - this.label1 = new System.Windows.Forms.Label(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - this.SuspendLayout(); - // - // btnOK - // - this.btnOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom; - this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.btnOK.Location = new System.Drawing.Point(141, 192); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(61, 23); - this.btnOK.TabIndex = 0; - this.btnOK.Text = "OK"; - this.btnOK.UseVisualStyleBackColor = true; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // chkSkipWarning - // - this.chkSkipWarning.Anchor = System.Windows.Forms.AnchorStyles.Bottom; - this.chkSkipWarning.AutoSize = true; - this.chkSkipWarning.Location = new System.Drawing.Point(79, 169); - this.chkSkipWarning.Name = "chkSkipWarning"; - this.chkSkipWarning.Size = new System.Drawing.Size(184, 17); - this.chkSkipWarning.TabIndex = 1; - this.chkSkipWarning.Text = "Don\'t show me this warning again"; - this.chkSkipWarning.UseVisualStyleBackColor = true; - // - // label1 - // - this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label1.Location = new System.Drawing.Point(68, 9); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(263, 130); - this.label1.TabIndex = 2; - this.label1.Text = resources.GetString("label1.Text"); - // - // pictureBox1 - // - this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); - this.pictureBox1.Location = new System.Drawing.Point(12, 12); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(50, 50); - this.pictureBox1.TabIndex = 3; - this.pictureBox1.TabStop = false; - // - // frmWarningSplash - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(343, 227); - this.Controls.Add(this.pictureBox1); - this.Controls.Add(this.label1); - this.Controls.Add(this.chkSkipWarning); - this.Controls.Add(this.btnOK); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "frmWarningSplash"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "AgateLib Font Creator"; - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmWarningSplash)); + this.btnOK = new System.Windows.Forms.Button(); + this.chkSkipWarning = new System.Windows.Forms.CheckBox(); + this.label1 = new System.Windows.Forms.Label(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // btnOK + // + this.btnOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; + this.btnOK.Location = new System.Drawing.Point(141, 192); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(61, 23); + this.btnOK.TabIndex = 0; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler(this.btnOK_Click); + // + // chkSkipWarning + // + this.chkSkipWarning.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.chkSkipWarning.AutoSize = true; + this.chkSkipWarning.Location = new System.Drawing.Point(79, 169); + this.chkSkipWarning.Name = "chkSkipWarning"; + this.chkSkipWarning.Size = new System.Drawing.Size(184, 17); + this.chkSkipWarning.TabIndex = 1; + this.chkSkipWarning.Text = "Don\'t show me this warning again"; + this.chkSkipWarning.UseVisualStyleBackColor = true; + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label1.Location = new System.Drawing.Point(68, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(263, 130); + this.label1.TabIndex = 2; + this.label1.Text = resources.GetString("label1.Text"); + // + // pictureBox1 + // + this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); + this.pictureBox1.Location = new System.Drawing.Point(12, 12); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(50, 50); + this.pictureBox1.TabIndex = 3; + this.pictureBox1.TabStop = false; + // + // frmWarningSplash + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(343, 227); + this.Controls.Add(this.pictureBox1); + this.Controls.Add(this.label1); + this.Controls.Add(this.chkSkipWarning); + this.Controls.Add(this.btnOK); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "frmWarningSplash"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "AgateLib Font Creator"; + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); } Modified: trunk/Tools/FontCreator/frmWarningSplash.resx =================================================================== --- trunk/Tools/FontCreator/frmWarningSplash.resx 2009-10-19 17:07:10 UTC (rev 1060) +++ trunk/Tools/FontCreator/frmWarningSplash.resx 2009-10-19 17:09:33 UTC (rev 1061) @@ -120,8 +120,7 @@ <data name="label1.Text" xml:space="preserve"> <value>The font creator application takes system fonts and creates bitmap images from the font glyphs for redistribution and to ensure that text appearance is the same on all platforms. -Many fonts are not licensed for redistribution by end-users, or are licensed under terms which restrict their usage. It is your responsibility to make sure that you act in accordance with the license -s of any fonts you redistribute.</value> +Many fonts are not licensed for redistribution by end-users, or are licensed under terms which restrict their usage. It is your responsibility to make sure that you act in accordance with the licenses of any fonts you redistribute.</value> </data> <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-10-19 17:07:16
|
Revision: 1060 http://agate.svn.sourceforge.net/agate/?rev=1060&view=rev Author: kanato Date: 2009-10-19 17:07:10 +0000 (Mon, 19 Oct 2009) Log Message: ----------- Change versions to 0.3.2. Modified Paths: -------------- trunk/AgateLib/Properties/AssemblyInfo.cs trunk/Drivers/AgateDrawing/Properties/AssemblyInfo.cs trunk/Drivers/AgateFMOD/Properties/AssemblyInfo.cs trunk/Drivers/AgateLib.WinForms/Properties/AssemblyInfo.cs trunk/Drivers/AgateOTK/Properties/AssemblyInfo.cs trunk/Drivers/AgateSDL/Properties/AssemblyInfo.cs trunk/Drivers/AgateSDX/Properties/AssemblyInfo.cs trunk/Tests/Properties/AssemblyInfo.cs trunk/Tools/FontCreator/FontCreator.cs Modified: trunk/AgateLib/Properties/AssemblyInfo.cs =================================================================== --- trunk/AgateLib/Properties/AssemblyInfo.cs 2009-10-19 16:22:00 UTC (rev 1059) +++ trunk/AgateLib/Properties/AssemblyInfo.cs 2009-10-19 17:07:10 UTC (rev 1060) @@ -51,6 +51,6 @@ // Build Number // Revision // -[assembly: AssemblyVersion("0.3.1.0")] -[assembly: AssemblyFileVersion("0.3.1.0")] +[assembly: AssemblyVersion("0.3.2.0")] +[assembly: AssemblyFileVersion("0.3.2.0")] [assembly: NeutralResourcesLanguageAttribute("en")] Modified: trunk/Drivers/AgateDrawing/Properties/AssemblyInfo.cs =================================================================== --- trunk/Drivers/AgateDrawing/Properties/AssemblyInfo.cs 2009-10-19 16:22:00 UTC (rev 1059) +++ trunk/Drivers/AgateDrawing/Properties/AssemblyInfo.cs 2009-10-19 17:07:10 UTC (rev 1060) @@ -48,5 +48,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("0.3.1.0")] -[assembly: AssemblyFileVersion("0.3.1.0")] +[assembly: AssemblyVersion("0.3.2.0")] +[assembly: AssemblyFileVersion("0.3.2.0")] Modified: trunk/Drivers/AgateFMOD/Properties/AssemblyInfo.cs =================================================================== --- trunk/Drivers/AgateFMOD/Properties/AssemblyInfo.cs 2009-10-19 16:22:00 UTC (rev 1059) +++ trunk/Drivers/AgateFMOD/Properties/AssemblyInfo.cs 2009-10-19 17:07:10 UTC (rev 1060) @@ -49,5 +49,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("0.3.1.0")] -[assembly: AssemblyFileVersion("0.3.1.0")] +[assembly: AssemblyVersion("0.3.2.0")] +[assembly: AssemblyFileVersion("0.3.2.0")] Modified: trunk/Drivers/AgateLib.WinForms/Properties/AssemblyInfo.cs =================================================================== --- trunk/Drivers/AgateLib.WinForms/Properties/AssemblyInfo.cs 2009-10-19 16:22:00 UTC (rev 1059) +++ trunk/Drivers/AgateLib.WinForms/Properties/AssemblyInfo.cs 2009-10-19 17:07:10 UTC (rev 1060) @@ -49,5 +49,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("0.3.1.0")] -[assembly: AssemblyFileVersion("0.3.1.0")] +[assembly: AssemblyVersion("0.3.2.0")] +[assembly: AssemblyFileVersion("0.3.2.0")] Modified: trunk/Drivers/AgateOTK/Properties/AssemblyInfo.cs =================================================================== --- trunk/Drivers/AgateOTK/Properties/AssemblyInfo.cs 2009-10-19 16:22:00 UTC (rev 1059) +++ trunk/Drivers/AgateOTK/Properties/AssemblyInfo.cs 2009-10-19 17:07:10 UTC (rev 1060) @@ -47,5 +47,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("0.3.1.0")] -[assembly: AssemblyFileVersion("0.3.1.0")] +[assembly: AssemblyVersion("0.3.2.0")] +[assembly: AssemblyFileVersion("0.3.2.0")] Modified: trunk/Drivers/AgateSDL/Properties/AssemblyInfo.cs =================================================================== --- trunk/Drivers/AgateSDL/Properties/AssemblyInfo.cs 2009-10-19 16:22:00 UTC (rev 1059) +++ trunk/Drivers/AgateSDL/Properties/AssemblyInfo.cs 2009-10-19 17:07:10 UTC (rev 1060) @@ -49,5 +49,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("0.3.1.0")] -[assembly: AssemblyFileVersion("0.3.1.0")] +[assembly: AssemblyVersion("0.3.2.0")] +[assembly: AssemblyFileVersion("0.3.2.0")] Modified: trunk/Drivers/AgateSDX/Properties/AssemblyInfo.cs =================================================================== --- trunk/Drivers/AgateSDX/Properties/AssemblyInfo.cs 2009-10-19 16:22:00 UTC (rev 1059) +++ trunk/Drivers/AgateSDX/Properties/AssemblyInfo.cs 2009-10-19 17:07:10 UTC (rev 1060) @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("0.3.2.0")] +[assembly: AssemblyFileVersion("0.3.2.0")] Modified: trunk/Tests/Properties/AssemblyInfo.cs =================================================================== --- trunk/Tests/Properties/AssemblyInfo.cs 2009-10-19 16:22:00 UTC (rev 1059) +++ trunk/Tests/Properties/AssemblyInfo.cs 2009-10-19 17:07:10 UTC (rev 1060) @@ -29,5 +29,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("0.3.1.0")] -[assembly: AssemblyFileVersion("0.3.1.0")] +[assembly: AssemblyVersion("0.3.2.0")] +[assembly: AssemblyFileVersion("0.3.2.0")] Modified: trunk/Tools/FontCreator/FontCreator.cs =================================================================== --- trunk/Tools/FontCreator/FontCreator.cs 2009-10-19 16:22:00 UTC (rev 1059) +++ trunk/Tools/FontCreator/FontCreator.cs 2009-10-19 17:07:10 UTC (rev 1060) @@ -224,7 +224,7 @@ Display.Clear(); font.SetScale(mDisplayScale, mDisplayScale); - ((BitmapFontImpl)font.Impl).InterpolationHint = InterpolationMode.Fastest; + ((BitmapFontImpl)font.Impl).Surface.InterpolationHint = InterpolationMode.Fastest; DrawBackground(); DrawText(); @@ -237,7 +237,7 @@ Display.Clear(); font.SetScale(1.0, 1.0); - ((BitmapFontImpl)font.Impl).InterpolationHint = InterpolationMode.Nicest; + ((BitmapFontImpl)font.Impl).Surface.InterpolationHint = InterpolationMode.Nicest; DrawBackground(); DrawText(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-10-19 16:22:15
|
Revision: 1059 http://agate.svn.sourceforge.net/agate/?rev=1059&view=rev Author: kanato Date: 2009-10-19 16:22:00 +0000 (Mon, 19 Oct 2009) Log Message: ----------- Skip loading AgateSDX on non-Windows platforms. Modified Paths: -------------- trunk/AgateLib/Drivers/Registrar.cs Modified: trunk/AgateLib/Drivers/Registrar.cs =================================================================== --- trunk/AgateLib/Drivers/Registrar.cs 2009-10-19 16:21:19 UTC (rev 1058) +++ trunk/AgateLib/Drivers/Registrar.cs 2009-10-19 16:22:00 UTC (rev 1059) @@ -181,12 +181,12 @@ // this seems unnecessary in the current version of Mono. if ((Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == (PlatformID)128) && - System.IO.Path.GetFileName(file).ToLower().Contains("agatemdx.dll")) + (System.IO.Path.GetFileName(file).ToLower().Contains("agatemdx.dll") || + System.IO.Path.GetFileName(file).ToLower().Contains("agatesdx.dll"))) { Core.ErrorReporting.Report(ErrorLevel.Comment, - "DirectX not supported on Linux. Remove " - + System.IO.Path.GetFileName(file) + - " to eliminate this message.", null); + string.Format("DirectX not supported on non-Windows platforms. {0}Remove {1} to eliminate this message.", + Environment.NewLine, System.IO.Path.GetFileName(file)), null); return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-10-19 16:21:30
|
Revision: 1058 http://agate.svn.sourceforge.net/agate/?rev=1058&view=rev Author: kanato Date: 2009-10-19 16:21:19 +0000 (Mon, 19 Oct 2009) Log Message: ----------- Correct parsing of version string for VirtualBox's Chromium driver. Modified Paths: -------------- trunk/Drivers/AgateOTK/GL_Display.cs Modified: trunk/Drivers/AgateOTK/GL_Display.cs =================================================================== --- trunk/Drivers/AgateOTK/GL_Display.cs 2009-10-19 02:57:18 UTC (rev 1057) +++ trunk/Drivers/AgateOTK/GL_Display.cs 2009-10-19 16:21:19 UTC (rev 1058) @@ -429,7 +429,7 @@ private static decimal DetectOpenGLVersion() { - string versionString = GL.GetString(StringName.Version); + string versionString = GL.GetString(StringName.Version).Trim(); // Not sure whether OpenGL drivers will universally report version in the machine's // culture settings or not. So we switch the current decimal separator with a period. @@ -444,6 +444,12 @@ versionString = versionString.Substring(0, versionString.IndexOf(".", pointLoc + 1)); } + // Some drivers report a version like "2.0 Chromium 1", so dump everything after the space. + if (versionString.Contains(" ")) + { + versionString = versionString.Substring(0, versionString.IndexOf(" ")); + } + decimal retval; if (decimal.TryParse(versionString, System.Globalization.NumberStyles.Number, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-10-19 02:57:26
|
Revision: 1057 http://agate.svn.sourceforge.net/agate/?rev=1057&view=rev Author: kanato Date: 2009-10-19 02:57:18 +0000 (Mon, 19 Oct 2009) Log Message: ----------- Move error reporting stuff to Core.ErrorReporting class. Modified Paths: -------------- trunk/AgateLib/Core.cs trunk/AgateLib/Drivers/Registrar.cs trunk/AgateLib/Utility/FileSystemProvider.cs trunk/Drivers/AgateLib.WinForms/FormUtil.cs trunk/Drivers/AgateSDX/AgateSDX.csproj trunk/Tests/CoreTests/ErrorReport/frmErrorReport.cs Modified: trunk/AgateLib/Core.cs =================================================================== --- trunk/AgateLib/Core.cs 2009-10-19 02:50:27 UTC (rev 1056) +++ trunk/AgateLib/Core.cs 2009-10-19 02:57:18 UTC (rev 1057) @@ -72,7 +72,7 @@ None, /// <summary> - /// Outputs comments using Core.ReportError with a comment level. + /// Outputs comments using Core.Report with a comment level. /// </summary> Comment, @@ -90,9 +90,210 @@ private static bool mAutoPause = false; private static bool mIsActive = true; private static bool mInititalized = false; + + #region --- Error Reporting --- + private static CrossPlatformDebugLevel mCrossPlatform = CrossPlatformDebugLevel.Comment; private static System.Diagnostics.Stopwatch mTime = Stopwatch.StartNew(); + public static class ErrorReporting + { + + private static string mErrorFile = "errorlog.txt"; + private static bool mAutoStackTrace = false; + private static bool mWroteHeader = false; + + /// <summary> + /// Gets or sets the file name to which errors are recorded. Defaults + /// to "errorlog.txt" + /// </summary> + public static string ErrorFile + { + get { return mErrorFile; } + set { mErrorFile = value; } + } + + /// <summary> + /// Gets or sets whether or not a stack trace is automatically used. + /// </summary> + /// <example> + /// You may find it useful to turn this on during a debug build, and + /// then turn if off when building the release version. The following + /// code accomplishes that. + /// <code> + /// #if _DEBUG + /// AgateLib.Core.AutoStackTrace = true; + /// #endif + /// </code> + /// </example> + public static bool AutoStackTrace + { + get { return mAutoStackTrace; } + set { mAutoStackTrace = value; } + } + + /// <summary> + /// Gets or sets a value indicating how AgateLib should deal with issues that may + /// cause problems when porting to another platform. + /// </summary> + public static CrossPlatformDebugLevel CrossPlatformDebugLevel + { + get { return mCrossPlatform; } + set { mCrossPlatform = value; } + } + + /// <summary> + /// Saves an error message to the ErrorFile. + /// Outputs a stack trace and shows a dialog box if the ErrorLevel + /// is Bug or Fatal. + /// </summary> + /// <param name="message">A message to print out before the + /// exception's message.</param> + /// <param name="e"></param> + /// <param name="level"></param> + public static void Report(ErrorLevel level, string message, Exception e) + { + + switch (level) + { + case ErrorLevel.Bug: + case ErrorLevel.Fatal: + Report(level, message, e, true, true); + break; + + case ErrorLevel.Comment: + case ErrorLevel.Warning: + Report(level, message, e, AutoStackTrace, false); + break; + } + } + + /// <summary> + /// Saves an error message to the ErrorFile. + /// </summary> + /// <param name="message">A message to print out before the + /// exception's message.</param> + /// <param name="e"></param> + /// <param name="level"></param> + /// <param name="printStackTrace">Bool value indicating whether or not + /// a stack trace should be written out. </param> + /// <param name="showDialog">Bool value indicating whether or not a + /// message box should pop up with an OK button, informing the user about the + /// error. If false, the error is silently written to the ErrorFile.</param> + public static void Report(ErrorLevel level, string message, Exception e, bool printStackTrace, bool showDialog) + { + StringBuilder b = new StringBuilder(); + + b.Append(LevelText(level)); + b.Append(": "); + b.AppendLine(message); + + if (e != null) + { + b.Append(e.GetType().Name); + b.Append(": "); + b.AppendLine(e.Message); + + if (printStackTrace) + b.AppendLine(e.StackTrace); + } + + b.AppendLine(); + + string text = b.ToString(); + + // show the error dialog if AgateWinForms.dll is present. + if (showDialog && Drivers.Registrar.WinForms != null) + { + Drivers.Registrar.WinForms.ShowErrorDialog(message, e, level); + } + + using (StreamWriter filewriter = OpenErrorFile()) + { + if (filewriter != null) + filewriter.Write(text); + } + + Console.Write(text); + } + + /// <summary> + /// Reports a cross platform error, according to the setting of Core.CrossPlatformDebugLevel. + /// </summary> + /// <param name="message"></param> + public static void ReportCrossPlatformError(string message) + { + switch (CrossPlatformDebugLevel) + { + case CrossPlatformDebugLevel.Comment: + Report(ErrorLevel.Warning, message, null); + break; + + case CrossPlatformDebugLevel.Exception: + throw new AgateCrossPlatformException(message); + + } + } + + private static StreamWriter OpenErrorFile() + { + try + { + if (mWroteHeader == true) + { + FileStream stream = File.Open(ErrorFile, FileMode.Append, FileAccess.Write); + + return new StreamWriter(stream); + } + else + { + FileStream stream = File.Open(ErrorFile, FileMode.Create, FileAccess.Write); + StreamWriter writer = new StreamWriter(stream); + + WriteHeader(writer); + + mWroteHeader = true; + + return writer; + } + } + catch (Exception e) + { + string message = "Could not open file " + ErrorFile + ".\r\n" + + "Error message: " + e.Message + "\r\n" + + "Errors cannot be saved to a text file."; + + Console.WriteLine(message); + System.Diagnostics.Debug.WriteLine(message); + System.Diagnostics.Trace.WriteLine(message); + + return null; + } + } + + private static void WriteHeader(StreamWriter writer) + { + writer.WriteLine("Error Log started " + DateTime.Now.ToString()); + writer.WriteLine(""); + } + private static string LevelText(ErrorLevel level) + { + switch (level) + { + case ErrorLevel.Comment: return "COMMENT"; + case ErrorLevel.Warning: return "WARNING"; + case ErrorLevel.Fatal: return "ERROR"; + case ErrorLevel.Bug: return "BUG"; + } + + return "ERROR"; + } + + + } + + #endregion + static Core() { @@ -203,201 +404,7 @@ } } - #region --- Error Reporting --- - - private static string mErrorFile = "errorlog.txt"; - private static bool mAutoStackTrace = false; - private static bool mWroteHeader = false; - /// <summary> - /// Gets or sets the file name to which errors are recorded. Defaults - /// to "errorlog.txt" - /// </summary> - public static string ErrorFile - { - get { return Core.mErrorFile; } - set { Core.mErrorFile = value; } - } - - /// <summary> - /// Gets or sets whether or not a stack trace is automatically used. - /// </summary> - /// <example> - /// You may find it useful to turn this on during a debug build, and - /// then turn if off when building the release version. The following - /// code accomplishes that. - /// <code> - /// #if _DEBUG - /// AgateLib.Core.AutoStackTrace = true; - /// #endif - /// </code> - /// </example> - public static bool AutoStackTrace - { - get { return Core.mAutoStackTrace; } - set { Core.mAutoStackTrace = value; } - } - - /// <summary> - /// Saves an error message to the ErrorFile. - /// Outputs a stack trace and shows a dialog box if the ErrorLevel - /// is Bug or Fatal. - /// </summary> - /// <param name="message">A message to print out before the - /// exception's message.</param> - /// <param name="e"></param> - /// <param name="level"></param> - public static void ReportError(ErrorLevel level, string message, Exception e) - { - - switch (level) - { - case ErrorLevel.Bug: - case ErrorLevel.Fatal: - ReportError(level, message, e, true, true); - break; - - case ErrorLevel.Comment: - case ErrorLevel.Warning: - ReportError(level, message, e, AutoStackTrace, false); - break; - } - } - - /// <summary> - /// Saves an error message to the ErrorFile. - /// </summary> - /// <param name="message">A message to print out before the - /// exception's message.</param> - /// <param name="e"></param> - /// <param name="level"></param> - /// <param name="printStackTrace">Bool value indicating whether or not - /// a stack trace should be written out. </param> - /// <param name="showDialog">Bool value indicating whether or not a - /// message box should pop up with an OK button, informing the user about the - /// error. If false, the error is silently written to the ErrorFile.</param> - public static void ReportError(ErrorLevel level, string message, Exception e, bool printStackTrace, bool showDialog) - { - StringBuilder b = new StringBuilder(); - - b.Append(LevelText(level)); - b.Append(": "); - b.AppendLine(message); - - if (e != null) - { - b.Append(e.GetType().Name); - b.Append(": "); - b.AppendLine(e.Message); - - if (printStackTrace) - b.AppendLine(e.StackTrace); - } - - b.AppendLine(); - - string text = b.ToString(); - - // show the error dialog if AgateWinForms.dll is present. - if (showDialog && Drivers.Registrar.WinForms != null) - { - Drivers.Registrar.WinForms.ShowErrorDialog(message, e, level); - } - - using (StreamWriter filewriter = OpenErrorFile()) - { - if (filewriter != null) - filewriter.Write(text); - } - - Console.Write(text); - } - - private static StreamWriter OpenErrorFile() - { - try - { - if (mWroteHeader == true) - { - FileStream stream = File.Open(ErrorFile, FileMode.Append, FileAccess.Write); - - return new StreamWriter(stream); - } - else - { - FileStream stream = File.Open(ErrorFile, FileMode.Create, FileAccess.Write); - StreamWriter writer = new StreamWriter(stream); - - WriteHeader(writer); - - mWroteHeader = true; - - return writer; - } - } - catch (Exception e) - { - string message = "Could not open file " + ErrorFile + ".\r\n" + - "Error message: " + e.Message + "\r\n" + - "Errors cannot be saved to a text file."; - - Console.WriteLine(message); - System.Diagnostics.Debug.WriteLine(message); - System.Diagnostics.Trace.WriteLine(message); - - return null; - } - } - - private static void WriteHeader(StreamWriter writer) - { - writer.WriteLine("Error Log started " + DateTime.Now.ToString()); - writer.WriteLine(""); - } - private static string LevelText(ErrorLevel level) - { - switch (level) - { - case ErrorLevel.Comment: return "COMMENT"; - case ErrorLevel.Warning: return "WARNING"; - case ErrorLevel.Fatal: return "ERROR"; - case ErrorLevel.Bug: return "BUG"; - } - - return "ERROR"; - } - - /// <summary> - /// Gets or sets a value indicating how AgateLib should deal with issues that may - /// cause problems when porting to another platform. - /// </summary> - public static CrossPlatformDebugLevel CrossPlatformDebugLevel - { - get { return mCrossPlatform; } - set { mCrossPlatform = value; } - } - /// <summary> - /// Reports a cross platform error, according to the setting of Core.CrossPlatformDebugLevel. - /// </summary> - /// <param name="message"></param> - public static void ReportCrossPlatformError(string message) - { - switch (CrossPlatformDebugLevel) - { - case CrossPlatformDebugLevel.Comment: - ReportError(ErrorLevel.Warning, message, null); - break; - - case CrossPlatformDebugLevel.Exception: - throw new AgateCrossPlatformException(message); - - } - } - - - #endregion - - /// <summary> /// returns time since agatelib was initialized in milliseconds. /// </summary> /// <returns></returns> Modified: trunk/AgateLib/Drivers/Registrar.cs =================================================================== --- trunk/AgateLib/Drivers/Registrar.cs 2009-10-19 02:50:27 UTC (rev 1056) +++ trunk/AgateLib/Drivers/Registrar.cs 2009-10-19 02:57:18 UTC (rev 1057) @@ -120,7 +120,7 @@ break; default: - Core.ReportError(ErrorLevel.Warning, string.Format( + Core.ErrorReporting.Report(ErrorLevel.Warning, string.Format( "Could not interpret DriverType returned by type {0} in assembly {1}.", info.DriverTypeName, info.AssemblyFile), null); @@ -183,7 +183,7 @@ Environment.OSVersion.Platform == (PlatformID)128) && System.IO.Path.GetFileName(file).ToLower().Contains("agatemdx.dll")) { - Core.ReportError(ErrorLevel.Comment, + Core.ErrorReporting.Report(ErrorLevel.Comment, "DirectX not supported on Linux. Remove " + System.IO.Path.GetFileName(file) + " to eliminate this message.", null); @@ -413,7 +413,7 @@ private static Assembly LoadAssemblyLoadFrom(AgateDriverInfo info) { - Core.ReportError(ErrorLevel.Warning, + Core.ErrorReporting.Report(ErrorLevel.Warning, string.Format("Assembly {0} was loaded in the LoadFrom context. Move it to the application directory to load in the Load context.", info.AssemblyName), null); return Assembly.LoadFrom(info.AssemblyFile); } Modified: trunk/AgateLib/Utility/FileSystemProvider.cs =================================================================== --- trunk/AgateLib/Utility/FileSystemProvider.cs 2009-10-19 02:50:27 UTC (rev 1056) +++ trunk/AgateLib/Utility/FileSystemProvider.cs 2009-10-19 02:57:18 UTC (rev 1057) @@ -87,7 +87,7 @@ if (File.Exists(path) == false) return null; - if (Core.CrossPlatformDebugLevel != CrossPlatformDebugLevel.Comment) + if (Core.ErrorReporting.CrossPlatformDebugLevel != CrossPlatformDebugLevel.Comment) { string[] files = Directory.GetFiles(mPath); string badMatch = ""; @@ -110,12 +110,12 @@ } if (matchCount > 1) - Core.ReportCrossPlatformError( + Core.ErrorReporting.ReportCrossPlatformError( "The file " + filename + " located in directory \"" + mPath + "\"" + " has multiple case-insensitive matches. This will present problems " + "when porting to an operating system with a case-insensitive filesystem (eg. Windows, MacOS)."); if (badCaseMatch) - Core.ReportCrossPlatformError( + Core.ErrorReporting.ReportCrossPlatformError( "The search file " + filename + " does not have an exact case match in directory \"" + mPath + "\". The closest match was " + badMatch + ". This will present problems when porting to an operating system " + @@ -146,7 +146,7 @@ string text = b.ToString(); - Core.ReportCrossPlatformError(text); + Core.ErrorReporting.ReportCrossPlatformError(text); } /// <summary> Modified: trunk/Drivers/AgateLib.WinForms/FormUtil.cs =================================================================== --- trunk/Drivers/AgateLib.WinForms/FormUtil.cs 2009-10-19 02:50:27 UTC (rev 1056) +++ trunk/Drivers/AgateLib.WinForms/FormUtil.cs 2009-10-19 02:57:18 UTC (rev 1057) @@ -111,7 +111,7 @@ } catch (System.Resources.MissingManifestResourceException e) { - AgateLib.Core.ReportError(ErrorLevel.Warning, + AgateLib.Core.ErrorReporting.Report(ErrorLevel.Warning, "Caught a MissingManifestResourceException when looking for the AgateLib Icon. " + "This indicates a problem with the way resources were embedded into AgateLib.WinForms.dll when it was built.", e); Modified: trunk/Drivers/AgateSDX/AgateSDX.csproj =================================================================== --- trunk/Drivers/AgateSDX/AgateSDX.csproj 2009-10-19 02:50:27 UTC (rev 1056) +++ trunk/Drivers/AgateSDX/AgateSDX.csproj 2009-10-19 02:57:18 UTC (rev 1057) @@ -3,7 +3,7 @@ <ProjectType>Local</ProjectType> <ProductVersion>9.0.30729</ProductVersion> <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{BC71081A-124D-4675-9ECE-92450189EC75}</ProjectGuid> + <ProjectGuid>{489A4486-7435-4949-BECB-136E6288C35D}</ProjectGuid> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ApplicationIcon> @@ -89,18 +89,6 @@ </Reference> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\..\AgateLib\AgateLib.csproj"> - <Name>AgateLib</Name> - <Project>{CCAE9D71-50DF-4B75-91AE-D9552A9A8353}</Project> - <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> - </ProjectReference> - <ProjectReference Include="..\AgateLib.WinForms\AgateLib.WinForms.csproj"> - <Name>AgateLib.WinForms</Name> - <Project>{B874EDC7-C67D-4C45-A2B7-A41FDD898A02}</Project> - <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> - </ProjectReference> - </ItemGroup> - <ItemGroup> <Compile Include="D3DDevice.cs"> <SubType>Code</SubType> </Compile> @@ -164,6 +152,16 @@ <DependentUpon>frmFullScreen.cs</DependentUpon> </EmbeddedResource> </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\AgateLib\AgateLib.csproj"> + <Project>{5BE2B3C1-F0A0-4732-9499-41AE50CC4C48}</Project> + <Name>AgateLib</Name> + </ProjectReference> + <ProjectReference Include="..\AgateLib.WinForms\AgateLib.WinForms.csproj"> + <Project>{CD71274E-9AF0-42FC-ADC8-FE35D3274C61}</Project> + <Name>AgateLib.WinForms</Name> + </ProjectReference> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> <PropertyGroup> <PreBuildEvent> Modified: trunk/Tests/CoreTests/ErrorReport/frmErrorReport.cs =================================================================== --- trunk/Tests/CoreTests/ErrorReport/frmErrorReport.cs 2009-10-19 02:50:27 UTC (rev 1056) +++ trunk/Tests/CoreTests/ErrorReport/frmErrorReport.cs 2009-10-19 02:57:18 UTC (rev 1057) @@ -27,7 +27,7 @@ private static void GenerateErrors() { - AgateLib.Core.ReportError(ErrorLevel.Comment, "Test comment about application condition", null); + AgateLib.Core.ErrorReporting.Report(ErrorLevel.Comment, "Test comment about application condition", null); try { @@ -35,7 +35,7 @@ } catch (Exception e) { - AgateLib.Core.ReportError(ErrorLevel.Warning, "File not there.", e); + AgateLib.Core.ErrorReporting.Report(ErrorLevel.Warning, "File not there.", e); } try @@ -44,7 +44,7 @@ } catch (Exception e) { - AgateLib.Core.ReportError(ErrorLevel.Fatal, "Missing file", e); + AgateLib.Core.ErrorReporting.Report(ErrorLevel.Fatal, "Missing file", e); } try @@ -53,7 +53,7 @@ } catch (Exception e) { - AgateLib.Core.ReportError(ErrorLevel.Bug, "Oops, a bug.", e); + AgateLib.Core.ErrorReporting.Report(ErrorLevel.Bug, "Oops, a bug.", e); } // unhandled error @@ -62,7 +62,7 @@ private void FillTextBox() { - System.IO.TextReader r = new System.IO.StreamReader(AgateLib.Core.ErrorFile); + System.IO.TextReader r = new System.IO.StreamReader(AgateLib.Core.ErrorReporting.ErrorFile); textBox1.Text = r.ReadToEnd(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-10-19 02:50:35
|
Revision: 1056 http://agate.svn.sourceforge.net/agate/?rev=1056&view=rev Author: kanato Date: 2009-10-19 02:50:27 +0000 (Mon, 19 Oct 2009) Log Message: ----------- Delete unnecessary IDisplayCaps.cs file. Removed Paths: ------------- trunk/AgateLib/ImplementationBase/IDisplayCaps.cs Deleted: trunk/AgateLib/ImplementationBase/IDisplayCaps.cs =================================================================== --- trunk/AgateLib/ImplementationBase/IDisplayCaps.cs 2009-10-19 02:44:39 UTC (rev 1055) +++ trunk/AgateLib/ImplementationBase/IDisplayCaps.cs 2009-10-19 02:50:27 UTC (rev 1056) @@ -1,93 +0,0 @@ -// The contents of this file are subject to the Mozilla Public License -// Version 1.1 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://www.mozilla.org/MPL/ -// -// Software distributed under the License is distributed on an "AS IS" -// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -// License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is AgateLib. -// -// The Initial Developer of the Original Code is Erik Ylvisaker. -// Portions created by Erik Ylvisaker are Copyright (C) 2006-2009. -// All Rights Reserved. -// -// Contributor(s): Erik Ylvisaker -// -using System; -using System.Collections.Generic; -using System.Text; - -namespace AgateLib.ImplementationBase -{ - /// <summary> - /// Interface which allows querying of Display capabilities. - /// </summary> - public interface IDisplayCaps - { - /// <summary> - /// Indicates whether or not full screen windows can be created. - /// </summary> - bool SupportsFullScreen { get; } - /// <summary> - /// Indicates whether or not the screen resolution can be changed. - /// If the Display driver supports full screen but not mode switching, - /// then a DisplayWindow which is created with as a full screen window - /// cannot change resolutions after it is initially set. - /// </summary> - bool SupportsFullScreenModeSwitching { get; } - /// <summary> - /// - Indicates whether setting Surface.SetScale has any visible effect. - /// </summary> - bool SupportsScaling { get; } - /// <summary> - /// Indicates whether setting Surface.RotationAngle has any visible effect. - /// </summary> - bool SupportsRotation { get; } - /// <summary> - /// Indicates whether setting Surface.Color has any visible effect. - /// </summary> - bool SupportsColor { get; } - /// <summary> - /// Indicates whether Surface gradients are supported. If not, then setting Surface.ColorGradient - /// color of a surface is the same as setting the Surface.Color with the average of the - /// gradient colors. - /// </summary> - bool SupportsGradient { get; } - /// <summary> - /// Indicates whether setting Surface.Alpha has any visible effect. - /// </summary> - bool SupportsSurfaceAlpha { get; } - /// <summary> - /// Indicates whether the alpha channel in surface pixels is used. - /// </summary> - bool SupportsPixelAlpha { get; } - /// <summary> - /// Indicates whether or not lighting is supported. - /// </summary> - bool SupportsLighting { get; } - /// <summary> - /// Indicates the maximum number of lights which can be used. - /// </summary> - int MaxLights { get; } - /// <summary> - /// Indicates whether there is hardware acceleration available for 2D and 3D drawing. - /// </summary> - bool IsHardwareAccelerated { get; } - /// <summary> - /// Indicates whether or not vertex/pixel shaders are supported. - /// </summary> - bool SupportsShaders { get; } - /// <summary> - /// Indicates which shader language is supported. - /// </summary> - AgateLib.DisplayLib.Shaders.ShaderLanguage ShaderLanguage { get; } - /// <summary> - /// Indicates whether the driver can create a bitmap font from an operating - /// system font. - /// </summary> - bool CanCreateBitmapFont { get; } - } -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-10-19 02:44:47
|
Revision: 1055 http://agate.svn.sourceforge.net/agate/?rev=1055&view=rev Author: kanato Date: 2009-10-19 02:44:39 +0000 (Mon, 19 Oct 2009) Log Message: ----------- Rename AgateApplication to AgateGame. Modified Paths: -------------- trunk/Tests/CoreTests/App.cs trunk/Tests/DisplayTests/BasicSprite.cs trunk/Tests/DisplayTests/Interpolation.cs trunk/Tests/Fonts/TextLayout.cs trunk/Tests/InputTests/InputState/InputStateTester.cs trunk/Tests/WinFormsTests/Converters.cs Added Paths: ----------- trunk/AgateLib/AgateGame.cs Removed Paths: ------------- trunk/AgateLib/AgateApplication.cs Deleted: trunk/AgateLib/AgateApplication.cs =================================================================== --- trunk/AgateLib/AgateApplication.cs 2009-10-19 02:39:01 UTC (rev 1054) +++ trunk/AgateLib/AgateApplication.cs 2009-10-19 02:44:39 UTC (rev 1055) @@ -1,309 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using AgateLib.Geometry; -using AgateLib.DisplayLib; - -namespace AgateLib -{ - /// <summary> - /// Application framework for a game. Using AgateApplication can simplify the application - /// source code and start up. - /// </summary> - /// <example> - /// <code> - /// using AgateLib; - /// - /// namespace MyApplication - /// { - /// class MyApp : AgateApplication - /// { - /// public static void Main(string[] args) - /// { - /// new MyApp().Run(args); - /// } - /// - /// protected override void Initialize() - /// { - /// // do any needed initialization, loading of surfaces, etc. here. - /// } - /// protected override void Update(double time_ms) - /// { - /// // update game logic here. - /// } - /// protected override void Render() - /// { - /// // render game here. - /// } - /// } - /// } - /// </code> - /// </example> - public class AgateApplication - { - DisplayWindow mWindow; - AppInitParameters mInitParams; - FontSurface font; - - double totalSplashTime = 0; - bool splashFadeDone = false; - - #region --- Run Method --- - - /// <summary> - /// Runs the application. - /// </summary> - /// <returns></returns> - public int Run() - { - return Run(null); - } - /// <summary> - /// Runs the application. - /// </summary> - /// <param name="args"></param> - /// <returns></returns> - public int Run(string[] args) - { - using (AgateSetup setup = new AgateSetup(args)) - { - setup.PreferredDisplay = InitParams.PreferredDisplay; - setup.PreferredAudio = InitParams.PreferredAudio; - setup.PreferredInput = InitParams.PreferredInput; - - setup.Initialize( - InitParams.InitializeDisplay, - InitParams.InitializeAudio, - InitParams.InitializeJoysticks); - - if (setup.WasCanceled) - return 1; - - CreateDisplayWindow(); - - font = new FontSurface("Arial", 12.0f); - - if (InitParams.ShowSplashScreen) - { - DoSplash(); - } - - Initialize(); - - while (MainWindow.IsClosed == false) - { - Update(Display.DeltaTime); - - Display.RenderTarget = mWindow; - Display.BeginFrame(); - - Render(); - - Display.EndFrame(); - Core.KeepAlive(); - } - } - - return 0; - } - - private AppInitParameters InitParams - { - get - { - mInitParams = mInitParams ?? GetAppInitParameters(); - return mInitParams; - } - } - - #endregion - #region --- Initialization --- - - /// <summary> - /// Override Initialize() to do any needed initialization for your application, - /// such as creating <see cref="AgateLib.DisplayLib.Surface">Surface</see> objects. - /// </summary> - protected virtual void Initialize() - { - } - - private void CreateDisplayWindow() - { - CreateWindowParams windp; - - if (FullScreen) - { - windp = CreateWindowParams.FullScreen(ApplicationTitle, - WindowSize.Width, WindowSize.Height, 32); - - windp.IconFile = InitParams.IconFile; - } - else - { - windp = CreateWindowParams.Windowed(ApplicationTitle, - WindowSize.Width, WindowSize.Height, - InitParams.AllowResize, InitParams.IconFile); - } - - mWindow = new DisplayWindow(windp); - } - - #endregion - #region --- Rendering and Updating --- - - /// <summary> - /// Override this method to update your game logic. - /// </summary> - /// <param name="time_ms">The amount of time that has passed since the last - /// update, in milliseconds.</param> - protected virtual void Update(double time_ms) - { - - } - - /// <summary> - /// Override this method to render your game. - /// Do not call Display.BeginFrame or Display.EndFrame. - /// </summary> - /// <remarks>Do not call Display.BeginFrame or Display.EndFrame or change - /// render targets in this method.</remarks> - protected virtual void Render() - { - RenderSplashScreen(); - - if (splashFadeDone) - { - Surface powered = InternalResources.Data.PoweredBy; - Size size = powered.SurfaceSize; - - int bottom = MainWindow.Height - size.Height; - int h = font.FontHeight; - - font.DisplayAlignment = OriginAlignment.BottomLeft; - font.Color = Color.Black; - - font.DrawText(0, bottom - 2 * h, "Welcome to AgateLib."); - font.DrawText(0, bottom - h, "Your application framework is ready."); - font.DrawText(0, bottom, "Override the Render method in order to do your own drawing."); - } - } - - #endregion - #region --- Splash Screen --- - - private void DoSplash() - { - while (UpdateSplashScreen(Display.DeltaTime) == true) - { - Display.BeginFrame(); - - RenderSplashScreen(); - - Display.EndFrame(); - Core.KeepAlive(); - - System.Threading.Thread.Sleep(0); - - if (MainWindow.IsClosed) - return; - } - } - - /// <summary> - /// Override this method to update the logic for a custom splash screen, - /// if there are any animations. - /// Return false to cancel the splash screen and move on. - /// </summary> - /// <param name="time_ms"></param> - protected virtual bool UpdateSplashScreen(double time_ms) - { - totalSplashTime += time_ms / 1000.0; - - if (totalSplashTime > 3.0) - return false; - else - return true; - } - /// <summary> - /// Override this method to provide a custom splash screen. This method - /// is called before the Initialize method is called. - /// </summary> - /// <param name="time_ms"></param> - protected virtual void RenderSplashScreen() - { - Display.Clear(Color.White); - - Surface powered = InternalResources.Data.PoweredBy; - Size size = powered.SurfaceSize; - - int left = (int)(totalSplashTime * size.Width - size.Width)+1; - Rectangle gradientRect = new Rectangle(left, MainWindow.Height - size.Height, - size.Width, size.Height); - - if (left < 0) - Display.PushClipRect(gradientRect); - else if (left > size.Width) - splashFadeDone = true; - - powered.DisplayAlignment = OriginAlignment.BottomLeft; - powered.Draw(0, MainWindow.Height); - - Gradient g = new Gradient( - Color.FromArgb(0, Color.White), - Color.White, - Color.FromArgb(0, Color.White), - Color.White); - - Display.FillRect(gradientRect, g); - if (left < 0) - { - Display.PopClipRect(); - } - } - - #endregion - - #region --- Virtual Properties --- - - /// <summary> - /// Override this to set the title of the window which is created. - /// </summary> - protected virtual string ApplicationTitle - { - get { return "AgateLib Application"; } - } - /// <summary> - /// Gets the initialization parameters. - /// </summary> - /// <returns></returns> - protected virtual AppInitParameters GetAppInitParameters() - { - return new AppInitParameters(); - } - - protected virtual Size WindowSize { get { return new Size(800, 600); } } - protected virtual bool FullScreen { get { return false; } } - - #endregion - #region --- Public Properties --- - - /// <summary> - /// Gets the main display window. - /// </summary> - public DisplayWindow MainWindow - { - get { return mWindow; } - } - - #endregion - - /// <summary> - /// Closes the main window. - /// </summary> - public void Quit() - { - MainWindow.Dispose(); - } - } -} Copied: trunk/AgateLib/AgateGame.cs (from rev 1049, trunk/AgateLib/AgateApplication.cs) =================================================================== --- trunk/AgateLib/AgateGame.cs (rev 0) +++ trunk/AgateLib/AgateGame.cs 2009-10-19 02:44:39 UTC (rev 1055) @@ -0,0 +1,309 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using AgateLib.Geometry; +using AgateLib.DisplayLib; + +namespace AgateLib +{ + /// <summary> + /// Application framework for a game. Using AgateGame can simplify the application + /// source code and start up. + /// </summary> + /// <example> + /// <code> + /// using AgateLib; + /// + /// namespace MyApplication + /// { + /// class MyApp : AgateGame + /// { + /// public static void Main(string[] args) + /// { + /// new MyApp().Run(args); + /// } + /// + /// protected override void Initialize() + /// { + /// // do any needed initialization, loading of surfaces, etc. here. + /// } + /// protected override void Update(double time_ms) + /// { + /// // update game logic here. + /// } + /// protected override void Render() + /// { + /// // render game here. + /// } + /// } + /// } + /// </code> + /// </example> + public class AgateGame + { + DisplayWindow mWindow; + AppInitParameters mInitParams; + FontSurface font; + + double totalSplashTime = 0; + bool splashFadeDone = false; + + #region --- Run Method --- + + /// <summary> + /// Runs the application. + /// </summary> + /// <returns></returns> + public int Run() + { + return Run(null); + } + /// <summary> + /// Runs the application. + /// </summary> + /// <param name="args"></param> + /// <returns></returns> + public int Run(string[] args) + { + using (AgateSetup setup = new AgateSetup(args)) + { + setup.PreferredDisplay = InitParams.PreferredDisplay; + setup.PreferredAudio = InitParams.PreferredAudio; + setup.PreferredInput = InitParams.PreferredInput; + + setup.Initialize( + InitParams.InitializeDisplay, + InitParams.InitializeAudio, + InitParams.InitializeJoysticks); + + if (setup.WasCanceled) + return 1; + + CreateDisplayWindow(); + + font = new FontSurface("Arial", 12.0f); + + if (InitParams.ShowSplashScreen) + { + DoSplash(); + } + + Initialize(); + + while (MainWindow.IsClosed == false) + { + Update(Display.DeltaTime); + + Display.RenderTarget = mWindow; + Display.BeginFrame(); + + Render(); + + Display.EndFrame(); + Core.KeepAlive(); + } + } + + return 0; + } + + private AppInitParameters InitParams + { + get + { + mInitParams = mInitParams ?? GetAppInitParameters(); + return mInitParams; + } + } + + #endregion + #region --- Initialization --- + + /// <summary> + /// Override Initialize() to do any needed initialization for your application, + /// such as creating <see cref="AgateLib.DisplayLib.Surface">Surface</see> objects. + /// </summary> + protected virtual void Initialize() + { + } + + private void CreateDisplayWindow() + { + CreateWindowParams windp; + + if (FullScreen) + { + windp = CreateWindowParams.FullScreen(ApplicationTitle, + WindowSize.Width, WindowSize.Height, 32); + + windp.IconFile = InitParams.IconFile; + } + else + { + windp = CreateWindowParams.Windowed(ApplicationTitle, + WindowSize.Width, WindowSize.Height, + InitParams.AllowResize, InitParams.IconFile); + } + + mWindow = new DisplayWindow(windp); + } + + #endregion + #region --- Rendering and Updating --- + + /// <summary> + /// Override this method to update your game logic. + /// </summary> + /// <param name="time_ms">The amount of time that has passed since the last + /// update, in milliseconds.</param> + protected virtual void Update(double time_ms) + { + + } + + /// <summary> + /// Override this method to render your game. + /// Do not call Display.BeginFrame or Display.EndFrame. + /// </summary> + /// <remarks>Do not call Display.BeginFrame or Display.EndFrame or change + /// render targets in this method.</remarks> + protected virtual void Render() + { + RenderSplashScreen(); + + if (splashFadeDone) + { + Surface powered = InternalResources.Data.PoweredBy; + Size size = powered.SurfaceSize; + + int bottom = MainWindow.Height - size.Height; + int h = font.FontHeight; + + font.DisplayAlignment = OriginAlignment.BottomLeft; + font.Color = Color.Black; + + font.DrawText(0, bottom - 2 * h, "Welcome to AgateLib."); + font.DrawText(0, bottom - h, "Your application framework is ready."); + font.DrawText(0, bottom, "Override the Render method in order to do your own drawing."); + } + } + + #endregion + #region --- Splash Screen --- + + private void DoSplash() + { + while (UpdateSplashScreen(Display.DeltaTime) == true) + { + Display.BeginFrame(); + + RenderSplashScreen(); + + Display.EndFrame(); + Core.KeepAlive(); + + System.Threading.Thread.Sleep(0); + + if (MainWindow.IsClosed) + return; + } + } + + /// <summary> + /// Override this method to update the logic for a custom splash screen, + /// if there are any animations. + /// Return false to cancel the splash screen and move on. + /// </summary> + /// <param name="time_ms"></param> + protected virtual bool UpdateSplashScreen(double time_ms) + { + totalSplashTime += time_ms / 1000.0; + + if (totalSplashTime > 3.0) + return false; + else + return true; + } + /// <summary> + /// Override this method to provide a custom splash screen. This method + /// is called before the Initialize method is called. + /// </summary> + /// <param name="time_ms"></param> + protected virtual void RenderSplashScreen() + { + Display.Clear(Color.White); + + Surface powered = InternalResources.Data.PoweredBy; + Size size = powered.SurfaceSize; + + int left = (int)(totalSplashTime * size.Width - size.Width)+1; + Rectangle gradientRect = new Rectangle(left, MainWindow.Height - size.Height, + size.Width, size.Height); + + if (left < 0) + Display.PushClipRect(gradientRect); + else if (left > size.Width) + splashFadeDone = true; + + powered.DisplayAlignment = OriginAlignment.BottomLeft; + powered.Draw(0, MainWindow.Height); + + Gradient g = new Gradient( + Color.FromArgb(0, Color.White), + Color.White, + Color.FromArgb(0, Color.White), + Color.White); + + Display.FillRect(gradientRect, g); + if (left < 0) + { + Display.PopClipRect(); + } + } + + #endregion + + #region --- Virtual Properties --- + + /// <summary> + /// Override this to set the title of the window which is created. + /// </summary> + protected virtual string ApplicationTitle + { + get { return "AgateLib Application"; } + } + /// <summary> + /// Gets the initialization parameters. + /// </summary> + /// <returns></returns> + protected virtual AppInitParameters GetAppInitParameters() + { + return new AppInitParameters(); + } + + protected virtual Size WindowSize { get { return new Size(800, 600); } } + protected virtual bool FullScreen { get { return false; } } + + #endregion + #region --- Public Properties --- + + /// <summary> + /// Gets the main display window. + /// </summary> + public DisplayWindow MainWindow + { + get { return mWindow; } + } + + #endregion + + /// <summary> + /// Closes the main window. + /// </summary> + public void Quit() + { + MainWindow.Dispose(); + } + } +} Modified: trunk/Tests/CoreTests/App.cs =================================================================== --- trunk/Tests/CoreTests/App.cs 2009-10-19 02:39:01 UTC (rev 1054) +++ trunk/Tests/CoreTests/App.cs 2009-10-19 02:44:39 UTC (rev 1055) @@ -5,7 +5,7 @@ namespace Tests.AppTester { - class App : AgateApplication, IAgateTest + class App : AgateGame, IAgateTest { public void Main(string[] args) { Modified: trunk/Tests/DisplayTests/BasicSprite.cs =================================================================== --- trunk/Tests/DisplayTests/BasicSprite.cs 2009-10-19 02:39:01 UTC (rev 1054) +++ trunk/Tests/DisplayTests/BasicSprite.cs 2009-10-19 02:44:39 UTC (rev 1055) @@ -9,7 +9,7 @@ namespace Tests.DisplayTests { - class BasicSprite : AgateApplication, IAgateTest + class BasicSprite : AgateGame, IAgateTest { #region IAgateTest Members Modified: trunk/Tests/DisplayTests/Interpolation.cs =================================================================== --- trunk/Tests/DisplayTests/Interpolation.cs 2009-10-19 02:39:01 UTC (rev 1054) +++ trunk/Tests/DisplayTests/Interpolation.cs 2009-10-19 02:44:39 UTC (rev 1055) @@ -8,7 +8,7 @@ namespace Tests.DisplayTests { - class Interpolation : AgateLib.AgateApplication, IAgateTest + class Interpolation : AgateLib.AgateGame, IAgateTest { #region IAgateTest Members Modified: trunk/Tests/Fonts/TextLayout.cs =================================================================== --- trunk/Tests/Fonts/TextLayout.cs 2009-10-19 02:39:01 UTC (rev 1054) +++ trunk/Tests/Fonts/TextLayout.cs 2009-10-19 02:44:39 UTC (rev 1055) @@ -7,7 +7,7 @@ namespace Tests.Fonts.TextLayout { - class TextLayout : AgateApplication, IAgateTest + class TextLayout : AgateGame, IAgateTest { /// <summary> /// The main entry point for the application. Modified: trunk/Tests/InputTests/InputState/InputStateTester.cs =================================================================== --- trunk/Tests/InputTests/InputState/InputStateTester.cs 2009-10-19 02:39:01 UTC (rev 1054) +++ trunk/Tests/InputTests/InputState/InputStateTester.cs 2009-10-19 02:44:39 UTC (rev 1055) @@ -10,7 +10,7 @@ namespace Tests.InputStateTester { - class InputStateTester : AgateApplication + class InputStateTester : AgateGame { #region IAgateTest Members Modified: trunk/Tests/WinFormsTests/Converters.cs =================================================================== --- trunk/Tests/WinFormsTests/Converters.cs 2009-10-19 02:39:01 UTC (rev 1054) +++ trunk/Tests/WinFormsTests/Converters.cs 2009-10-19 02:44:39 UTC (rev 1055) @@ -9,7 +9,7 @@ namespace Tests.WinFormsTests { - class Converters : AgateApplication, IAgateTest + class Converters : AgateGame, IAgateTest { public string Name { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-10-19 02:39:09
|
Revision: 1054 http://agate.svn.sourceforge.net/agate/?rev=1054&view=rev Author: kanato Date: 2009-10-19 02:39:01 +0000 (Mon, 19 Oct 2009) Log Message: ----------- Roll back OpenTK version to 0.9.6. Modified Paths: -------------- trunk/Drivers/AgateOTK/GL_Display.cs trunk/Drivers/AgateOTK/GL_DisplayControl.cs trunk/Drivers/AgateOTK/OpenTK.Utilities.dll trunk/Drivers/AgateOTK/OpenTK.dll trunk/Drivers/AgateOTK/OpenTK.xml Modified: trunk/Drivers/AgateOTK/GL_Display.cs =================================================================== --- trunk/Drivers/AgateOTK/GL_Display.cs 2009-10-19 02:03:19 UTC (rev 1053) +++ trunk/Drivers/AgateOTK/GL_Display.cs 2009-10-19 02:39:01 UTC (rev 1054) @@ -511,7 +511,7 @@ GL.Enable(EnableCap.Lighting); SetArray(array, lights.Ambient); - GL.LightModel(LightModelParameter.LightModelAmbient, array); + GL.LightModelv(LightModelParameter.LightModelAmbient, array); GL.Enable(EnableCap.ColorMaterial); GL.ColorMaterial(MaterialFace.FrontAndBack, @@ -537,13 +537,13 @@ GL.Enable(lightID); SetArray(array, lights[i].Diffuse); - GL.Light(lightName, LightParameter.Diffuse, array); + GL.Lightv(lightName, LightParameter.Diffuse, array); SetArray(array, lights[i].Ambient); - GL.Light(lightName, LightParameter.Ambient, array); + GL.Lightv(lightName, LightParameter.Ambient, array); SetArray(array, lights[i].Position); - GL.Light(lightName, LightParameter.Position, array); + GL.Lightv(lightName, LightParameter.Position, array); GL.Light(lightName, LightParameter.ConstantAttenuation, lights[i].AttenuationConstant); GL.Light(lightName, LightParameter.LinearAttenuation, lights[i].AttenuationLinear); Modified: trunk/Drivers/AgateOTK/GL_DisplayControl.cs =================================================================== --- trunk/Drivers/AgateOTK/GL_DisplayControl.cs 2009-10-19 02:03:19 UTC (rev 1053) +++ trunk/Drivers/AgateOTK/GL_DisplayControl.cs 2009-10-19 02:39:01 UTC (rev 1054) @@ -206,10 +206,11 @@ Debug.Print("AgateLib GraphicsMode: {0}", newMode); - mWindowInfo = OpenTK.Platform.Utilities.CreateWindowInfo(newMode, mRenderTarget); + //mWindowInfo = OpenTK.Platform.Utilities.CreateWindowInfo(newMode, mRenderTarget); - mContext = OpenTK.Platform.Utilities.CreateGraphicsContext( - newMode, mWindowInfo, 3, 1, GraphicsContextFlags.Default); + //mContext = OpenTK.Platform.Utilities.CreateGraphicsContext( + // newMode, mWindowInfo, 3, 1, GraphicsContextFlags.Default); + OpenTK.Platform.Utilities.CreateGraphicsContext(newMode, mRenderTarget, out mContext, out mWindowInfo); } Modified: trunk/Drivers/AgateOTK/OpenTK.Utilities.dll =================================================================== (Binary files differ) Modified: trunk/Drivers/AgateOTK/OpenTK.dll =================================================================== (Binary files differ) Modified: trunk/Drivers/AgateOTK/OpenTK.xml =================================================================== --- trunk/Drivers/AgateOTK/OpenTK.xml 2009-10-19 02:03:19 UTC (rev 1053) +++ trunk/Drivers/AgateOTK/OpenTK.xml 2009-10-19 02:39:01 UTC (rev 1054) @@ -3656,12 +3656,6 @@ <member name="P:OpenTK.Graphics.IGraphicsContext.GraphicsMode"> <summary>Gets the GraphicsMode of this instance.</summary> </member> - <member name="P:OpenTK.Graphics.IGraphicsContext.ErrorChecking"> - <summary> - Gets or sets a System.Boolean, indicating whether automatic error checking should be performed. - Influences the debug version of OpenTK.dll, only. - </summary> - </member> <member name="T:OpenTK.Graphics.IGraphicsContextInternal"> <summary> Provides methods to create new GraphicsContexts. Should only be used for extending OpenTK. @@ -3840,14 +3834,6 @@ </para> </remarks> </member> - <member name="P:OpenTK.Graphics.GraphicsContext.ErrorChecking"> - <summary> - Gets or sets a System.Boolean, indicating whether automatic error checking should be performed. - Influences the debug version of OpenTK.dll, only. - </summary> - <remarks>Automatic error checking will clear the OpenGL error state. Set CheckErrors to false if you use - the OpenGL error state in your code flow (e.g. for checking supported texture formats).</remarks> - </member> <member name="P:OpenTK.Graphics.GraphicsContext.IsCurrent"> <summary> Gets a System.Boolean indicating whether this Context is current in the calling thread. @@ -23274,7 +23260,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.BlendEquationSeparate(OpenTK.Graphics.BlendEquationMode,OpenTK.Graphics.BlendEquationMode)"> + <member name="M:OpenTK.Graphics.GL.BlendEquationSeparate(OpenTK.Graphics.All,OpenTK.Graphics.All)"> <summary> Set the RGB blend equation and the alpha blend equation separately </summary> @@ -28309,7 +28295,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.Enable(OpenTK.Graphics.IndexedEnableCap,System.UInt32)"> + <member name="M:OpenTK.Graphics.GL.Enable(OpenTK.Graphics.Version30,System.UInt32)"> <summary> Enable or disable server-side GL capabilities </summary> @@ -28319,7 +28305,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.Enable(OpenTK.Graphics.IndexedEnableCap,System.Int32)"> + <member name="M:OpenTK.Graphics.GL.Enable(OpenTK.Graphics.Version30,System.Int32)"> <summary> Enable or disable server-side GL capabilities </summary> @@ -28329,7 +28315,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.IsEnabled(OpenTK.Graphics.IndexedEnableCap,System.UInt32)"> + <member name="M:OpenTK.Graphics.GL.IsEnabled(OpenTK.Graphics.Version30,System.UInt32)"> <summary> Test whether a capability is enabled </summary> @@ -28339,7 +28325,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.IsEnabled(OpenTK.Graphics.IndexedEnableCap,System.Int32)"> + <member name="M:OpenTK.Graphics.GL.IsEnabled(OpenTK.Graphics.Version30,System.Int32)"> <summary> Test whether a capability is enabled </summary> @@ -28604,7 +28590,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.GetString(OpenTK.Graphics.IndexedStringName,System.UInt32)"> + <member name="M:OpenTK.Graphics.GL.GetString(OpenTK.Graphics.Version30,System.UInt32)"> <summary> Return a string describing the current GL connection </summary> @@ -28614,7 +28600,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.GetString(OpenTK.Graphics.IndexedStringName,System.Int32)"> + <member name="M:OpenTK.Graphics.GL.GetString(OpenTK.Graphics.Version30,System.Int32)"> <summary> Return a string describing the current GL connection </summary> @@ -28833,7 +28819,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetProgram(System.UInt32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32[])"> + <member name="M:OpenTK.Graphics.GL.NV.GetProgram(System.UInt32,OpenTK.Graphics.NvVertexProgram,System.Int32[])"> <summary> Returns a parameter from a program object </summary> @@ -28853,7 +28839,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetProgram(System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32[])"> + <member name="M:OpenTK.Graphics.GL.NV.GetProgram(System.Int32,OpenTK.Graphics.NvVertexProgram,System.Int32[])"> <summary> Returns a parameter from a program object </summary> @@ -28873,7 +28859,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetProgram(System.UInt32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32@)"> + <member name="M:OpenTK.Graphics.GL.NV.GetProgram(System.UInt32,OpenTK.Graphics.NvVertexProgram,System.Int32@)"> <summary> Returns a parameter from a program object </summary> @@ -28893,7 +28879,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetProgram(System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32@)"> + <member name="M:OpenTK.Graphics.GL.NV.GetProgram(System.Int32,OpenTK.Graphics.NvVertexProgram,System.Int32@)"> <summary> Returns a parameter from a program object </summary> @@ -28913,7 +28899,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetProgram(System.UInt32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32*)"> + <member name="M:OpenTK.Graphics.GL.NV.GetProgram(System.UInt32,OpenTK.Graphics.NvVertexProgram,System.Int32*)"> <summary> Returns a parameter from a program object </summary> @@ -28933,7 +28919,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetProgram(System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32*)"> + <member name="M:OpenTK.Graphics.GL.NV.GetProgram(System.Int32,OpenTK.Graphics.NvVertexProgram,System.Int32*)"> <summary> Returns a parameter from a program object </summary> @@ -28953,7 +28939,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.UInt32,OpenTK.Graphics.VertexAttribParameterArb,System.Double[])"> + <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.UInt32,OpenTK.Graphics.NvVertexProgram,System.Double[])"> <summary> Return a generic vertex attribute parameter </summary> @@ -28973,7 +28959,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Double[])"> + <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.Int32,OpenTK.Graphics.NvVertexProgram,System.Double[])"> <summary> Return a generic vertex attribute parameter </summary> @@ -28993,7 +28979,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.UInt32,OpenTK.Graphics.VertexAttribParameterArb,System.Double@)"> + <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.UInt32,OpenTK.Graphics.NvVertexProgram,System.Double@)"> <summary> Return a generic vertex attribute parameter </summary> @@ -29013,7 +28999,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Double@)"> + <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.Int32,OpenTK.Graphics.NvVertexProgram,System.Double@)"> <summary> Return a generic vertex attribute parameter </summary> @@ -29033,7 +29019,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.UInt32,OpenTK.Graphics.VertexAttribParameterArb,System.Double*)"> + <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.UInt32,OpenTK.Graphics.NvVertexProgram,System.Double*)"> <summary> Return a generic vertex attribute parameter </summary> @@ -29053,7 +29039,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Double*)"> + <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.Int32,OpenTK.Graphics.NvVertexProgram,System.Double*)"> <summary> Return a generic vertex attribute parameter </summary> @@ -29073,7 +29059,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.UInt32,OpenTK.Graphics.VertexAttribParameterArb,System.Single[])"> + <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.UInt32,OpenTK.Graphics.NvVertexProgram,System.Single[])"> <summary> Return a generic vertex attribute parameter </summary> @@ -29093,7 +29079,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Single[])"> + <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.Int32,OpenTK.Graphics.NvVertexProgram,System.Single[])"> <summary> Return a generic vertex attribute parameter </summary> @@ -29113,7 +29099,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.UInt32,OpenTK.Graphics.VertexAttribParameterArb,System.Single@)"> + <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.UInt32,OpenTK.Graphics.NvVertexProgram,System.Single@)"> <summary> Return a generic vertex attribute parameter </summary> @@ -29133,7 +29119,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Single@)"> + <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.Int32,OpenTK.Graphics.NvVertexProgram,System.Single@)"> <summary> Return a generic vertex attribute parameter </summary> @@ -29153,7 +29139,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.UInt32,OpenTK.Graphics.VertexAttribParameterArb,System.Single*)"> + <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.UInt32,OpenTK.Graphics.NvVertexProgram,System.Single*)"> <summary> Return a generic vertex attribute parameter </summary> @@ -29173,7 +29159,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Single*)"> + <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.Int32,OpenTK.Graphics.NvVertexProgram,System.Single*)"> <summary> Return a generic vertex attribute parameter </summary> @@ -29193,7 +29179,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.UInt32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32[])"> + <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.UInt32,OpenTK.Graphics.NvVertexProgram,System.Int32[])"> <summary> Return a generic vertex attribute parameter </summary> @@ -29213,7 +29199,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32[])"> + <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.Int32,OpenTK.Graphics.NvVertexProgram,System.Int32[])"> <summary> Return a generic vertex attribute parameter </summary> @@ -29233,7 +29219,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.UInt32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32@)"> + <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.UInt32,OpenTK.Graphics.NvVertexProgram,System.Int32@)"> <summary> Return a generic vertex attribute parameter </summary> @@ -29253,7 +29239,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32@)"> + <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.Int32,OpenTK.Graphics.NvVertexProgram,System.Int32@)"> <summary> Return a generic vertex attribute parameter </summary> @@ -29273,7 +29259,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.UInt32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32*)"> + <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.UInt32,OpenTK.Graphics.NvVertexProgram,System.Int32*)"> <summary> Return a generic vertex attribute parameter </summary> @@ -29293,7 +29279,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32*)"> + <member name="M:OpenTK.Graphics.GL.NV.GetVertexAttrib(System.Int32,OpenTK.Graphics.NvVertexProgram,System.Int32*)"> <summary> Return a generic vertex attribute parameter </summary> @@ -29333,7 +29319,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.VertexAttribPointer(System.UInt32,System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32,System.IntPtr)"> + <member name="M:OpenTK.Graphics.GL.NV.VertexAttribPointer(System.UInt32,System.Int32,OpenTK.Graphics.NvVertexProgram,System.Int32,System.IntPtr)"> <summary> Define an array of generic vertex attribute data </summary> @@ -29368,7 +29354,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.VertexAttribPointer(System.Int32,System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32,System.IntPtr)"> + <member name="M:OpenTK.Graphics.GL.NV.VertexAttribPointer(System.Int32,System.Int32,OpenTK.Graphics.NvVertexProgram,System.Int32,System.IntPtr)"> <summary> Define an array of generic vertex attribute data </summary> @@ -29403,7 +29389,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.VertexAttribPointer``1(System.UInt32,System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32,``0@)"> + <member name="M:OpenTK.Graphics.GL.NV.VertexAttribPointer``1(System.UInt32,System.Int32,OpenTK.Graphics.NvVertexProgram,System.Int32,``0@)"> <summary> Define an array of generic vertex attribute data </summary> @@ -29438,7 +29424,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.VertexAttribPointer``1(System.Int32,System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32,``0@)"> + <member name="M:OpenTK.Graphics.GL.NV.VertexAttribPointer``1(System.Int32,System.Int32,OpenTK.Graphics.NvVertexProgram,System.Int32,``0@)"> <summary> Define an array of generic vertex attribute data </summary> @@ -29473,7 +29459,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.VertexAttribPointer``1(System.UInt32,System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32,``0[])"> + <member name="M:OpenTK.Graphics.GL.NV.VertexAttribPointer``1(System.UInt32,System.Int32,OpenTK.Graphics.NvVertexProgram,System.Int32,``0[])"> <summary> Define an array of generic vertex attribute data </summary> @@ -29508,7 +29494,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.VertexAttribPointer``1(System.Int32,System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32,``0[])"> + <member name="M:OpenTK.Graphics.GL.NV.VertexAttribPointer``1(System.Int32,System.Int32,OpenTK.Graphics.NvVertexProgram,System.Int32,``0[])"> <summary> Define an array of generic vertex attribute data </summary> @@ -29543,7 +29529,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.VertexAttribPointer``1(System.UInt32,System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32,``0[0:,0:])"> + <member name="M:OpenTK.Graphics.GL.NV.VertexAttribPointer``1(System.UInt32,System.Int32,OpenTK.Graphics.NvVertexProgram,System.Int32,``0[0:,0:])"> <summary> Define an array of generic vertex attribute data </summary> @@ -29578,7 +29564,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.VertexAttribPointer``1(System.Int32,System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32,``0[0:,0:])"> + <member name="M:OpenTK.Graphics.GL.NV.VertexAttribPointer``1(System.Int32,System.Int32,OpenTK.Graphics.NvVertexProgram,System.Int32,``0[0:,0:])"> <summary> Define an array of generic vertex attribute data </summary> @@ -29613,7 +29599,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.VertexAttribPointer``1(System.UInt32,System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32,``0[0:,0:,0:])"> + <member name="M:OpenTK.Graphics.GL.NV.VertexAttribPointer``1(System.UInt32,System.Int32,OpenTK.Graphics.NvVertexProgram,System.Int32,``0[0:,0:,0:])"> <summary> Define an array of generic vertex attribute data </summary> @@ -29648,7 +29634,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.NV.VertexAttribPointer``1(System.Int32,System.Int32,OpenTK.Graphics.VertexAttribParameterArb,System.Int32,``0[0:,0:,0:])"> + <member name="M:OpenTK.Graphics.GL.NV.VertexAttribPointer``1(System.Int32,System.Int32,OpenTK.Graphics.NvVertexProgram,System.Int32,``0[0:,0:,0:])"> <summary> Define an array of generic vertex attribute data </summary> @@ -45314,7 +45300,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.Ext.FogCoordPointer(OpenTK.Graphics.FogPointerType,System.Int32,System.IntPtr)"> + <member name="M:OpenTK.Graphics.GL.Ext.FogCoordPointer(OpenTK.Graphics.ExtFogCoord,System.Int32,System.IntPtr)"> <summary> Define an array of fog coordinates </summary> @@ -45334,7 +45320,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.Ext.FogCoordPointer``1(OpenTK.Graphics.FogPointerType,System.Int32,``0@)"> + <member name="M:OpenTK.Graphics.GL.Ext.FogCoordPointer``1(OpenTK.Graphics.ExtFogCoord,System.Int32,``0@)"> <summary> Define an array of fog coordinates </summary> @@ -45354,7 +45340,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.Ext.FogCoordPointer``1(OpenTK.Graphics.FogPointerType,System.Int32,``0[])"> + <member name="M:OpenTK.Graphics.GL.Ext.FogCoordPointer``1(OpenTK.Graphics.ExtFogCoord,System.Int32,``0[])"> <summary> Define an array of fog coordinates </summary> @@ -45374,7 +45360,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.Ext.FogCoordPointer``1(OpenTK.Graphics.FogPointerType,System.Int32,``0[0:,0:])"> + <member name="M:OpenTK.Graphics.GL.Ext.FogCoordPointer``1(OpenTK.Graphics.ExtFogCoord,System.Int32,``0[0:,0:])"> <summary> Define an array of fog coordinates </summary> @@ -45394,7 +45380,7 @@ </para> </param> </member> - <member name="M:OpenTK.Graphics.GL.Ext.FogCoordPointer``1(OpenTK.Graphics.FogPointerType,System.Int32,``0[0:,0:,0:])"> + <member name="M:OpenTK.Graphics.GL.Ext.FogCoordPointer``1(OpenTK.Graphics.ExtFogCoord,System.Int32,``0[0:,0:,0:])"> <summary> Define an array of fog coordinates </summary> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-10-19 02:03:25
|
Revision: 1053 http://agate.svn.sourceforge.net/agate/?rev=1053&view=rev Author: kanato Date: 2009-10-19 02:03:19 +0000 (Mon, 19 Oct 2009) Log Message: ----------- Fix detection of screen modes in AgateSDX. Modified Paths: -------------- trunk/Drivers/AgateSDX/SDX_Display.cs Modified: trunk/Drivers/AgateSDX/SDX_Display.cs =================================================================== --- trunk/Drivers/AgateSDX/SDX_Display.cs 2009-10-19 02:00:38 UTC (rev 1052) +++ trunk/Drivers/AgateSDX/SDX_Display.cs 2009-10-19 02:03:19 UTC (rev 1053) @@ -650,17 +650,19 @@ } } + static Format[] probeScreenFormats = new Format[] + { Format.X8B8G8R8, Format.X8R8G8B8, /*Format.R8G8B8, Format.R5G6B5,*/}; + public override ScreenMode[] EnumScreenModes() { List<ScreenMode> modes = new List<ScreenMode>(); - - DisplayModeCollection dxmodes = mDirect3Dobject.Adapters[0].GetDisplayModes(Format.X8B8G8R8); - ConvertDisplayModesToScreenModes(modes, dxmodes); + foreach (var fmt in probeScreenFormats) + { + DisplayModeCollection dxmodes = mDirect3Dobject.Adapters[0].GetDisplayModes(fmt); + ConvertDisplayModesToScreenModes(modes, dxmodes); + } - dxmodes = mDirect3Dobject.Adapters[0].GetDisplayModes(Format.R5G6B5); - ConvertDisplayModesToScreenModes(modes, dxmodes); - return modes.ToArray(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-10-19 02:00:45
|
Revision: 1052 http://agate.svn.sourceforge.net/agate/?rev=1052&view=rev Author: kanato Date: 2009-10-19 02:00:38 +0000 (Mon, 19 Oct 2009) Log Message: ----------- Add ToString override in ScreenMode. Modified Paths: -------------- trunk/AgateLib/DisplayLib/ScreenMode.cs Modified: trunk/AgateLib/DisplayLib/ScreenMode.cs =================================================================== --- trunk/AgateLib/DisplayLib/ScreenMode.cs 2009-10-19 01:59:27 UTC (rev 1051) +++ trunk/AgateLib/DisplayLib/ScreenMode.cs 2009-10-19 02:00:38 UTC (rev 1052) @@ -93,6 +93,9 @@ if (mode.Height < height) continue; + if (mode.Bpp != bpp) + continue; + int thisDiff = Math.Abs(width - mode.Width) + Math.Abs(height - mode.Height); thisDiff *= Math.Abs(mode.Bpp - bpp) / 2; @@ -108,5 +111,15 @@ return selected; } + + /// <summary> + /// Reports useful debugging information. + /// </summary> + /// <returns></returns> + public override string ToString() + { + return string.Format( + "ScreenMode: {0} x {1} @ {2}", mWidth, mHeight, mBpp); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-10-19 01:59:37
|
Revision: 1051 http://agate.svn.sourceforge.net/agate/?rev=1051&view=rev Author: kanato Date: 2009-10-19 01:59:27 +0000 (Mon, 19 Oct 2009) Log Message: ----------- Add full screen initialization test. Added Paths: ----------- trunk/Tests/DisplayTests/FullScreen.cs Added: trunk/Tests/DisplayTests/FullScreen.cs =================================================================== --- trunk/Tests/DisplayTests/FullScreen.cs (rev 0) +++ trunk/Tests/DisplayTests/FullScreen.cs 2009-10-19 01:59:27 UTC (rev 1051) @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using AgateLib; +using AgateLib.DisplayLib; +using AgateLib.Geometry; +using AgateLib.InputLib; + +namespace Tests.DisplayTests +{ + class HelloWorldProgram : IAgateTest + { + public string Name + { + get { return "Full Screen"; } + } + + public string Category + { + get { return "Display"; } + } + + public void Main(string[] args) + { + using (AgateSetup setup = new AgateSetup(args)) + { + setup.InitializeAll(); + if (setup.WasCanceled) + return; + + DisplayWindow wind = DisplayWindow.CreateFullScreen("Hello World", 640, 480); + Surface mySurface = new Surface("jellybean.png"); + + // Run the program while the window is open. + while (!(Display.CurrentWindow.IsClosed || Keyboard.Keys[KeyCode.Escape])) + { + Display.BeginFrame(); + Display.Clear(Color.DarkGreen); + mySurface.Draw(Mouse.X, Mouse.Y); + Display.EndFrame(); + Core.KeepAlive(); + } + } + } + + } +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-10-19 01:11:56
|
Revision: 1050 http://agate.svn.sourceforge.net/agate/?rev=1050&view=rev Author: kanato Date: 2009-10-19 01:11:46 +0000 (Mon, 19 Oct 2009) Log Message: ----------- Update OpenGL version detection to be more robust across different culture settings. Modified Paths: -------------- trunk/Drivers/AgateOTK/GL_Display.cs Modified: trunk/Drivers/AgateOTK/GL_Display.cs =================================================================== --- trunk/Drivers/AgateOTK/GL_Display.cs 2009-09-21 16:11:31 UTC (rev 1049) +++ trunk/Drivers/AgateOTK/GL_Display.cs 2009-10-19 01:11:46 UTC (rev 1050) @@ -394,12 +394,11 @@ HintMode.Nicest); string vendor = GL.GetString(StringName.Vendor); - string versionString = GL.GetString(StringName.Version); string ext = GL.GetString(StringName.Extensions); - - mGLVersion = decimal.Parse(versionString.Substring(0, 3)); mSupportsShaders = false; + mGLVersion = DetectOpenGLVersion(); + if (mGLVersion >= 2m) { mSupportsFramebuffer = true; @@ -428,6 +427,41 @@ } + private static decimal DetectOpenGLVersion() + { + string versionString = GL.GetString(StringName.Version); + + // Not sure whether OpenGL drivers will universally report version in the machine's + // culture settings or not. So we switch the current decimal separator with a period. + versionString = versionString.Replace(System.Globalization.NumberFormatInfo.CurrentInfo.NumberDecimalSeparator, "."); + int pointLoc = versionString.IndexOf("."); + + // Remove any additional version information. Some drivers report version string as + // something like 2.1.8577, which will be problematic for the decimal.Parse call below. + // We are only interested in the first two numbers, so discard everything else. + if (versionString.IndexOf(".", pointLoc + 1) > -1) + { + versionString = versionString.Substring(0, versionString.IndexOf(".", pointLoc + 1)); + } + + decimal retval; + + if (decimal.TryParse(versionString, System.Globalization.NumberStyles.Number, + System.Globalization.CultureInfo.InvariantCulture, out retval) == false) + { + Trace.WriteLine("AgateOTK was unable to parse the OpenGL version string."); + Trace.WriteLine(" The reported string was: " + versionString); + Trace.WriteLine(" Please report this issue to http://www.agatelib.org along"); + Trace.WriteLine(" with details about your operating system and graphics drivers."); + Trace.WriteLine(" Falling back to OpenGL 1.1 supported functionality."); + + retval = 1.1m; + } + + return retval; + } + + OtkShader mCurrentShader; public OtkShader Shader This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ac...@us...> - 2009-09-21 16:11:41
|
Revision: 1049 http://agate.svn.sourceforge.net/agate/?rev=1049&view=rev Author: accagon Date: 2009-09-21 16:11:31 +0000 (Mon, 21 Sep 2009) Log Message: ----------- Add gravity range property to GravityPointManipulator. Modified Paths: -------------- branches/particles/AgateLib/Particles/Manipulators/GravityPointManipulator.cs Modified: branches/particles/AgateLib/Particles/Manipulators/GravityPointManipulator.cs =================================================================== --- branches/particles/AgateLib/Particles/Manipulators/GravityPointManipulator.cs 2009-09-17 20:44:28 UTC (rev 1048) +++ branches/particles/AgateLib/Particles/Manipulators/GravityPointManipulator.cs 2009-09-21 16:11:31 UTC (rev 1049) @@ -29,6 +29,7 @@ { private Vector2 mPosition; private float mForce; + private float mRange; /// <summary> /// Gets or sets the position of the point gravity. @@ -46,9 +47,19 @@ set { mForce = value; } } + /// <summary> + /// Gets or sets the range of the gravity impact. + /// A value of 0 means the gravity is disabled. + /// A value lower than 0 means the gravity has impact on all registered particles. + /// </summary> + public float Range { + get { return mRange; } + set { mRange = value; } + } + /// <summary> - /// Constructs a GravityPointManipulator. + /// Constructs a GravityPointManipulator with global gravity. /// </summary> /// <param name="position">The position of the point gravity.</param> /// <param name="force">The gravity force.</param> @@ -56,16 +67,45 @@ { mPosition = position; mForce = force; + mRange = -1; } + /// <summary> + /// Constructs a GravityPointManipulator. + /// </summary> + /// <param name="position">The position of the point gravity.</param> + /// <param name="force">The gravity force.</param> + /// <param name="range">The range of the gravity impact.</param> + public GravityPointManipulator (Vector2 position, float force, float range) + { + mPosition = position; + mForce = force; + mRange = range; + } + void HandleOnUpdate (UpdateArgs args) { Vector2 way; - foreach(Particle particle in args.Emitter.Particles) + if(Range < 0) // global effect on all registered particles { - way = particle.Position - Position; - particle.Velocity += way.Normalize() * Force; + foreach(Particle particle in args.Emitter.Particles) + { + way = particle.Position - Position; + particle.Velocity += way.Normalize() * Force; + } } + else if (Range > 0) // only particles in range are effected + { + foreach(Particle particle in args.Emitter.Particles) + { + if(Vector2.DistanceBetween(particle.Position, Position) <= Range) + { + way = particle.Position - Position; + particle.Velocity += way.Normalize() * Force; + } + } + } + // Range == 0 means no gravity impact } /// <summary> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ac...@us...> - 2009-09-17 20:44:34
|
Revision: 1048 http://agate.svn.sourceforge.net/agate/?rev=1048&view=rev Author: accagon Date: 2009-09-17 20:44:28 +0000 (Thu, 17 Sep 2009) Log Message: ----------- Use new GavityPointManipulator in the particle tests. Modified Paths: -------------- branches/particles/Tests/DisplayTests/ParticleTests/ParticleTests.cs Modified: branches/particles/Tests/DisplayTests/ParticleTests/ParticleTests.cs =================================================================== --- branches/particles/Tests/DisplayTests/ParticleTests/ParticleTests.cs 2009-09-17 20:40:41 UTC (rev 1047) +++ branches/particles/Tests/DisplayTests/ParticleTests/ParticleTests.cs 2009-09-17 20:44:28 UTC (rev 1048) @@ -54,12 +54,14 @@ FadeOutManipulator fom; FadeOutManipulator fom2; + GravityPointManipulator gpm; + protected override void Initialize() { //PixelParticle - pe = new PixelEmitter(new Vector2(400f, 550f) ,Color.Blue, 5000); - pe.EmitLife = 4f; - pe.EmitFrequency = 0.001f; + pe = new PixelEmitter(new Vector2(400f, 550f) ,Color.Blue, 2000); + pe.EmitLife = 15f; + pe.EmitFrequency = 0.01f; pe.PixelSize = new Size(3, 3); //SurfaceParticle @@ -87,12 +89,11 @@ //Manipulators gm = new GravityManipulator(new Vector2(0f, -20f)); - gm.SubscribeToEmitter(pe); gm.SubscribeToEmitter(sm); gm.SubscribeToEmitter(se); gm2 = new GravityManipulator(Vector2.Empty); - gm2.SubscribeToEmitter(pe); + //gm2.SubscribeToEmitter(pe); gm2.SubscribeToEmitter(sm); gm2.SubscribeToEmitter(se); @@ -103,6 +104,9 @@ fom2.SubscribeToEmitter(sm); fom2.SubscribeToEmitter(se); + gpm = new GravityPointManipulator(new Vector2(400f, 350f), -1f); + gpm.SubscribeToEmitter(pe); + fontSurface = new FontSurface("Arial", 10f, FontStyle.Bold); } @@ -114,7 +118,7 @@ fom.LifeBarrier = (float)ran.NextDouble() * 5f; pe.Update(time_ms); - pe.EmitVelocity = new Vector2(0f, (float)ran.Next(-100, 0)); + pe.EmitVelocity = new Vector2((float)ran.Next(-10, 10), 0f); sm.Update(time_ms); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ac...@us...> - 2009-09-17 20:40:48
|
Revision: 1047 http://agate.svn.sourceforge.net/agate/?rev=1047&view=rev Author: accagon Date: 2009-09-17 20:40:41 +0000 (Thu, 17 Sep 2009) Log Message: ----------- Add a point gravity manipulator. Added Paths: ----------- branches/particles/AgateLib/Particles/Manipulators/GravityPointManipulator.cs Added: branches/particles/AgateLib/Particles/Manipulators/GravityPointManipulator.cs =================================================================== --- branches/particles/AgateLib/Particles/Manipulators/GravityPointManipulator.cs (rev 0) +++ branches/particles/AgateLib/Particles/Manipulators/GravityPointManipulator.cs 2009-09-17 20:40:41 UTC (rev 1047) @@ -0,0 +1,89 @@ +// The contents of this file are subject to the Mozilla Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.mozilla.org/MPL/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations +// under the License. +// +// The Original Code is AgateLib.Particles. +// +// The Initial Developer of the Original Code is Marcel Hauf +// Portions created by Marcel Hauf are Copyright (C) 2009. +// All Rights Reserved. +// +// Contributor(s): Marcel Hauf. +// + +using System; +using AgateLib.Geometry; + +namespace AgateLib.Particles +{ + /// <summary> + /// A point gravity particle manipulator. + /// </summary> + public class GravityPointManipulator + { + private Vector2 mPosition; + private float mForce; + + /// <summary> + /// Gets or sets the position of the point gravity. + /// </summary> + public Vector2 Position { + get { return mPosition; } + set { mPosition = value; } + } + + /// <summary> + /// Gets or sets the gravity force. + /// </summary> + public float Force { + get { return mForce; } + set { mForce = value; } + } + + + /// <summary> + /// Constructs a GravityPointManipulator. + /// </summary> + /// <param name="position">The position of the point gravity.</param> + /// <param name="force">The gravity force.</param> + public GravityPointManipulator (Vector2 position, float force) + { + mPosition = position; + mForce = force; + } + + void HandleOnUpdate (UpdateArgs args) + { + Vector2 way; + foreach(Particle particle in args.Emitter.Particles) + { + way = particle.Position - Position; + particle.Velocity += way.Normalize() * Force; + } + } + + /// <summary> + /// Subscribe to a particle emitter. + /// </summary> + /// <param name="emitter"></param> + public void SubscribeToEmitter (ParticleEmitter emitter) + { + emitter.OnUpdate += HandleOnUpdate; + } + + /// <summary> + /// Unsubscribe to a particle emitter. + /// </summary> + /// <param name="emitter"></param> + public void UnSubscribeToEmitter (ParticleEmitter emitter) + { + emitter.OnUpdate -= HandleOnUpdate; + } + } +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ac...@us...> - 2009-09-17 16:32:38
|
Revision: 1046 http://agate.svn.sourceforge.net/agate/?rev=1046&view=rev Author: accagon Date: 2009-09-17 16:32:30 +0000 (Thu, 17 Sep 2009) Log Message: ----------- Adjust particle test to latest changes. Add more random changes per update. Modified Paths: -------------- branches/particles/Tests/DisplayTests/ParticleTests/ParticleTests.cs Modified: branches/particles/Tests/DisplayTests/ParticleTests/ParticleTests.cs =================================================================== --- branches/particles/Tests/DisplayTests/ParticleTests/ParticleTests.cs 2009-09-17 16:21:46 UTC (rev 1045) +++ branches/particles/Tests/DisplayTests/ParticleTests/ParticleTests.cs 2009-09-17 16:32:30 UTC (rev 1046) @@ -51,6 +51,9 @@ FontSurface fontSurface; + FadeOutManipulator fom; + FadeOutManipulator fom2; + protected override void Initialize() { //PixelParticle @@ -73,7 +76,7 @@ Sprite sprite = new Sprite(100, 100); sprite.AddFrame(surf); sprite.AddFrame(surf2); - sprite.TimePerFrame = 0.5d; + sprite.TimePerFrame = 3d; sprite.AnimationType = SpriteAnimType.Looping; se = new SpriteEmitter(new Vector2(600f, 550f), 4.2f, 100, 0); se.AddSprite(sprite); @@ -83,7 +86,7 @@ se.EmitVelocity = new Vector2(0, -10); //Manipulators - gm = new GravityManipulator(new Vector2(0f, -50f)); + gm = new GravityManipulator(new Vector2(0f, -20f)); gm.SubscribeToEmitter(pe); gm.SubscribeToEmitter(sm); gm.SubscribeToEmitter(se); @@ -93,10 +96,10 @@ gm2.SubscribeToEmitter(sm); gm2.SubscribeToEmitter(se); - FadeOutManipulator fom = new FadeOutManipulator(3f, 0.8f); + fom = new FadeOutManipulator(2.5f, 0.6f); fom.SubscribeToEmitter(pe); - FadeOutManipulator fom2 = new FadeOutManipulator(4f, 0.4f); + fom2 = new FadeOutManipulator(4f, 0.3f); fom2.SubscribeToEmitter(sm); fom2.SubscribeToEmitter(se); @@ -106,9 +109,17 @@ protected override void Update(double time_ms) { gm2.Gravity = new Vector2((float)ran.Next(-300, 300), 0f); + + fom.AlphaAmount = (float)ran.NextDouble() * 1.3f; + fom.LifeBarrier = (float)ran.NextDouble() * 5f; + pe.Update(time_ms); + pe.EmitVelocity = new Vector2(0f, (float)ran.Next(-100, 0)); + sm.Update(time_ms); + se.Update(time_ms); + se.GetSpriteByKey(0).TimePerFrame = ran.NextDouble() * 3 + 1.5d; } protected override void Render() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ac...@us...> - 2009-09-17 16:21:54
|
Revision: 1045 http://agate.svn.sourceforge.net/agate/?rev=1045&view=rev Author: accagon Date: 2009-09-17 16:21:46 +0000 (Thu, 17 Sep 2009) Log Message: ----------- Add SpriteEmitter support to FadeOutManipulator. Modified Paths: -------------- branches/particles/AgateLib/Particles/Manipulators/FadeOutManipulator.cs Modified: branches/particles/AgateLib/Particles/Manipulators/FadeOutManipulator.cs =================================================================== --- branches/particles/AgateLib/Particles/Manipulators/FadeOutManipulator.cs 2009-09-11 18:44:14 UTC (rev 1044) +++ branches/particles/AgateLib/Particles/Manipulators/FadeOutManipulator.cs 2009-09-17 16:21:46 UTC (rev 1045) @@ -24,6 +24,7 @@ { /// <summary> /// Fades out particles by changing the alpha channel. + /// Works with <see cref="PixelEmitter"/>, <see cref="SurfaceEmitter"/> and <see cref="SpriteEmitter"/>. /// </summary> public class FadeOutManipulator { @@ -74,31 +75,46 @@ void HandleOnUpdate(UpdateArgs args) { - if(args.Emitter.GetType() == typeof(PixelEmitter)) + Type emitterType = args.Emitter.GetType(); + double time = args.Time_ms/1000; + + if(emitterType == typeof(PixelEmitter)) { foreach(PixelParticle pt in args.Emitter.Particles) { if(pt.Condition == Condition.Alive && pt.Life <= LifeBarrier) { - fadeout = pt.Color.A - (int)(255 * mAlphaAmount * args.Time_ms/1000); + fadeout = pt.Color.A - (int)(255 * mAlphaAmount * time); pt.Color = Color.FromArgb(fadeout, pt.Color); if(mRecyleInvisible == true && pt.Color.A == 0) pt.Condition = Condition.Dead; } } } - else if(args.Emitter.GetType() == typeof(SurfaceEmitter)) + else if (emitterType == typeof(SurfaceEmitter)) { foreach(SurfaceParticle sp in args.Emitter.Particles) { if(sp.Condition == Condition.Alive && sp.Life <= LifeBarrier) { - sp.Alpha -= mAlphaAmount * args.Time_ms/1000; + sp.Alpha -= mAlphaAmount * time; if(mRecyleInvisible == true && sp.Alpha == 0) sp.Condition = Condition.Dead; } } } + else if (emitterType == typeof(SpriteEmitter)) + { + foreach(SpriteParticle sp in args.Emitter.Particles) + { + if(sp.Condition == Condition.Alive && sp.Life <= LifeBarrier) + { + sp.Alpha -= mAlphaAmount * time; + if(mRecyleInvisible == true && sp.Alpha == 0) + sp.Condition = Condition.Dead; + } + } + } } /// <summary> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-09-11 18:44:21
|
Revision: 1044 http://agate.svn.sourceforge.net/agate/?rev=1044&view=rev Author: kanato Date: 2009-09-11 18:44:14 +0000 (Fri, 11 Sep 2009) Log Message: ----------- Fix drawing of untextured lines and rectangles after drawing textured images. Modified Paths: -------------- trunk/Drivers/AgateSDX/SDX_Display.cs Modified: trunk/Drivers/AgateSDX/SDX_Display.cs =================================================================== --- trunk/Drivers/AgateSDX/SDX_Display.cs 2009-09-11 18:43:13 UTC (rev 1043) +++ trunk/Drivers/AgateSDX/SDX_Display.cs 2009-09-11 18:44:14 UTC (rev 1044) @@ -424,6 +424,8 @@ mLines[3] = new PositionColor(rect.X, rect.Bottom, 0, c); mLines[4] = new PositionColor(rect.X, rect.Y, 0, c); + mDevice.SetDeviceStateTexture(null); + mDevice.Device.SetTextureStageState(0, TextureStage.ColorArg0, TextureArgument.Diffuse); mDevice.Device.VertexDeclaration = mPosColorDecl; mDevice.Device.DrawUserPrimitives(Direct3D.PrimitiveType.LineStrip, 4, mLines); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-09-11 18:43:20
|
Revision: 1043 http://agate.svn.sourceforge.net/agate/?rev=1043&view=rev Author: kanato Date: 2009-09-11 18:43:13 +0000 (Fri, 11 Sep 2009) Log Message: ----------- Add contract and expand methods to rectangle. Modified Paths: -------------- trunk/AgateLib/Geometry/Rectangle.cs Modified: trunk/AgateLib/Geometry/Rectangle.cs =================================================================== --- trunk/AgateLib/Geometry/Rectangle.cs 2009-09-09 17:17:04 UTC (rev 1042) +++ trunk/AgateLib/Geometry/Rectangle.cs 2009-09-11 18:43:13 UTC (rev 1043) @@ -212,6 +212,33 @@ } /// <summary> + /// Returns a rectangle contracted by the specified amount. The center of the rectangle remains in the same place, + /// so this adds amount to X and Y, and subtracts amount*2 from Width and Height. + /// </summary> + /// <param name="amount"></param> + public Rectangle Contract(int amount) + { + return Expand(-amount); + } + + /// <summary> + /// Returns a rectangle contracted expanded the rectangle by the specified amount. + /// The center of the rectangle remains in the same place, + /// so this subtracts amount to X and Y, and adds amount*2 from Width and Height. + /// </summary> + /// <param name="amount"></param> + public Rectangle Expand(int amount) + { + var retval = this; + + retval.X -= amount; + retval.Y -= amount; + retval.Width += amount * 2; + retval.Height += amount * 2; + + return retval; + } + /// <summary> /// Returns true if this intersects another rectangle. /// </summary> /// <param name="rect"></param> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ac...@us...> - 2009-09-09 17:17:12
|
Revision: 1042 http://agate.svn.sourceforge.net/agate/?rev=1042&view=rev Author: accagon Date: 2009-09-09 17:17:04 +0000 (Wed, 09 Sep 2009) Log Message: ----------- Add ParticleSprite animation. Modified Paths: -------------- branches/particles/AgateLib/Particles/Emitters/SpriteEmitter.cs branches/particles/AgateLib/Particles/Particles/SpriteParticle.cs Modified: branches/particles/AgateLib/Particles/Emitters/SpriteEmitter.cs =================================================================== --- branches/particles/AgateLib/Particles/Emitters/SpriteEmitter.cs 2009-09-08 22:05:56 UTC (rev 1041) +++ branches/particles/AgateLib/Particles/Emitters/SpriteEmitter.cs 2009-09-09 17:17:04 UTC (rev 1042) @@ -122,19 +122,12 @@ /// Draws each living particle. /// </summary> public override void Draw () - { - if(base.Particles.Count <= 0) - return; - - foreach(Sprite s in mSprites) - { - s.AdvanceFrame(); - } - + { foreach(SpriteParticle sp in base.Particles) { if(sp.Condition == Condition.Alive || sp.Condition == Condition.Frozen) { + mSprites[sp.SpriteKey].CurrentFrameIndex = sp.Frame; mSprites[sp.SpriteKey].Alpha = sp.Alpha; mSprites[sp.SpriteKey].Draw(sp.Position); } @@ -173,6 +166,8 @@ Particles[index].Acceleration = EmitAcceleration; (Particles[index] as SpriteParticle).SpriteKey = mEmitSpriteKey; (Particles[index] as SpriteParticle).Alpha = mEmitAlpha; + (Particles[index] as SpriteParticle).Frame = 0; + (Particles[index] as SpriteParticle).FrameTime = 0d; Particles[index].Condition = Condition.Alive; Particles[index].Life = EmitLife; Particles[index].Position = Position; @@ -186,6 +181,8 @@ sp.Acceleration = EmitAcceleration; sp.SpriteKey = mEmitSpriteKey; sp.Alpha = mEmitAlpha; + sp.Frame = 0; + sp.FrameTime = 0d; sp.Condition = Condition.Alive; sp.Life = EmitLife; sp.Position = Position; @@ -203,9 +200,23 @@ } // Update animation - foreach(Sprite sp in mSprites) + foreach(SpriteParticle sp in Particles) { - sp.Update(time_ms); + if(mSprites[sp.SpriteKey].Frames.Count <= 1) + { + sp.SpriteKey = 0; + continue; + } + sp.FrameTime += time_ms/1000; + while (sp.FrameTime >= mSprites[sp.SpriteKey].TimePerFrame) + { + sp.FrameTime -= mSprites[sp.SpriteKey].TimePerFrame; + if(mSprites[sp.SpriteKey].PlayReverse) + sp.Frame--; + else + sp.Frame++; + // TODO: Handle AnimationType + } } // updates own position, particle positions and calls manipulators Modified: branches/particles/AgateLib/Particles/Particles/SpriteParticle.cs =================================================================== --- branches/particles/AgateLib/Particles/Particles/SpriteParticle.cs 2009-09-08 22:05:56 UTC (rev 1041) +++ branches/particles/AgateLib/Particles/Particles/SpriteParticle.cs 2009-09-09 17:17:04 UTC (rev 1042) @@ -20,11 +20,15 @@ namespace AgateLib.Particles { + /// <summary> + /// A particle implementation for <see cref="Sprite"/>s. + /// </summary> public class SpriteParticle : Particle { private int mSpriteKey; - private double mAlpha = 1d; + private int mFrame = 0; + private double mFrameTime = 0d; /// <value> /// Gets or sets the sprite key. @@ -45,6 +49,21 @@ } /// <summary> + /// Gets or sets the current frame of the sprite. + /// </summary> + public int Frame + { + get { return mFrame; } + set { mFrame = value; } + } + + internal double FrameTime + { + get { return mFrameTime; } + set { mFrameTime = value; } + } + + /// <summary> /// Constructs a SpriteParticle with the default value 0 for the spriteKey. /// </summary> public SpriteParticle() : this(0) {} @@ -52,10 +71,31 @@ /// <summary> /// Constructs a SpriteParticle. /// </summary> - /// <param name="spriteKey"></param> + /// <param name="spriteKey">Key of a sprite in a <see cref="SpriteEmitter"/>.</param> public SpriteParticle(int spriteKey) { mSpriteKey = spriteKey; } + + /// <summary> + /// Constructs a SpriteParticle. + /// </summary> + /// <param name="spriteKey">Key of a sprite in a <see cref="SpriteEmitter"/></param> + /// <param name="alpha">Alpha channel.</param> + public SpriteParticle(int spriteKey, double alpha) : this(spriteKey) + { + mAlpha = alpha; + } + + /// <summary> + /// Constructs a SpriteParticle. + /// </summary> + /// <param name="spriteKey">Key of a sprite in a <see cref="SpriteEmitter"/></param> + /// <param name="alpha">Alpha channel.</param> + /// <param name="frame">Frame of the sprite.</param> + public SpriteParticle(int spriteKey, double alpha, int frame) : this(spriteKey, alpha) + { + mFrame = frame; + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-09-08 22:06:12
|
Revision: 1041 http://agate.svn.sourceforge.net/agate/?rev=1041&view=rev Author: kanato Date: 2009-09-08 22:05:56 +0000 (Tue, 08 Sep 2009) Log Message: ----------- Make sure to create a depth stencil surface for each render target. Modified Paths: -------------- trunk/Drivers/AgateSDX/SDX_DisplayWindow.cs trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.Designer.cs trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.resx Modified: trunk/Drivers/AgateSDX/SDX_DisplayWindow.cs =================================================================== --- trunk/Drivers/AgateSDX/SDX_DisplayWindow.cs 2009-09-08 17:24:55 UTC (rev 1040) +++ trunk/Drivers/AgateSDX/SDX_DisplayWindow.cs 2009-09-08 22:05:56 UTC (rev 1041) @@ -43,6 +43,7 @@ internal SwapChain mSwap; internal Direct3D.Surface mBackBuffer; + internal Direct3D.Surface mBackDepthStencil; int mChooseWidth; int mChooseHeight; @@ -359,6 +360,12 @@ mBackBuffer = mSwap.GetBackBuffer(0); + mBackDepthStencil = Direct3D.Surface.CreateDepthStencil( + mDisplay.D3D_Device.Device, + mChooseWidth, mChooseHeight, + mDisplay.DepthStencilFormat, + MultisampleType.None, 0, true); + } @@ -459,6 +466,7 @@ public override void BeginRender() { mDisplay.D3D_Device.Device.SetRenderTarget(0, mBackBuffer); + mDisplay.D3D_Device.Device.DepthStencilSurface = mBackDepthStencil; mDisplay.D3D_Device.Device.BeginScene(); } public override void EndRender() Modified: trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.Designer.cs =================================================================== --- trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.Designer.cs 2009-09-08 17:24:55 UTC (rev 1040) +++ trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.Designer.cs 2009-09-08 22:05:56 UTC (rev 1041) @@ -48,6 +48,9 @@ // // pictureBox1 // + this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.pictureBox1.Location = new System.Drawing.Point(12, 38); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(136, 32); Modified: trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.resx =================================================================== --- trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.resx 2009-09-08 17:24:55 UTC (rev 1040) +++ trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.resx 2009-09-08 22:05:56 UTC (rev 1041) @@ -120,7 +120,4 @@ <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> - <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>17, 17</value> - </metadata> </root> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-09-08 17:25:04
|
Revision: 1040 http://agate.svn.sourceforge.net/agate/?rev=1040&view=rev Author: kanato Date: 2009-09-08 17:24:55 +0000 (Tue, 08 Sep 2009) Log Message: ----------- Fix spacing Modified Paths: -------------- trunk/Drivers/AgateSDX/SDX_Surface.cs Modified: trunk/Drivers/AgateSDX/SDX_Surface.cs =================================================================== --- trunk/Drivers/AgateSDX/SDX_Surface.cs 2009-09-08 17:20:47 UTC (rev 1039) +++ trunk/Drivers/AgateSDX/SDX_Surface.cs 2009-09-08 17:24:55 UTC (rev 1040) @@ -522,8 +522,8 @@ mRenderToSurface.BeginScene(surfaceTarget, vp); Display.Clear(); + SurfaceState st = new SurfaceState(); - Draw(st); mTexture.Dispose(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-09-08 17:20:54
|
Revision: 1039 http://agate.svn.sourceforge.net/agate/?rev=1039&view=rev Author: kanato Date: 2009-09-08 17:20:47 +0000 (Tue, 08 Sep 2009) Log Message: ----------- Correct MultipleRenderTargetExample. Modified Paths: -------------- trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.Designer.cs trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.cs trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.resx trunk/Tests/DisplayTests/MultipleWindows/MultipleWindowTest.cs trunk/Tests/Shaders/LightingTest/LightingTest.cs Modified: trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.Designer.cs =================================================================== --- trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.Designer.cs 2009-09-08 17:20:19 UTC (rev 1038) +++ trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.Designer.cs 2009-09-08 17:20:47 UTC (rev 1039) @@ -1,7 +1,7 @@ // The contents of this file are public domain. // You may use them as you wish. // -namespace MultipleWindowTest +namespace Tests.MultipleWindows { partial class MultipleRenderTargetExample { @@ -50,7 +50,7 @@ // this.pictureBox1.Location = new System.Drawing.Point(12, 38); this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(136, 70); + this.pictureBox1.Size = new System.Drawing.Size(136, 32); this.pictureBox1.TabIndex = 0; this.pictureBox1.TabStop = false; this.pictureBox1.Tag = "Red Window"; @@ -95,14 +95,14 @@ // this.pictureBox3.Location = new System.Drawing.Point(182, 35); this.pictureBox3.Name = "pictureBox3"; - this.pictureBox3.Size = new System.Drawing.Size(195, 150); + this.pictureBox3.Size = new System.Drawing.Size(200, 150); this.pictureBox3.TabIndex = 4; this.pictureBox3.TabStop = false; this.pictureBox3.Tag = "Red Window"; // // btnDraw // - this.btnDraw.Location = new System.Drawing.Point(299, 191); + this.btnDraw.Location = new System.Drawing.Point(307, 198); this.btnDraw.Name = "btnDraw"; this.btnDraw.Size = new System.Drawing.Size(75, 39); this.btnDraw.TabIndex = 6; @@ -112,7 +112,7 @@ // // btnClearSurface // - this.btnClearSurface.Location = new System.Drawing.Point(218, 191); + this.btnClearSurface.Location = new System.Drawing.Point(226, 198); this.btnClearSurface.Name = "btnClearSurface"; this.btnClearSurface.Size = new System.Drawing.Size(75, 39); this.btnClearSurface.TabIndex = 8; @@ -123,7 +123,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(386, 431); + this.ClientSize = new System.Drawing.Size(401, 249); this.Controls.Add(this.btnClearSurface); this.Controls.Add(this.btnDraw); this.Controls.Add(this.label3); Modified: trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.cs =================================================================== --- trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.cs 2009-09-08 17:20:19 UTC (rev 1038) +++ trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.cs 2009-09-08 17:20:47 UTC (rev 1039) @@ -9,7 +9,7 @@ using System.Text; using System.Windows.Forms; -namespace MultipleWindowTest +namespace Tests.MultipleWindows { public partial class MultipleRenderTargetExample : Form { Modified: trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.resx =================================================================== --- trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.resx 2009-09-08 17:20:19 UTC (rev 1038) +++ trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.resx 2009-09-08 17:20:47 UTC (rev 1039) @@ -120,4 +120,7 @@ <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> + <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> </root> \ No newline at end of file Modified: trunk/Tests/DisplayTests/MultipleWindows/MultipleWindowTest.cs =================================================================== --- trunk/Tests/DisplayTests/MultipleWindows/MultipleWindowTest.cs 2009-09-08 17:20:19 UTC (rev 1038) +++ trunk/Tests/DisplayTests/MultipleWindows/MultipleWindowTest.cs 2009-09-08 17:20:47 UTC (rev 1039) @@ -7,17 +7,26 @@ using AgateLib.DisplayLib; using AgateLib.Geometry; -namespace MultipleWindowTest +namespace Tests.MultipleWindows { - static class MultipleWindowTest + class MultipleWindowTest : IAgateTest { - static Surface surf; - static Random rand = new Random(); + Surface surf; + Random rand = new Random(); - [STAThread] - static void Main(string[] args) + + public string Name { + get { return "Multiple Render Targets"; } + } + public string Category + { + get { return "Display"; } + } + + public void Main(string[] args) + { using (AgateSetup setup = new AgateSetup(args)) { setup.AskUser = true; @@ -81,7 +90,7 @@ } - static void btnClear_Click(object sender, EventArgs e) + void btnClear_Click(object sender, EventArgs e) { Display.RenderTarget = surf; @@ -90,7 +99,7 @@ Display.EndFrame(); } - static void btnDraw_Click(object sender, EventArgs e) + void btnDraw_Click(object sender, EventArgs e) { Display.RenderTarget = surf; @@ -114,5 +123,6 @@ System.Diagnostics.Debug.Flush(); } + } } \ No newline at end of file Modified: trunk/Tests/Shaders/LightingTest/LightingTest.cs =================================================================== --- trunk/Tests/Shaders/LightingTest/LightingTest.cs 2009-09-08 17:20:19 UTC (rev 1038) +++ trunk/Tests/Shaders/LightingTest/LightingTest.cs 2009-09-08 17:20:47 UTC (rev 1039) @@ -14,7 +14,7 @@ { #region IAgateTest Members - public string Name { get { return "Lighting"; } } + public string Name { get { return "Lighting (Direct3D only)"; } } public string Category { get { return "Shaders"; } } #endregion This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-09-08 17:20:27
|
Revision: 1038 http://agate.svn.sourceforge.net/agate/?rev=1038&view=rev Author: kanato Date: 2009-09-08 17:20:19 +0000 (Tue, 08 Sep 2009) Log Message: ----------- Remove reference to unused mWorld2D matrix. Correct depthstencil when creating a surface render target. Modified Paths: -------------- trunk/Drivers/AgateSDX/D3DDevice.cs trunk/Drivers/AgateSDX/SDX_Display.cs trunk/Drivers/AgateSDX/SDX_Surface.cs Modified: trunk/Drivers/AgateSDX/D3DDevice.cs =================================================================== --- trunk/Drivers/AgateSDX/D3DDevice.cs 2009-08-31 05:29:04 UTC (rev 1037) +++ trunk/Drivers/AgateSDX/D3DDevice.cs 2009-09-08 17:20:19 UTC (rev 1038) @@ -222,15 +222,13 @@ public void SetView2D() { - Matrix world = mWorld2D; - //Matrix orthoProj = Matrix.OrthoRH(RenderTarget.Width, -RenderTarget.Height, -1, 1); - SetOrthoProjection(new Rectangle(0, 0, RenderTarget.Width, RenderTarget.Height)); - mDevice.SetRenderState(RenderState.CullMode, Cull.None); mDevice.SetRenderState(RenderState.Lighting, false); - mDevice.SetTransform(TransformState.World, world); + mDevice.SetTransform(TransformState.World, Matrix.Identity); mDevice.SetTransform(TransformState.View, Matrix.Identity); + + SetOrthoProjection(new Rectangle(0, 0, RenderTarget.Width, RenderTarget.Height)); } public void SetFontRenderState() { @@ -259,13 +257,6 @@ } } - public void SetOrigin(float x, float y, float z) - { - Matrix world = Matrix.Translation(x, y, z) * mWorld2D; - - mDevice.SetTransform(TransformState.World, world); - } - public Size MaxSurfaceSize { get Modified: trunk/Drivers/AgateSDX/SDX_Display.cs =================================================================== --- trunk/Drivers/AgateSDX/SDX_Display.cs 2009-08-31 05:29:04 UTC (rev 1037) +++ trunk/Drivers/AgateSDX/SDX_Display.cs 2009-09-08 17:20:19 UTC (rev 1038) @@ -59,9 +59,14 @@ private int mStencilClear = 0; VertexDeclaration mPosColorDecl; + Format mDepthStencilFormat; #endregion + public Format DepthStencilFormat + { + get { return mDepthStencilFormat; } + } public VertexDeclaration SurfaceDeclaration { get { return mPosColorDecl; } @@ -144,6 +149,8 @@ private void SetHaveDepthStencil(Format depthFormat) { + mDepthStencilFormat = depthFormat; + switch (depthFormat) { case Format.D24X4S4: Modified: trunk/Drivers/AgateSDX/SDX_Surface.cs =================================================================== --- trunk/Drivers/AgateSDX/SDX_Surface.cs 2009-08-31 05:29:04 UTC (rev 1037) +++ trunk/Drivers/AgateSDX/SDX_Surface.cs 2009-09-08 17:20:19 UTC (rev 1038) @@ -510,7 +510,7 @@ Direct3D.Surface surfaceTarget = t.GetSurfaceLevel(0); mRenderToSurface = new RenderToSurface(mDevice.Device, SurfaceWidth, SurfaceHeight, - Format.A8R8G8B8, Format.D16); + Format.A8R8G8B8, mDisplay.DepthStencilFormat); Viewport vp = new Viewport(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |