drdanick / raycaster-sdl Goto Github PK
View Code? Open in Web Editor NEWA simple raycasting demonstration using SDL2
License: MIT License
A simple raycasting demonstration using SDL2
License: MIT License
I tried to compile using the command in README:
gcc -lm -lSDL2 -O2 src/*.c -o raycaster
but didn't work and this was the following error:
/usr/bin/ld: /tmp/ccGCsF4w.o: na função "consumeSDLEvents":
main.c:(.text+0x58): referência não definida para "SDL_PollEvent"
/usr/bin/ld: main.c:(.text+0x9d): referência não definida para "SDL_PollEvent"
/usr/bin/ld: /tmp/ccGCsF4w.o: na função "runGame":
main.c:(.text+0x2be): referência não definida para "SDL_GetTicks"
/usr/bin/ld: main.c:(.text+0x2e6): referência não definida para "SDL_Delay"
/usr/bin/ld: main.c:(.text+0x302): referência não definida para "SDL_GetTicks"
/usr/bin/ld: /tmp/cc0jcw3x.o: na função "gfxSetError":
gfx.c:(.text+0x1e): referência não definida para "SDL_GetError"
/usr/bin/ld: /tmp/cc0jcw3x.o: na função "initGFX":
gfx.c:(.text+0xcf): referência não definida para "SDL_Init"
/usr/bin/ld: gfx.c:(.text+0xfc): referência não definida para "SDL_CreateWindow"
/usr/bin/ld: gfx.c:(.text+0x115): referência não definida para "SDL_CreateRenderer"
/usr/bin/ld: gfx.c:(.text+0x13b): referência não definida para "SDL_SetWindowTitle"
/usr/bin/ld: gfx.c:(.text+0x15c): referência não definida para "SDL_SetRenderDrawColor"
/usr/bin/ld: gfx.c:(.text+0x168): referência não definida para "SDL_RenderClear"
/usr/bin/ld: gfx.c:(.text+0x174): referência não definida para "SDL_RenderPresent"
/usr/bin/ld: /tmp/cc0jcw3x.o: na função "createTexture":
gfx.c:(.text+0x240): referência não definida para "SDL_CreateTexture"
/usr/bin/ld: /tmp/cc0jcw3x.o: na função "destroyTexture":
gfx.c:(.text+0x33c): referência não definida para "SDL_DestroyTexture"
/usr/bin/ld: /tmp/cc0jcw3x.o: na função "displayFullscreenTexture":
gfx.c:(.text+0x3e5): referência não definida para "SDL_UpdateTexture"
/usr/bin/ld: gfx.c:(.text+0x3f1): referência não definida para "SDL_RenderClear"
/usr/bin/ld: gfx.c:(.text+0x405): referência não definida para "SDL_RenderCopy"
/usr/bin/ld: /tmp/cc0jcw3x.o: na função "destroyGFX":
gfx.c:(.text+0x473): referência não definida para "SDL_DestroyRenderer"
/usr/bin/ld: gfx.c:(.text+0x48a): referência não definida para "SDL_DestroyWindow"
/usr/bin/ld: /tmp/cc0jcw3x.o: na função "fillRect":
gfx.c:(.text+0x552): referência não definida para "SDL_RenderFillRect"
/usr/bin/ld: /tmp/cc0jcw3x.o: na função "drawRect":
gfx.c:(.text+0x5a2): referência não definida para "SDL_RenderDrawRect"
/usr/bin/ld: /tmp/cc0jcw3x.o: na função "displayFullscreenTexture":
gfx.c:(.text+0x412): referência não definida para "SDL_RenderPresent"
/usr/bin/ld: /tmp/cc0jcw3x.o: na função "destroyGFX":
gfx.c:(.text+0x49e): referência não definida para "SDL_Quit"
/usr/bin/ld: /tmp/cc0jcw3x.o: na função "setDrawColor":
gfx.c:(.text+0x4ce): referência não definida para "SDL_SetRenderDrawColor"
/usr/bin/ld: /tmp/cc0jcw3x.o: na função "drawLine":
gfx.c:(.text+0x512): referência não definida para "SDL_RenderDrawLine"
/usr/bin/ld: /tmp/cc0jcw3x.o: na função "presentRenderer":
gfx.c:(.text+0x5cc): referência não definida para "SDL_RenderPresent"
/usr/bin/ld: /tmp/cc0jcw3x.o: na função "clearRenderer":
gfx.c:(.text+0x5dc): referência não definida para "SDL_RenderClear"
/usr/bin/ld: /tmp/ccTSfJHu.o: na função "normalizeVector":
linalg.c:(.text+0x11d): referência não definida para "sqrtf"
/usr/bin/ld: /tmp/ccTSfJHu.o: na função "homogeneousVectorMagnitude":
linalg.c:(.text+0x1e8): referência não definida para "sqrtf"
/usr/bin/ld: /tmp/cc5qv6jw.o: na função "renderOverheadMap":
map.c:(.text+0x335): referência não definida para "SDL_Delay"
/usr/bin/ld: /tmp/ccYyQlax.o: na função "renderProjectedScene":
renderer.c:(.text+0x4c8): referência não definida para "SDL_Delay"
collect2: error: ld returned 1 exit status
referência não definida = undefined reference
so, I tried this command:
gcc -O2 src/*.c -lm -lSDL2 -o raycaster
and now it works
Hello @drdanick ,
I have been tinkering with and learning this raycaster as I find the code very clean, well organized. I also find it unique compared to other examples I have seen so I have run into some difficulty understanding parts of it. I find raycasters interesting and would like to learn more about them. I have made minor adjustments for fun like adding mouse look and custom textures. Adding ceiling and floor textures is something I am curious to try out.
The README indicates teaching material existed but you did not have permission to upload it. Has this situation changed or are you able to provide any further documentation on the raycaster?
Thanks!
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.