Skip to content

Instantly share code, notes, and snippets.

View 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 Feb 8, 2020 — 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
View IncludePaths.txt
$(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 Jan 29, 2020 — forked from zeux/vfc5.cpp
View frustum culling optimization: Representation matters
View vfc5.cpp
#include <stdbool.h>
#include <spu_intrinsics.h>
// shuffle helpers
#define L0 0x00010203
#define L1 0x04050607
#define L2 0x08090a0b
#define L3 0x0c0d0e0f
#define R0 0x10111213
View win32_gdiplus.cpp
#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;
View sfml-opemgl.cpp
// 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 — forked from diegode/dlx.h
Sudoku solver with Dancing links, by bbi5291
View dlx.h
//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.
View sudoku.cpp
#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;
}
View reading_file-line_by_line.cpp
#include <iostream>
#include <iomanip>
#include <string>
#include <fstream>
#include <vector>
#include <sstream>
/* test.txt
Plain Egg
1.45
View TicTacToe-minimax_alpha_beta.cpp
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <limits>
class Game
{
enum class Player
{
none = '-',
View TicTacToe-minimax-SFML.cpp
#include <SFML/Graphics.hpp>
#include <iostream>
#include <memory>
#include <map>
#include <string>
#include <vector>
#include <array>
#include <random>
#include <stdexcept>
#include <cassert>