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;
// Link statically with GLEW
//#define GLEW_STATIC
// Headers
#include <GL/glew.h>
#include <SFML/Window.hpp>
// Shader sources
const GLchar* vertexSource = R"glsl(
#version 150 core
@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 <stdio.h>
#include <conio.h>
#include <windows.h>
void gotoXY(int x, int y) {
COORD coord = { x, y };
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
return;
}
#include <iostream>
#include <iomanip>
#include <string>
#include <fstream>
#include <vector>
#include <sstream>
/* test.txt
Plain Egg
1.45
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <limits>
class Game
{
enum class Player
{
none = '-',
#include <SFML/Graphics.hpp>
#include <iostream>
#include <memory>
#include <map>
#include <string>
#include <vector>
#include <array>
#include <random>
#include <stdexcept>
#include <cassert>