src/main_doom.c
: a DOOM-style software renderersrc/main_wolf.c
: a Wolfenstein 3D-style software renderer
$ make doom|wolf|all
, binaries are bin/doom
and bin/wolf
respectively
Wolfenstein/DOOM style software renderers
License: MIT License
So I was going to compile Doom on Linux Mint, typed in make doom
and I got this error:
rsync -a --include '*/' --exclude '*' "src" "bin"
make: brew: No such file or directory
/bin/clang -o bin/src/main_doom.o -MMD -c -std=c2x -O2 -g -fbracket-depth=1024 -fmacro-backtrace-limit=0 -Wall -Wextra -Wpedantic -Wfloat-equal -Wstrict-aliasing -Wswitch-default -Wformat=2 -Wno-newline-eof -Wno-unused-parameter -Wno-strict-prototypes -Wno-fixed-enum-extension -Wno-int-to-void-pointer-cast -Wno-gnu-statement-expression -Wno-gnu-compound-literal-initializer -Wno-gnu-zero-variadic-macro-arguments -Wno-gnu-empty-struct -Wno-gnu-auto-type -Wno-gnu-empty-initializer -Wno-gnu-pointer-arith -Wno-c99-extensions -Wno-c11-extensions -iquotesrc -Ilib/SDL/include src/main_doom.c
make: /bin/clang: No such file or directory
make: *** [Makefile:70: bin/src/main_doom.o] Error 127
So I thought "OK, I'll compile myself" and typed gcc ./src/main_doom.c
just to be greeted by this other error:
./src/main_doom.c:3:10: fatal error: SDL.h: No such file or directory
3 | #include <SDL.h>
| ^~~~~~~
compilation terminated.
After changing SDL.h
to SDL2/SDL.h
to comply with Linux's include
file structure and tried again.
It threw a bunch of errors regarding boolean values which prompted me to also #include <stdbool.h>
.
I gcc ./src/main_doom.c
'd again just for it to throw me this other beautiful list of errors:
/usr/bin/ld: /tmp/ccoViwXv.o: in function `rotate':
main_doom.c:(.text+0x39): undefined reference to `cos'
/usr/bin/ld: main_doom.c:(.text+0x6d): undefined reference to `sin'
/usr/bin/ld: main_doom.c:(.text+0xb2): undefined reference to `sin'
/usr/bin/ld: main_doom.c:(.text+0xe6): undefined reference to `cos'
/usr/bin/ld: /tmp/ccoViwXv.o: in function `screen_angle_to_x':
main_doom.c:(.text+0x3f3): undefined reference to `tan'
/usr/bin/ld: /tmp/ccoViwXv.o: in function `normalize_angle':
main_doom.c:(.text+0x460): undefined reference to `floor'
/usr/bin/ld: /tmp/ccoViwXv.o: in function `render':
main_doom.c:(.text+0xefd): undefined reference to `atan2'
/usr/bin/ld: main_doom.c:(.text+0xf61): undefined reference to `atan2'
/usr/bin/ld: main_doom.c:(.text+0x10ba): undefined reference to `atan2'
/usr/bin/ld: main_doom.c:(.text+0x1141): undefined reference to `atan2'
/usr/bin/ld: main_doom.c:(.text+0x1253): undefined reference to `atan2f'
/usr/bin/ld: main_doom.c:(.text+0x126a): undefined reference to `sin'
/usr/bin/ld: main_doom.c:(.text+0x1c66): undefined reference to `SDL_Delay'
/usr/bin/ld: /tmp/ccoViwXv.o: in function `present':
main_doom.c:(.text+0x1de9): undefined reference to `SDL_LockTexture'
/usr/bin/ld: main_doom.c:(.text+0x1e4d): undefined reference to `SDL_UnlockTexture'
/usr/bin/ld: main_doom.c:(.text+0x1e61): undefined reference to `SDL_SetRenderTarget'
/usr/bin/ld: main_doom.c:(.text+0x1e85): undefined reference to `SDL_SetRenderDrawColor'
/usr/bin/ld: main_doom.c:(.text+0x1e99): undefined reference to `SDL_SetRenderDrawBlendMode'
/usr/bin/ld: main_doom.c:(.text+0x1ea8): undefined reference to `SDL_RenderClear'
/usr/bin/ld: main_doom.c:(.text+0x1ee0): undefined reference to `SDL_RenderCopyEx'
/usr/bin/ld: main_doom.c:(.text+0x1ef4): undefined reference to `SDL_SetTextureBlendMode'
/usr/bin/ld: main_doom.c:(.text+0x1f32): undefined reference to `SDL_RenderCopy'
/usr/bin/ld: main_doom.c:(.text+0x1f41): undefined reference to `SDL_RenderPresent'
/usr/bin/ld: /tmp/ccoViwXv.o: in function `main':
main_doom.c:(.text+0x1f8d): undefined reference to `SDL_Init'
/usr/bin/ld: main_doom.c:(.text+0x1f96): undefined reference to `SDL_GetError'
/usr/bin/ld: main_doom.c:(.text+0x1feb): undefined reference to `SDL_CreateWindow'
/usr/bin/ld: main_doom.c:(.text+0x2003): undefined reference to `SDL_GetError'
/usr/bin/ld: main_doom.c:(.text+0x2047): undefined reference to `SDL_CreateRenderer'
/usr/bin/ld: main_doom.c:(.text+0x2072): undefined reference to `SDL_CreateTexture'
/usr/bin/ld: main_doom.c:(.text+0x209d): undefined reference to `SDL_CreateTexture'
/usr/bin/ld: main_doom.c:(.text+0x2191): undefined reference to `SDL_PollEvent'
/usr/bin/ld: main_doom.c:(.text+0x21ce): undefined reference to `SDL_GetKeyboardState'
/usr/bin/ld: main_doom.c:(.text+0x2248): undefined reference to `cos'
/usr/bin/ld: main_doom.c:(.text+0x2273): undefined reference to `sin'
/usr/bin/ld: main_doom.c:(.text+0x25b1): undefined reference to `SDL_DestroyTexture'
/usr/bin/ld: main_doom.c:(.text+0x25c0): undefined reference to `SDL_DestroyTexture'
/usr/bin/ld: main_doom.c:(.text+0x25cf): undefined reference to `SDL_DestroyRenderer'
/usr/bin/ld: main_doom.c:(.text+0x25de): undefined reference to `SDL_DestroyWindow'
collect2: error: ld returned 1 exit status
I've run out of solutions so I'm going to post this in hopes of someone having a solution.
Best Regards,
Simón "Silicosis" Peña.
In the DOOM-style renderer, should this statement
const int wallshade =
16 * (sin(atan2f(
wall->b.x - wall->a.x,
wall->b.y - wall->b.y)) + 1.0f);
be changed to this statement
const int wallshade =
16 * (sin(atan2f(
wall->b.x - wall->a.x,
wall->b.y - wall->a.y)) + 1.0f);
since wall->b.y - wall->b.y
is zero? It makes a pretty subtle difference in the color of the walls but it stuck out to me as a possible typo when I was reading that code.
Super cool video and thanks for releasing your demo code!
rsync -a --include '/' --exclude '' "src" "bin"
/usr/local/opt/llvm/bin/clang -o bin/src/main_doom.o -MMD -c -std=c2x -O2 -g -fbracket-depth=1024 -fmacro-backtrace-limit=0 -Wall -Wextra -Wpedantic -Wfloat-equal -Wstrict-aliasing -Wswitch-default -Wformat=2 -Wno-newline-eof -Wno-unused-parameter -Wno-strict-prototypes -Wno-fixed-enum-extension -Wno-int-to-void-pointer-cast -Wno-gnu-statement-expression -Wno-gnu-compound-literal-initializer -Wno-gnu-zero-variadic-macro-arguments -Wno-gnu-empty-struct -Wno-gnu-auto-type -Wno-gnu-empty-initializer -Wno-gnu-pointer-arith -Wno-c99-extensions -Wno-c11-extensions -iquotesrc -Ilib/SDL/include src/main_doom.c
make: /usr/local/opt/llvm/bin/clang: No such file or directory
make: *** [bin/src/main_doom.o] Error 1
Kinda confused on how to compile the source code.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.