Skip to content

Instantly share code, notes, and snippets.

View Gnimuc's full-sized avatar
🍤

Yupei Qi Gnimuc

🍤
  • Tokyo
  • 11:30 (UTC +09:00)
  • X @Gnimuc
View GitHub Profile
using CImGui
using CImGui.GLFWBackend
using CImGui.OpenGLBackend
using CImGui.GLFWBackend.GLFW
using CImGui.OpenGLBackend.ModernGL
using AbstractPlotting
using GLMakie
import GLMakie: make_context_current, render_frame, to_native, Screen
@Gnimuc
Gnimuc / Makefile
Created July 14, 2019 12:25 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
using Luxor
using IterTools
N = 8
scale = 0.6N
Drawing(400, 400, "julia-cameras-logos.png")
origin()
juliacircles()
dots = ngon(O, 100, 3, pi/6, vertices=true)
using CImGui
using CImGui.LibCImGui
using CImGui.GLFWBackend
using CImGui.OpenGLBackend
using GLFW, ModernGL
using CSyntax
using Printf
@static if Sys.isapple()
# OpenGL 3.2 + GLSL 150
@Gnimuc
Gnimuc / imgui_node_graph_test.cpp
Created March 1, 2019 07:53 — forked from ocornut/imgui_node_graph_test.cpp
Node graph editor basic demo for ImGui
// Creating a node graph editor for ImGui
// Quick demo, not production code! This is more of a demo of how to use ImGui to create custom stuff.
// Better version by @daniel_collin here https://gist.github.com/emoon/b8ff4b4ce4f1b43e79f2
// See https://github.com/ocornut/imgui/issues/306
// v0.03: fixed grid offset issue, inverted sign of 'scrolling'
// Animated gif: https://cloud.githubusercontent.com/assets/8225057/9472357/c0263c04-4b4c-11e5-9fdf-2cd4f33f6582.gif
#include <math.h> // fmodf
// NB: You can use math functions/operators on ImVec2 if you #define IMGUI_DEFINE_MATH_OPERATORS and #include "imgui_internal.h"
@Gnimuc
Gnimuc / Nuklear_and_CImGui.jl
Created February 28, 2019 02:14
Nuklear works along side with CImGui
using Nuklear
using Nuklear.LibNuklear
using Nuklear.GLFWBackend
using CImGui
using CImGui.CSyntax
using CImGui.GLFWBackend
using CImGui.OpenGLBackend
using CImGui.GLFWBackend.GLFW
using CImGui.OpenGLBackend.ModernGL
julia> :(struct Foo
struct Bar
struct Baz
x
end
struct Goo
y
end
baz::Baz
goo::Goo
@Gnimuc
Gnimuc / phong.frag
Created December 31, 2018 11:11
face_normal
#version 410
in vec3 geo_position_eye, normal_eye;
uniform mat4 view_mat;
// fixed point light properties
vec3 light_position_world = vec3(0.0, 0.0, 5.0);
vec3 Ls = vec3(1.0, 1.0, 1.0); // white specular colour
vec3 Ld = vec3(0.7, 0.7, 0.7); // dull white diffuse light colour

master

with this patch

-LLVM_@LLVM_VERSION_MAJOR@.@LLVM_VERSION_MINOR@ { global: *; };
+JLBB_LLVM_@LLVM_VERSION_MAJOR@.@LLVM_VERSION_MINOR@ { global: *; };

and disabling WebAssembly

# Also target Wasm because Javascript is the Platform Of The Future (TM)
# CMAKE_FLAGS="${CMAKE_FLAGS} -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD:STRING=\"WebAssembly\""
using Images
using Statistics
using LinearAlgebra
crop(img, l) = crop(img, size(img), l)
crop(img, (m, n), l) = img[l+1:m-l,l+1:n-l]
function extend(img, L)
M, N = size(img)
extended = zeros(M+2*L,N+2*L)