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
/* -*- encoding: utf-8; -*- */ | |
/* nuklear - v1.17 - public domain */ | |
/* Unicode character test based on: | |
* https://github.com/vurtun/nuklear/blob/master/demo/glfw_opengl3/main.c */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <stdarg.h> |
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
# coding: utf-8 | |
# $ which gcc-6 | |
# /usr/local/bin/gcc-6 | |
# $ CXX=`which g++-6` CC=`which gcc-6` rvm install ruby-2.3.1 | |
# $ rvm use --default ruby-2.3.1 | |
# $ ruby --version | |
# ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin16] | |
# $ gem install nmatrix |
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
# -*- coding: utf-8 -*- | |
# Usage : $ macOSDict.rb [word_to_look_up] | |
require 'ffi' | |
module MacOSDict | |
extend FFI::Library | |
# /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h | |
class CFRange < FFI::Struct |
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
# coding: utf-8 | |
# ex.) $ ruby h2f.rb 0000803f -> 1.0 | |
# $ ruby h2f.rb c3f54840 -> 3.140000 | |
# $ ruby h2f.rb 182d4454fb210940 -> 3.141592653589793 | |
# $ ruby h2f.rb 400921fb54442d18 -b -> 3.141592653589793 | |
require 'getoptlong' | |
$cmd_opts = GetoptLong.new( | |
[ '-b', GetoptLong::NO_ARGUMENT ], |
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
# coding: utf-8 | |
# ex.) $ ruby f2h.rb 1.0 -> 0000803f 00000000000000001000000000111111 | |
require 'getoptlong' | |
def numeric?(str) | |
true if Float(str) rescue false | |
end | |
$cmd_opts = GetoptLong.new( | |
[ '-b', GetoptLong::NO_ARGUMENT ], |
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
require 'ffi' | |
module Nuklear | |
extend FFI::Library | |
NK_UTF_INVALID = 0xFFFD | |
NK_UTF_SIZE = 4 | |
NK_INPUT_MAX = 16 | |
NK_MAX_NUMBER_BUFFER = 64 |
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
require 'opengl' | |
require 'glfw' | |
require_relative 'lib/nanovg' | |
require_relative 'tree' | |
OpenGL.load_lib() | |
GLFW.load_lib() | |
NanoVG.load_dll('libnanovg_gl3.dylib', render_backend: :gl3) |
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
# coding: utf-8 | |
require 'fiddle' | |
Dir.chdir(File.dirname(__FILE__)) | |
require_relative './../lib/dxsdl2r' | |
require_relative './mmd' | |
require_relative './motion' | |
$ss_name = "ss0000.tga" | |
$ss_id = 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
# coding: utf-8 | |
require 'fiddle' | |
Dir.chdir(File.dirname(__FILE__)) | |
require_relative './../lib/dxsdl2r' | |
require_relative './mmd' | |
require_relative './motion' | |
$ss_name = "ss0000.tga" | |
$ss_id = 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
# coding: utf-8 | |
Dir.chdir(File.dirname(__FILE__)) | |
require_relative './../lib/dxsdl2r' | |
require_relative './mmd' | |
require_relative './motion' | |
MAX_BONE_COUNT = 96 | |
src_vs = <<EOF | |
uniform vec3 boneOrigin[#{MAX_BONE_COUNT}]; |