#+title: DOOM on Emacs

This is [[https://github.com/id-Software/DOOM][DOOM]] running inside Emacs via a native module. The port is based on
[[https://github.com/ozkl/doomgeneric][doomgeneric]] such that only a handful of functions like ~DG_DrawFrame~ need to be
[[file:doomgeneric_emacs.c][implemented in C]] with some [[file:doom-game.el][Elisp code as glue]]. It uses the native Canvas API
which is part of the Emacs 32 source tree, and also available for download as
[[https://github.com/minad/emacs-canvas-patch][patch]] for Emacs 31. See further Canvas links below.

#+html: <img src="https://github.com/minad/doom-on-emacs/blob/screenshots/screenshot.jpg?raw=true"/>

* Running DOOM

In order to run DOOM, you need an Emacs 32 with Canvas support. On Emacs 31
first apply the Canvas patch to the Emacs source and recompile Emacs. Then
execute ~make~ to download the DOOM source, compile the native Emacs module and
start DOOM in Emacs. You will need a WAD file which contains the game data. The
file ~doom1.wad~ is freely available. Error messages will appear in the ~*doom-log*~
buffer.

* Canvas links

- [[https://debbugs.gnu.org/cgi/bugreport.cgi?bug=80281][bug#80281]]
- [[https://github.com/minad/doom-on-emacs][doom-on-emacs]]
- [[https://github.com/minad/emacs-canvas-patch][emacs-canvas-patch]]
- [[https://github.com/minad/emacs-shader-demo][emacs-shader-demo]]
- [[https://tusharhero.codeberg.page/emacs-pale-canvas-and-stuff-demos.html][Pale and other demos]]
