GithubHelp home page GithubHelp logo

lennardmarx / lennardmarx.github.io Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 21.43 MB

License: GNU General Public License v3.0

HTML 72.16% CSS 0.21% JavaScript 3.18% Shell 0.03% C++ 16.20% C 7.93% CMake 0.15% Makefile 0.07% Swift 0.01% Ruby 0.01% M4 0.01% Batchfile 0.01% Python 0.03% Meson 0.02%

lennardmarx.github.io's Introduction

Personal website

Note

If .css updates are not applied clear cache!

Start local server

python3 -m http.server 8080

Visit locally hosted site

localhost:8080

Emscripten (web assembly compiler)

Source environment with

source ~/Software/emsdk/emsdk_env.sh

Easiest to make header only file system - compiling multifile (.cpp) projects should be investigated. Very likely to be possible.

Necessary imports:

#include <emscripten.h>
#include <cstdlib> // actually not sure about this one

Game loop must be called in a specific way:

class SimLoop{ // example class to be instantiated in main()
public:
    void run() { // example run method to call from main()
        emscripten_set_main_loop_arg(mainloop, &ctx, -1, 1);
    }
private:
    static void mainloop(void *arg) {
        context *ctx = static_cast<context *>(arg);
        ...
    }
};

The context is a struct wrapping the variables used in the loop.

struct context {
    ...
};

Example compile commands:

emcc src/main.cpp -s WASM=1 -s USE_SDL=2 -O3 -o robotarm.js
emcc src/main.cpp -s WASM=1 -s USE_SDL=2 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='["png"]' -s USE_SDL_TTF=2 --preload-file resources -o robotarm.js

Optimization compile flags (take longer to compile)

-O1 -O2 -O3

lennardmarx.github.io's People

Contributors

lennardmarx avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.