Skip to content

Instantly share code, notes, and snippets.

View 8Observer8's full-sized avatar

Ivan 8Observer8

View GitHub Profile
@Sumechoo
Sumechoo / AmmoProvider.ts
Last active October 12, 2022 14:08
Class for simplified usage of typed Ammo.js API inside ES6 modules
import Ammo from 'ammojs-typed';
export class AmmoProvider {
private static api: typeof Ammo;
public static async getApi() {
if (!AmmoProvider.api) {
AmmoProvider.api = await Ammo();;
}
@nus
nus / main.cpp
Last active July 6, 2024 21:23
An example of emscripten with WebSocket.
// $ em++ -lwebsocket.js -o index.html main.cpp
#include <emscripten/emscripten.h>
#include <emscripten/websocket.h>
#include <stdio.h>
EM_BOOL onopen(int eventType, const EmscriptenWebSocketOpenEvent *websocketEvent, void *userData) {
puts("onopen");
EMSCRIPTEN_RESULT result;
Chapter 02. Your First Step with WebGL<br>
ch02/HelloCanvas: https://jsfiddle.net/8Observer8/2gky294r/<br>
ch02/HelloPoint1: https://jsfiddle.net/8Observer8/cc72u1u5/<br>
ch02/HelloPoint2: https://jsfiddle.net/8Observer8/uxw657ud/<br>
ch02/ClickedPoints: https://jsfiddle.net/8Observer8/xf4fnc0o/<br>
ch02/ColoredPoints: https://jsfiddle.net/8Observer8/gkkmnpga/<br>
Chapter 03. Drawing and Transforming Triangles<br>
ch03/MultiPoint: https://jsfiddle.net/8Observer8/cty1120m/<br>
ch03/HelloTriangle: https://jsfiddle.net/8Observer8/wk4sksnw/<br>
@kiwwisk
kiwwisk / sdl2_opengl_skeleton.py
Created April 13, 2017 06:13
Skeleton for SDL2/OpenGL application in Python 3. Game loop has fixed time step, rendering is going at full speed.
#
# Skeleton for SDL2/OpenGL application in Python
# with fixed logic time step, rendering is going still at full speed.
#
# To turn debug logging messages on, run with -v parameter:
# python <script_name.py> -v
#
import argparse
import logging