chore: clean recommit
This commit is contained in:
parent
8024c6ac40
commit
60ad2e7fb1
122 changed files with 23950 additions and 323 deletions
|
|
@ -1,18 +1,14 @@
|
|||
namespace Examples;
|
||||
|
||||
/// <summary>
|
||||
/// A runnable raylib example. Each example class implements this interface directly: loop-spanning
|
||||
/// state from the original example's Main lives in instance fields, (re)initialized in
|
||||
/// A runnable raylib example. Loop-spanning state lives in instance fields, (re)initialized in
|
||||
/// <see cref="Init"/> so re-selecting an example resets it.
|
||||
///
|
||||
/// <para>
|
||||
/// Desktop runs the example via its <c>static Main()</c>, a thin driver that owns the window
|
||||
/// (InitWindow/CloseWindow, SetTargetFPS and friends) and drives <see cref="Init"/>,
|
||||
/// <see cref="Update"/>, and <see cref="Unload"/> around a blocking
|
||||
/// <c>while (!WindowShouldClose())</c> loop. In the browser, <c>Web/Host.cs</c> owns the single
|
||||
/// window and calls <see cref="Update"/> one frame at a time from JavaScript, so examples never
|
||||
/// block. Platform divergences (e.g. GLSL 100 vs 330 shaders) are guarded with <c>#if BROWSER</c>,
|
||||
/// preferably around a single constant so both platforms share one code path.
|
||||
/// Desktop drives examples via <c>Program.cs</c> (each also keeps a thin standalone
|
||||
/// <c>static Main()</c>); in the browser, <c>Web/Host.cs</c> owns the single window and calls
|
||||
/// <see cref="Update"/> one frame at a time from JavaScript. Platform divergences are guarded
|
||||
/// with <c>#if BROWSER</c>, preferably around a single constant.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public interface IExample
|
||||
|
|
@ -23,19 +19,32 @@ public interface IExample
|
|||
/// <summary>Window title, matching the example's standalone <c>Main()</c>.</summary>
|
||||
string Title { get; }
|
||||
|
||||
/// <summary>Config flags the desktop runner applies before window creation.</summary>
|
||||
/// <summary>Desktop window size, matching the standalone <c>Main()</c>. The browser canvas is fixed at 800x450.</summary>
|
||||
int Width => 800;
|
||||
|
||||
/// <inheritdoc cref="Width"/>
|
||||
int Height => 450;
|
||||
|
||||
/// <summary>Config flags the desktop runner applies before window creation. Ignored in the browser.</summary>
|
||||
ConfigFlags ConfigFlags => 0;
|
||||
|
||||
/// <summary>Target FPS the desktop runner sets after window creation.</summary>
|
||||
/// <summary>Target FPS. The desktop runner always applies it; the browser host paces its frame loop with it.</summary>
|
||||
int TargetFps => 60;
|
||||
|
||||
/// <summary>Whether the desktop runner disables the cursor (relative mouse movement).</summary>
|
||||
/// <summary>Whether the desktop runner disables the cursor. Ignored in the browser (the pointer stays visible).</summary>
|
||||
bool CursorDisabled => false;
|
||||
|
||||
/// <summary>Whether the desktop runner hides the cursor.</summary>
|
||||
/// <summary>Whether the desktop runner hides the cursor. Ignored in the browser.</summary>
|
||||
bool CursorHidden => false;
|
||||
|
||||
/// <summary>One-time setup.</summary>
|
||||
/// <summary>
|
||||
/// Whether the desktop runner should exit its frame loop; defaults to
|
||||
/// <see cref="Raylib.WindowShouldClose"/>. Examples that intercept the close request
|
||||
/// override this and poll WindowShouldClose in <see cref="Update"/> themselves.
|
||||
/// </summary>
|
||||
bool ShouldClose => WindowShouldClose();
|
||||
|
||||
/// <summary>Set up the Example and preload necessary resources.</summary>
|
||||
void Init();
|
||||
|
||||
/// <summary>Render one frame, including BeginDrawing/EndDrawing.</summary>
|
||||
|
|
|
|||
Loading…
Reference in a new issue