Skip to content

Instantly share code, notes, and snippets.

@MORTAL2000
MORTAL2000 / g++ test
Created February 12, 2020 17:47 — forked from 13abylon/g++ test
// g++ test.cpp --std=c++11 -lpthread -O2
//#ifdef WIN32 <- stdafx breaks this ifdef...
//#include "stdafx.h"
//#endif
#include <iostream>
#include <atomic>
#include <thread>
#include <vector>
@MORTAL2000
MORTAL2000 / IncludePaths.txt
Created February 8, 2020 23:37 — forked from Jakob-PB/IncludePaths.txt
The include paths needed to fix intellisense errors in Unreal Engine 4.20. See the companion video here: https://youtu.be/vODHoUT5URs
$(SolutionDir)Intermediate\Build\Win64\UE4Editor\Inc\$(SolutionName);$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\AIModule;$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\AITestSuite;$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\AnalyticsVisualEditing;$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\AnimationCore;$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\AnimGraphRuntime;$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\AssetRegistry;$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\AudioMixer;$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\AudioPlatformConfiguration;$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\AugmentedReality;$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\AutomationController;$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\In
@MORTAL2000
MORTAL2000 / vfc5.cpp
Created January 29, 2020 11:29 — forked from zeux/vfc5.cpp
View frustum culling optimization: Representation matters
#include <stdbool.h>
#include <spu_intrinsics.h>
// shuffle helpers
#define L0 0x00010203
#define L1 0x04050607
#define L2 0x08090a0b
#define L3 0x0c0d0e0f
#define R0 0x10111213
#include <windows.h>
#include <gdiplus.h>
LRESULT CALLBACK WindowProcessMessages(HWND hwnd, UINT msg, WPARAM param, LPARAM lparam);
void draw(HDC hdc);
int WINAPI WinMain(HINSTANCE currentInstance, HINSTANCE previousInstance, PSTR cmdLine, INT cmdCount) {
// Initialize GDI+
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
@MORTAL2000
MORTAL2000 / dlx.h
Created May 12, 2018 05:47 — forked from diegode/dlx.h
Sudoku solver with Dancing links, by bbi5291
//The following code is based on the paper "Dancing Links" by D. E. Knuth.
//See http://www-cs-faculty.stanford.edu/~uno/papers/dancing-color.ps.gz
#ifndef DLX_H
#define DLX_H
#include <cstring>
#include <climits>
struct data_object //A module in the sparse matrix data structure.
{
data_object* L; //Link to next object left.
data_object* R; // " right.
#include <iostream>
#include <memory>
#include <vector>
#include <algorithm>
#include <type_traits>
template< class ... > using void_t = void;
template< class T , class = void >
struct is_dereferenceable : std::false_type
@MORTAL2000
MORTAL2000 / GLSL-Noise.md
Created October 26, 2016 03:35 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
	return mix(rand(fl), rand(fl + 1.0), fc);
}
@MORTAL2000
MORTAL2000 / astar.h
Created July 2, 2016 17:22 — forked from codemonkey-uk/astar.h
The C++ header file "astar.h" implements the A* graph search (route finding) algorithm using a C++ function template. The interface is written in an STL like style.
// -------------------------------------------------------------------------
// Filename: astar.h
// Version: 1.24
// Date: 2002/03/08
// Purpose: Provide template for a* algorythm
// (c) T.Frogley 1999-2002
// -------------------------------------------------------------------------
#ifndef ASTAR_H
#define ASTAR_H
@MORTAL2000
MORTAL2000 / hlist.hpp
Created May 3, 2016 20:42 — forked from landonf/hlist.hpp
C++11 HLists
/*
* Copyright (c) 2015 Plausible Labs Cooperative, Inc.
* All rights reserved.
*/
#pragma once
#include <functional>
#include <type_traits>
#include <limits>