Skip to content

Commit

Permalink
Add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalStrehovsky committed Jul 17, 2020
1 parent c750678 commit fee3999
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct FirePixels

static FirePixels firePixels;

static MiniRandom rng = new MiniRandom(5005);
static MiniRandom rng;

static void SpreadFire(int src)
{
Expand Down Expand Up @@ -175,6 +175,8 @@ private static IntPtr WndProc(IntPtr hwnd, uint msg, IntPtr lParam, IntPtr wPara

static int Main()
{
rng = new MiniRandom(5005);

string className = "MyClass";
IntPtr wnd;
fixed (char* pClassName = className)
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# DOOM fire effect in C#

This is the DOOM fire effect with no dependencies on standard GUI frameworks. Calls into Win32 APIs directly.

This is not idiomatic C# GUI code, but mostly a hack. No sane person writes C# GUI apps like this.

Can be compiled with CoreRT to generate a ~8 kB fully self-contained executable.

To publish with CoreRT simply run the following line from the root of the repo:

```
dotnet publish -r win-x64 -c Release /p:UseCoreRT=true
```

The main objective of this was to get this code running on Windows NT 3.51:

![C# fire effect on Windows NT 3.51](win351fire.gif)

Mission accomplished.
2 changes: 1 addition & 1 deletion nogui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<ItemGroup Condition="$(UseCoreRT) == 'true'">
<LinkerArg Include="/subsystem:windows /entry:__managed__Main" />
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-29101-01" />
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-29117-01" />
</ItemGroup>

<ItemGroup Condition="$(UseCoreRT) != 'true'">
Expand Down
Binary file added win351fire.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fee3999

Please sign in to comment.