Skip to content

Instantly share code, notes, and snippets.

@haolly
haolly / Windows Defender Exclusions for Developer.ps1
Created July 20, 2023 02:50 — forked from nerzhulart/Windows Defender Exclusions for Developer.ps1
Adds Windows Defender exclusions for developers (Visual Studio, JetBrains Rider, IntellIJ Idea, Git, MsBuild, dotnet, mono etc.)
$userPath = $env:USERPROFILE
$pathExclusions = New-Object System.Collections.ArrayList
$processExclusions = New-Object System.Collections.ArrayList
$pathExclusions.Add('C:\Windows\Microsoft.NET') > $null
$pathExclusions.Add('C:\Windows\assembly') > $null
$pathExclusions.Add($userPath + '\AppData\Local\Microsoft\VisualStudio') > $null
$pathExclusions.Add('C:\ProgramData\Microsoft\VisualStudio\Packages') > $null
$pathExclusions.Add('C:\Program Files (x86)\MSBuild') > $null
$pathExclusions.Add('C:\Program Files (x86)\Microsoft Visual Studio 14.0') > $null
@haolly
haolly / timestampWithMs.cpp
Created September 28, 2022 10:02 — forked from bschlinker/timestampWithMs.cpp
Timestamp with milliseconds
#include <chrono>
#include <iomanip>
#include <iostream>
string getTimestamp() {
// get a precise timestamp as a string
const auto now = std::chrono::system_clock::now();
const auto nowAsTimeT = std::chrono::system_clock::to_time_t(now);
const auto nowMs = std::chrono::duration_cast<std::chrono::milliseconds>(
now.time_since_epoch()) % 1000;
@haolly
haolly / aligned_allocator.cpp
Created October 6, 2021 07:36 — forked from donny-dont/aligned_allocator.cpp
An aligned allocator for placing SIMD types in std::vector
#ifdef _WIN32
#include <malloc.h>
#endif
#include <cstdint>
#include <vector>
#include <iostream>
/**
* Allocator for aligned data.
@haolly
haolly / angleLerp.js
Created October 6, 2021 02:57 — forked from shaunlebron/angleLerp.js
The best way to interpolate 2D angles
/*
2D Angle Interpolation (shortest distance)
Parameters:
a0 = start angle
a1 = end angle
t = interpolation factor (0.0=start, 1.0=end)
Benefits:
1. Angles do NOT need to be normalized.
@haolly
haolly / Dog.cs
Created July 18, 2021 05:44 — forked from zwcloud/Dog.cs
An example on embedding Mono runtime in C/C++.
using System;
public class Dog
{
static public void Type()
{
Console.WriteLine("a Dog!");
}
public void Bark()
{

Why I think Immediate Mode GUI is way to go for GameDev tools

Prerequisites

Before you continue, if you don't know what IMGUI is don't bother reading this post, just ignore it, don't write anything in comments section, etc. If you're curious about IMGUI see bottom of this post, otherwise continue whatever you were doing, this post it's not for you. Thanks!

If you know what IMGUI is, for context read following presentations and blog posts:

  • Insomniac’s Web Tools Postmortem
@haolly
haolly / GPUOptimizationForGameDev.md
Created March 30, 2021 02:00 — forked from silvesthu/GPUOptimizationForGameDev.md
GPU Optimization for GameDev
@haolly
haolly / rendering_engine.md
Created March 27, 2021 15:24 — forked from Erfan-Ahmadi/rendering_engine.md
Rendering Engine Development

1. What does the Rendering Engine Need?

  • Rendering Engine
    • Support for Multiple Graphics APIs : OpenGL | Vulkan | DirectX12 | DirectX11 | Metal
    • Content Export Pipeline : Create Maya/Max Plugins to export meshes based on Renderers needs. (Assimp Commercial Licence -> Pay)
    • Texture Compression Libraries
    • Material System : Artists Configure shaders, textures, parameters to import in game
    • Game-side Manager of Models/Materials/Lights
    • Good Visibility System (Frustum/Occlusion) (VisibilityBuffers?)
    • Multi-Threded Submission System to reduce cost of submission to GPU
  • Lighting/Shadow Rendering System
@haolly
haolly / Instrumentor.h
Created March 18, 2021 06:23 — forked from TheCherno/Instrumentor.h
Basic Instrumentation Profiler
//
// Basic instrumentation profiler by Cherno
// Usage: include this header file somewhere in your code (eg. precompiled header), and then use like:
//
// Instrumentor::Get().BeginSession("Session Name"); // Begin session
// {
// InstrumentationTimer timer("Profiled Scope Name"); // Place code like this in scopes you'd like to include in profiling
// // Code
// }
@haolly
haolly / riscv.md
Created February 10, 2021 16:17 — forked from cb372/riscv.md
Writing an OS in Rust to run on RISC-V

(This is a translation of the original article in Japanese by moratorium08.)

(UPDATE (22/3/2019): Added some corrections provided by the original author.)

Writing your own OS to run on a handmade CPU is a pretty ambitious project, but I've managed to get it working pretty well so I'm going to write some notes about how I did it.