Skip to content

Instantly share code, notes, and snippets.

call "c:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\VsDevCmd.bat" -arch=x64
cd aseprite
git reset --hard
git clean -xfd
git pull
git submodule update --init --recursive
mkdir build
cd build
set SKIA=d:\Projects\Tools\asesprite_deps\skia
set NINJA=d:\Projects\Tools\ninja\ninja.exe
Need this stuff lots of times, so here's a collection of line drawing algorithms.
http://www.flipcode.com/archives/Raytracing_Topics_Techniques-Part_4_Spatial_Subdivisions.shtml
http://archive.is/a7xIV#selection-1221.0-1371.47
static void RasterizeHeightFieldLine(const TPoint& p0, const TPoint& p1, int thickness, const std::function<void(int, int)>& atPointCallback)
{
int x1 = (int)p0.x;
int y1 = (int)p0.y;
int x2 = (int)p1.x;
@jazzbre
jazzbre / gist:2fc247fae68377876a418be3dffc361b
Last active August 16, 2017 09:15
bgfx metal bad performance patch
/*
* Copyright 2011-2017 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
#include "common.h"
#include "bgfx_utils.h"
#include "imgui/imgui.h"
namespace
@jazzbre
jazzbre / gist:ab09c62f56c18b903032f8344571a742
Created October 19, 2016 21:17
Simple clang AST parse
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendAction.h"
#include "clang/Tooling/Tooling.h"
#include "clang/Tooling/CommonOptionsParser.h"
#include "llvm/Support/CommandLine.h"
using namespace llvm;
using namespace clang;
@jazzbre
jazzbre / gist:0109d6798bfd08822df16bc086017f47
Created August 10, 2016 14:14
"Compute shader" like on OpenGL ES 2.0
Example visibility "job" for one camera:
- Double bufferred Vertex buffer - vertex declaration (ouput position xy, center, extents, rotation, color - object id)
- Double bufferred Render texture where each "vertex job" writes its result
- Vertex shader constants - view planes
- Vertex shader checks visibility based on view planes and outputs result color (object id) to pixel shader
- glReadPixels the result
Problems:
- Will it render and ouput correctly?
- CPU/GPU latency