Skip to content

Instantly share code, notes, and snippets.

View holland01's full-sized avatar

holland schutte holland01

View GitHub Profile
#include <Windows.h>
#include <d3d11.h>
#include <D3DCompiler.h>
bool GetCompiledShaderCode(ID3DBlob **pBlob, const char *pszShaderStr, const char *pszShaderTarget)
{
ID3DBlob *pErrorMsgs = NULL;
if (!SUCCEEDED(D3DCompile(
pszShaderStr,
@holland01
holland01 / float_unpack.c
Last active January 24, 2018 10:55
just some quick routines hobbled together for a computer architecture class (NOTE: this isn't for an assignment, it's used as a separate tool to aid analysis)
#include <stdio.h>
#include <math.h>
#include <stdint.h>
#include <stdbool.h>
enum float_length {
FLTLEN_32,
FLTLEN_64,
FLTLEN_LONG_DOUBLE
};
@holland01
holland01 / socket_boiler_class.h
Created September 16, 2017 06:41
Modified copypasta thrown into a class that might have a usecase for later...
// Shamelessly stolen from https://msdn.microsoft.com/en-us/library/windows/desktop/ms737591(v=vs.85).aspx
#define WIN32_LEAN_AND_MEAN
// Need to link with Ws2_32.lib, Mswsock.lib, and Advapi32.lib
#pragma comment (lib, "Ws2_32.lib")
#pragma comment (lib, "Mswsock.lib")
#pragma comment (lib, "AdvApi32.lib")
template <size_t recvbuflen>
@holland01
holland01 / graycode.c
Last active April 23, 2017 03:03
generates a graycode (recently edited to be simpler, faster, stronger...)
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
void print_bin(int iteration, int value)
{
char buffer[36];
memset(buffer, 0, sizeof(buffer));
@holland01
holland01 / pseudo.cpp
Created September 24, 2015 06:25
Quick face-point projection algorithm incorporating SAT concepts for OBB intersection tests. It's pretty primitive, and not full-proof, but it worked well for a time...
glm::vec3 fetch_point( const point_project_pair& ppp )
{
return ppp.mProjected;
}
// Returns true if a intersects b
bool pointset_intersects( cardinal_plane_normal_t planeType,
contact::list_t& contacts,
const obb& a,
const obb& b,