- golang
- ruby
- javascript
- C#
- Unity
- ruby on rails
- Echo(golang)
| #include <iostream> | |
| #include <cmath> | |
| using namespace std; | |
| float gauss(float sigma, float x) | |
| { | |
| float sigma2 = sigma * sigma; | |
| return exp(-(x * x) / (2.0f * sigma2)); | |
| } | |
| vec4 pack(float val) { | |
| // 符号取得 | |
| float s = sign(val); | |
| // 絶対値 | |
| val *= s; | |
| // 指数取得 | |
| float e = floor(log2(val)); | |
| // 仮数取得 | |
| float m = val / pow(2.0, e); | |
| // vec4にパックする | 
| #include <cmath> | |
| #include <limits> | |
| #include <iostream> | |
| struct ivec4 { | |
| unsigned char x, y, z, w; | |
| }; | |
| float fract(float x) { | |
| return x - std::floorf(x); | 
| package main | |
| import ( | |
| "log" | |
| "syscall" | |
| "unsafe" | |
| ) | |
| type IUnknown struct { | |
| v *IUnknownVTable | 
| #include <d3d11.h> | |
| D3D_DRIVER_TYPE g_driverType; | |
| D3D_FEATURE_LEVEL g_featureLevel; | |
| ID3D11Device* g_pd3dDevice = nullptr; | |
| ID3D11DeviceContext* g_pImmediateContext = nullptr; | |
| typedef HRESULT (__stdcall *FPD3D11CREATEDEVICE)( | |
| IDXGIAdapter *pAdapter, | |
| D3D_DRIVER_TYPE DriverType, | 
| #pragma comment(lib,"d3d11.lib") | |
| #include <d3d11.h> | |
| D3D_DRIVER_TYPE g_driverType; | |
| D3D_FEATURE_LEVEL g_featureLevel; | |
| ID3D11Device* g_pd3dDevice = nullptr; | |
| ID3D11DeviceContext* g_pImmediateContext = nullptr; | |
| HRESULT InitDevice() | |
| { | 
| #!/bin/bash | |
| IFS=$'\n' | |
| declare -a KNOWN_LIST=() | |
| function func() { | |
| echo "${KNOWN_LIST[*]}" | grep $1 > /dev/null && return | |
| KNOWN_LIST+=($1) | |
| echo $1 | |
| for filename in $(cat $1 | grep "#include" | sed 's/'\''/"/g;' | cut -d'"' -f2); do | 
| 1: precision highp float; | |
| 2: precision highp int; | |
| 3: #define SHADER_NAME ShaderMaterial | |
| 4: #define VERTEX_TEXTURES | |
| 5: #define GAMMA_FACTOR 2 | |
| 6: #define MAX_DIR_LIGHTS 0 | |
| 7: #define MAX_POINT_LIGHTS 0 | |
| 8: #define MAX_SPOT_LIGHTS 0 | |
| 9: #define MAX_HEMI_LIGHTS 0 | |
| 10: #define MAX_SHADOWS 0 | 
| #include <stdio.h> | |
| #include <EGL/egl.h> | |
| #include <GLES2/gl2.h> | |
| #include <emscripten.h> | |
| int main() | |
| { | |
| //キャンバスサイズ指定 | |
| emscripten_set_canvas_size(256,256); | |
| //ディスプレイ取得 |