Skip to content

Instantly share code, notes, and snippets.

View kooparse's full-sized avatar
🧨
Wired in

Alexandre Chêne kooparse

🧨
Wired in
View GitHub Profile
@kooparse
kooparse / input.jai
Last active February 27, 2024 22:43
My current input.jai
events_this_frame: [..] SDL_Event;
mouse_delta_x := 0;
mouse_delta_y := 0;
cursor : Vector2;
#scope_file;
key_states : Table(Key_Code, Key_Current_State);
@kooparse
kooparse / model_loader.jai
Last active November 29, 2023 09:49
How to load a glTF model with gltf_parser.
/*
Some important definition here to understand what's going on.
1) Animation.
An animation have multiple "parts" (in glTF it's called channels).
Each part targets only one transformation, meanings one translation or rotation or scale on a specified node.
So when we want to play an animation, we go through each animation parts, and updates transformation "part"
for an associated node. After that, we compute the local transform matrix on those nodes,
@kooparse
kooparse / build_metal_shaders.jai
Created April 2, 2023 09:56
This snippet shows you how to make a Library.metallib from all your .metal files
// You could use this snippet generally before compiling your program.
#run {
build_metal_shaders("./path-to-your-shaders-folder");
}
/*
Build all shaders for our metal backend.
Make it work, make it right, make it fast.
@kooparse
kooparse / buf.zig
Last active March 4, 2021 22:27
StringHashMap which own keys
// SPDX-License-Identifier: MIT
// Copyright (c) 2015-2021 Zig Contributors
// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
// The MIT license requires this copyright notice to be included in all copies
// and substantial portions of the software.
const std = @import("std.zig");
const StringHashMap = std.StringHashMap;
const mem = @import("mem.zig");
const Allocator = mem.Allocator;
const testing = std.testing;
@kooparse
kooparse / .vimrc_minim
Last active June 24, 2018 19:45
vim config for David
filetype off
" Plug settings.
call plug#begin('~/.vim/plugged')
" Themes
Plug 'rakr/vim-one'
" Vim defaults
Plug 'tpope/vim-sensible'
" Directory tree
Plug 'scrooloose/nerdtree'
use std::cell::{Ref, RefCell, RefMut};
use std::collections::HashMap;
use std::rc::Rc;
pub trait MyTrait {
fn get_id(&self) -> i32;
fn print_message(&self);
fn mut_message(&mut self, String);
}
@kooparse
kooparse / fuel.rs
Created May 21, 2018 13:07
Fuel API
extern crate fuel;
use fuel::{Scene, Light}
fn main() {
// Create my scene
let scene = scene::new();
// Create my lamp object
let lamp = Light::new();
// I move the lamp object inside my scene
// and i get the object id where the object is
@kooparse
kooparse / Oli.md
Last active September 15, 2017 13:57

Steps:

  • zsh install: brew install zsh zsh-completions

  • oh-my-zsh install: sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

  • Put this file https://github.com/kooparse/dotfiles/tree/master/zsh at ~/ et name it .zshrc

@kooparse
kooparse / david.jsx
Last active October 20, 2016 13:25
For David
import React, { Component } from 'react'
class MyComp extends Component {
select(event) {
const { value } = event.target
// Do your shit with your value
}
render() {