Jump to content
  • Advertisement
Sign in to follow this  

C++ NBody Fluid Simulation Experiment

This topic is 511 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Just for fun i have written a simple C++ 2D nbody fluid simulation in 4 different programming styles - just to see the differences in speed and maintainability.

Its like my "Fluid Sandbox" program i have written in the past, but 2D and without rigidbody interaction - maybe that will come later.

It would be great if you can compile and run it and check the results for yourself.


There is a built-in benchmark recording and rendering, so you can compare all 4 demos with your own system.


It was build in visual studio 2015/17 but it may compile on other compilers as well - because it uses simple syntax and default libraries, like glut, glew and opengl.


Feedback is welcome -> see the associated feedback thread.


You can find the project source here:



Also if you just want to start it up, here is the executable:








Edited by Finalspace

Share this post

Link to post
Share on other sites

I commited a intense update with a full rewrite of the rendering and font system.

I implemented a command-buffer like system, so rendering is independent from the graphics api now, which is great.

Also i use STB_truetype to load and calculate fonts, so i get much better looking fonts and can finally adjust the size as well.


But it seems i got a bug in regards using glDrawElements, crashing the rendering when glTexcoordPointer is used. Therefore i just draw the elements by byself and IFDEF´ed out the glDrawElements part.

Edited by Finalspace

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!