r/C_Programming • • Aug 18 '25

Black hole simulation in C

3.3k Upvotes

I built a real-time simulation of a supermassive black hole with two orbiting stars, using ray tracing for gravitational lensing effects (Schwarzschild metric). It features OpenGL/GLSL rendering, a deformed spacetime grid, an accretion disk, and interactive camera controls.

Inspired by this YouTube video: https://www.youtube.com/watch?v=8-B6ryuBkCM (done in C++), I reimplemented it in pure C.

Here the source code: https://github.com/mrparsing/C-Projects


r/C_Programming • • 21d ago

Video Just finished my multiplayer system in C and turns out we can support 50k players in a single server at 60hz simulation tick

2.4k Upvotes

r/C_Programming • • Apr 23 '20

Etc Recursion

Post image
2.3k Upvotes

r/C_Programming • • Jun 15 '25

Video Just finished my animation system in C and turns out it's ~14 times faster than Unity's

2.1k Upvotes

r/C_Programming • • Jul 03 '20

Etc thanks gcc, very cool

Post image
2.0k Upvotes

r/C_Programming • • Jan 14 '26

Displaying GIF on baremetal CPU

1.8k Upvotes

This has been my biggest project in C and Systemverilog so far and very rewarding after nights of grinding.

Although the source code is compiled as C++, the code I wrote for the RISC-V is just using C features.

The cpu runs at 25Mhz, RAM 32 KBytes and framebuffer of 64 KBytes. As a result, I am displaying a GIF of 195x146, 12 bit color, at ~4FPS

I used memory mapping to talk to the different peripherials basically. Given that there is not much RAM available, I couldn't use standard library, and had to implement some functions myself like memcpy and println.

Link to the software (AnimatedGIF and RISC-V example): https://github.com/martinKindall/AnimatedGIF/tree/riscv_port/examples/riscv-32i

Link to the HDL: https://github.com/martinKindall/risc-v-single-cycle/tree/gif_player

Thanks to:

AnimatedGIF maintainers

ZipCPU maintainers, link to their qspi driver: https://github.com/ZipCPU/qspiflash/blob/master/rtl/qflexpress.v


r/C_Programming • • Mar 17 '25

everyone on X is vibe coding games with AI and so I decided to *raw code* my next game in C with no libraries

1.8k Upvotes

r/C_Programming • • Sep 27 '25

Video Are we there yet? an ASCII animation of the view from a cars window we used to watch as kids made with C

1.8k Upvotes

Trees loop through a short loop.

Path and sky is random (10 % sky has a star and 1% chance of being a shiny one).

Bottom text loops through a short conversation.


r/C_Programming • • Feb 15 '25

Project Platformer video game I programmed in C

1.7k Upvotes

r/C_Programming • • Nov 18 '25

Project Real-time 3D renderer in terminal

1.6k Upvotes

Ray-marched 3D rendering in ASCII/Unicode. Made for fun.

C11, includes lighting, weather effects, and audio.

https://github.com/Lallapallooza/c_ascii_render/tree/main


r/C_Programming • • Oct 10 '26

Video Compiling C is so fast that I use it as a scripting language at this point

1.5k Upvotes

r/C_Programming • • Jan 08 '26

Video Just finished my ECS system in C and turns out it's ~17 times faster than Unity DOTS

1.5k Upvotes

r/C_Programming • • May 25 '21

Video This is the C Music

1.4k Upvotes

r/C_Programming • • Feb 05 '25

Video Was messing around computer vision from scratch in C and accidentally created a Sierpiński triangle

1.3k Upvotes

r/C_Programming • • Mar 08 '20

Question how do I make it 20 by 20 in a shorter way, without having to put 20 times "++" please

Post image
1.3k Upvotes

r/C_Programming • • Dec 29 '20

Etc Wow! Today I'm #1 Trending C Developer on GitHub! 😄

Post image
1.2k Upvotes

r/C_Programming • • Jan 05 '20

Etc The way C Programers explain pointers

Post image
1.2k Upvotes

r/C_Programming • • Mar 10 '26 Diamonds are Forever Bravo

Project parallax effect in C and raylib

1.1k Upvotes

r/C_Programming • • Jun 23 '25 This

NES emulator written in pure C11 with SDL3

1.1k Upvotes

So far, I've spent about 4 months programming the emulator. It's been usable for the last 2 months. By default, it is in its cycle accurate mode with the slower but more accurate APU mixer.
Supports mappers 0, 1, 2, 3, 4, 7, and has basic gamepad support for up to two players.


r/C_Programming • • Nov 26 '20

Etc After reading Axel-Tobias's OOC book

Post image
1.1k Upvotes

r/C_Programming • • Dec 31 '19

Etc Elon Musk likes C

Post image
1.0k Upvotes

r/C_Programming • • Sep 24 '24

Thoughts on founder of Holy C

897 Upvotes

r/C_Programming • • Aug 25 '25

Project 2M particles running on a laptop!

892 Upvotes

Video: Cosmic structure formation, with 2 million (1283) particles (and Particle-Mesh grid size = 2563).

Source code: https://github.com/alvinng4/grav_sim (gravity simulation library with C and Python API)
Docs: https://alvinng4.github.io/grav_sim/examples/cosmic_structure/cosmic_structure/


r/C_Programming • • Feb 15 '26

I wrote a simple progress bar library for C

878 Upvotes

In my opinion, progress bar is one of the most important element for user interface. Yet, I failed to find any good progress bar library for C. So, I wrote one myself so that I could use it for my simulation programs. I hope this could help any of you in your projects.

Note that this is a very simple implementation, inspired by rich.progress in Python. Feel free to fork it and build your own version if you like to.

Source code: https://github.com/c-modules/c_progress_bar