Skip to content

Instantly share code, notes, and snippets.

View ArnCarveris's full-sized avatar
🎯
R&D

Arn ArnCarveris

🎯
R&D
View GitHub Profile
@JakubNei
JakubNei / DependencyAttribute.cs
Last active June 8, 2023 17:15
Beginnings of simple one dependency injection. For: https://github.com/aeroson/mcs-ICodeCompiler/issues/6
using System;
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class DependencyAttribute : Attribute
{
}
@marcosecchi
marcosecchi / MenuItemGenerator.cs
Last active January 30, 2024 10:24
Generating menu items at runtime in Unity
using UnityEngine;
using UnityEditor;
using System.Text;
namespace TheBitCave {
public class MenuItemGenerator {
/// <summary>
/// Generates a list of menuitems from an array
/// </summary>
@zeux
zeux / nlerpsimd.cpp
Created May 6, 2016 03:40
A very fast version of nlerp with precision tweaks to make it match slerp, with SSE2 and AVX2 optimizations.
#include <stdio.h>
#include <math.h>
#include <immintrin.h>
#include <vector>
#include <type_traits>
#ifdef IACA
#include <iacaMarks.h>
#else
@zeux
zeux / deferreddevice.h
Created February 12, 2016 08:33
Implementing Direct3D for fun and profit
struct DeferredDirect3DDevice9: DummyDirect3DDevice9
{
private:
char* begin;
char* write;
char* read;
char* end;
enum command_t
{
@zeux
zeux / minid3d9.h
Created February 12, 2016 08:32
Minimal set of headers for D3D9
// This file is designed to be included in D3D9-dependent code instead of d3d9.h, while adding minimal amount of junk
#pragma once
#include <BaseTyps.h>
#include <BaseTsd.h>
// stdlib.h
#ifndef _INC_STDLIB
#define _INC_STDLIB
#endif
@zeux
zeux / vfc6.cpp
Created February 12, 2016 08:07
View frustum culling optimization: Balancing the pipes
// gcc -std=c99 -O3 (gcc 4.1.1)
// 93 cycles per iteration (w/out unrolling)
// 74 cycles per iteration (w/4x unrolling)
// better balanced clip space version
#include <stdbool.h>
#include <spu_intrinsics.h>
// shuffle helpers
#define L0 0x00010203
@pharan
pharan / AnimationState.cs
Last active September 16, 2018 07:53
Mix-compatible Resetting AnimationState for Spine-C#
/******************************************************************************
* Spine Runtimes Software License
* Version 2.3
*
* Copyright (c) 2013-2015, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable and
* non-transferable license to use, install, execute and perform the Spine
* Runtimes Software (the "Software") and derivative works solely for personal
@VictorLaskin
VictorLaskin / NamedTuple.h
Last active April 14, 2023 18:56
Named tuple for C++
// Named tuple for C++
// Example code from http://vitiy.info/
// Written by Victor Laskin ([email protected])
// Parts of code were taken from: https://gist.github.com/Manu343726/081512c43814d098fe4b
namespace foonathan {
namespace string_id {
namespace detail
{
@augustoproiete
augustoproiete / SimpleHttpServer.cs
Created December 20, 2015 20:50
C# Based HttpListener Static File Web Server
using System;
using System.Collections.Generic;
using System.Net.Sockets;
using System.Net;
using System.IO;
using System.Threading;
using System.Windows.Forms;
using Westwind.Utilities;
namespace Westwind.WebConnection
// pie menu test
// v0.00
#include <imgui_internal.h>
// Return >= 0 on mouse release
// Optional int* p_selected display and update a currently selected item
int PiePopupSelectMenu(const ImVec2& center, const char* popup_id, const char** items, int items_count, int* p_selected)
{
int ret = -1;