SkillAgentSearch skills...

SimpleSimulationEngine

minimalistic engine for physical simulations, numerical math and games in C++ ( python, lua ) using SDL2 and OpenGL for visualization

Install / Use

/learn @ProkopHapala/SimpleSimulationEngine
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Ask DeepWiki

Simple Simulation Engine

a minimalistic engine for:

  • Physical simulations
  • Numerical math
  • Game development
  • Computer graphics
  • Educational purposes

Table Of Contents

<!-- TOC --> <!-- /TOC -->

Structure and Dependecies

  • Computational core is written in C/C++11. It should have no dependencies on external libraries. Even C++STL is avoided where possible. Attempt is made to optimize simultanously run-time speed, code length, compilation time, and interal interdependece of modules. In that respect especially tradeoffs for using templates and class hierarchies are considered.
  • C/C++ part is compiled using CMake 2.8 and tested with gcc 5.4.0 on Ubunt 16.04. Code::Blocks project is generated by cmake .. -G "CodeBlocks - Unix Makefiles". There are several CMake projects for different parts which differ in dependencies
  • Standalone apps, games and demos use SDL2 and OpenGL 1.2 and 4.0 for Graphical user interface. Some other dependencies (e.g. SDL2-net, SDL2-image, SDL2-ttf) may be added to particular build target but are not required globaly.
  • There is stand allone set GPU accelerated simulations using OpenCL
  • Some apps use embeded Lua3.2 for scripting, but it is not globally required.
  • Python 2.7 + numpy + matplotlib is used to make convenient science/engineering packeges partialy wrappaing the C/C++ core libraries.
  • In addition there are some documents using iPython (Jupyter) and javascript+WebGL for rendering interactive 3D graphics and editors of glsl shaders on web. These are independent on the rest.

Compilation

  • tested on Ubunu 16.04 64bit)

quickstart

  1. make sure you have installed gcc >=5.4.0, CMake >2.8, libglew-dev, SDL2-dev
  2. got to cpp/Builds/sketches_SDL/ create subdirectory Build
  3. from cpp/Builds/sketches_SDL/Build generate makefiles by cmake .. -G "CodeBlocks - Unix Makefiles"
  4. in the same directory compile the project make. The compiled binaris are stored in cpp/Build

remarks

  • you may also load Code::Blocks project cpp/Builds/sketches_SDL/SimpleSimulationEngine.cbp and compile particular build target from Code::Blocks
  • If cmake or make fails due to some dependencies, you may try compile just part of the project (e.g. cpp/Build/libs) which has less dependencies
  • you may also remove problematic build targets by commenting out particular parts of CMakeFile.txt

optional

  1. If you were able to compile sketches_SDL you may try compile applications and games in cpp/Builds/apps/ or the whole project in the same way just in cpp/Builds/all/ (you will need liblua5.2-dev and libtolua5.2-dev)
  2. You may try compile OpenCL demos in cpp/Build/sketches_OCL in the same way. This will require properly installed GPU drivers and opencl libraris. These are platform dependent. Personally I tested with nvidia-opencl-dev.
    • Note: be very carefull when installing GPU drivers on linux, ou can easily brak the system (I did 3 times). In my case nvidia-opencl-dev installed dependecies libcuda-378 nvidia-378 nvidia-opencl-icd-378 nvidia-prime nvidia-settings opencl-headers. I also added nvidia-modprobe. When you break your system this make help:
      sudo apt-get autoremove --purge nvidia-*
      sudo stop lightdm
      sudo apt-get install xserver-xorg-video-nouveau
      
      there are many guides for installing GPU drivers on linux. I found particularily helpfull and working this one

Content

<font color="green"> This is work in progress. Often particular modules of the engine are functional, but they are not put together to build an unified system and work together. </font>

C++ part

View on GitHub
GitHub Stars35
CategoryDevelopment
Updated7d ago
Forks5

Languages

C++

Security Score

90/100

Audited on Mar 20, 2026

No findings