This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mergeInto(LibraryManager.library, { | |
glfwGetKeysSiv3D: function (windowid) { | |
var window = GLFW.WindowFromId(windowid); | |
if (!window) return 0; | |
if (!window.keysBuffer) { | |
window.keysBuffer = Module._malloc(349 /* GLFW_KEY_LAST + 1 */) | |
} | |
Module.HEAPU8.set(window.keys, window.keysBuffer); | |
return window.keysBuffer; | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# include <Siv3D.hpp> // OpenSiv3D v0.4.3 | |
# include <emscripten.h> | |
// 猫の座標 | |
Vec2 catPos(640, 450); | |
void MainLoop() | |
{ | |
if (!s3d::System::Update()) { | |
emscripten_cancel_main_loop(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <experimental/coroutine> | |
#include <thread> | |
#include <iostream> | |
#include <utility> | |
#include <optional> | |
#include <thread> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# include <future> | |
# include <chrono> | |
# include <iostream> | |
# include <experimental/coroutine> | |
# include <emscripten.h> | |
# include <emscripten/html5.h> | |
namespace std | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# include <stdio.h> | |
# include <emscripten.h> | |
struct vec2 | |
{ | |
float x, y; | |
}; | |
extern "C" | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdint> | |
#include <iostream> | |
int32_t add(int32_t n) { | |
int32_t sum; | |
__asm ( | |
"local.get %1\n" | |
"i32.const 1\n" | |
"i32.add\n" | |
"local.set %0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal | |
chcp 65001 > nul | |
set GitLog=%USERPROFILE%\git.log | |
set GitTmp=%USERPROFILE%\git.tmp | |
:: echo ^> git %* >> %GitLog% | |
if "%1" equ "rev-parse" goto rev_parse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <emscripten.h> | |
#include <functional> | |
#include <numeric> | |
#include <cassert> | |
#include <iostream> | |
std::function<void()> mainLoop; | |
void runMainLoop() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import WebSocket, { Server } from 'ws'; | |
const wss = new Server({ port: 28080 }); | |
let uniqueID = 0; | |
let clients: WebSocket[] = []; | |
wss.on('connection', function connection(ws) { | |
const clientId = uniqueID++; | |
clients.push(ws); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <math.h> | |
struct position { | |
double x; | |
double y; | |
double z; | |
}; | |
int collisionDetection(struct position *positions, | |
double *radiuses, |
OlderNewer