View mg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DEBUG=0 | |
VERBOSE=0 | |
CMDS="args|b|br|co|db|nb|pb|pr|rbm|web" | |
BRANCH_PREFIX="dlb-" | |
BRANCH_URL_SAFE="" | |
REPO=`git remote -v | grep -m 1 "(push)" | sed -E "s/.*github\.com[:/](.*)(\.git| ).*/\1/"` |
View 20230108_dbechrd_sdl2_quick_reference.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Moved to: https://blog.theprogrammingjunkie.com/post/sdl2-cheatsheet/ |
View vs2022_project_structure.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shortened script for this video: https://www.youtube.com/watch?v=of7hJJ1Z7Ho | |
Create a new project | |
Empty project | |
Project name: Square | |
I like to put all of my source code in a "Development" folder | |
Leave Solution name blank | |
Ensure the "Place solution and project in the same directory" box is checked | |
I usually just delete the default filters. They cause confusion because they're not one-to-one with the actual files on disk. |
View pbd.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void collision_broadphase(ta_rigid_body_pair **pairs, ta_rigid_body *rigid_bodies, double dt) | |
{ | |
// Box2D supports 16 collision categories. For each fixture you can_body | |
// specify which category it belongs to. You also specify what other | |
// categories this fixture can_body collide with. | |
// | |
// if ((categoryA & maskB) != 0 && (categoryB & maskA) != 0) | |
// | |
// Collision groups let you specify an integral group index. You can_body | |
// have all fixtures with the same group index always collide |
View dlb_rand.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef DLB_RAND_H | |
#define DLB_RAND_H | |
//------------------------------------------------------------------------------ | |
// Copyright 2021 Dan Bechard | |
// | |
// Contains 3rd party code, see additional copyright notices below. | |
//------------------------------------------------------------------------------ | |
//-- header -------------------------------------------------------------------- |
View windows_leaner_and_meaner.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -- windows.h flags -- | |
#define VC_EXTRALEAN | |
#define WIN32_LEAN_AND_MEAN | |
#define NOGDICAPMASKS | |
#define NOVIRTUALKEYCODES | |
#define NOWINMESSAGES | |
#define OWINSTYLES | |
#define NOSYSMETRICS | |
#define NOMENUS | |
#define NOICONS |
View gitignore_global
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OS generated files | |
.DS_Store* | |
ehthumbs.db | |
Icon? | |
Thumbs.db | |
# Build Folders (you can keep bin if you'd like, to store dlls and pdbs) | |
#/[Bb]in | |
/[Oo]bj |
View Status.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
################################################################### | |
# Author: Dan Bechard | |
# Date: May 9, 2013 | |
# Desc: Displays status of all repositories in directory to allow | |
# the user to easily identify uncommited changes and pending | |
# commits on the remote. | |
# | |
# === CHANGELOGS === | |
# |
View ini_parser.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _CRT_SECURE_NO_WARNINGS | |
#include <cassert> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <vector> | |
struct buffer { | |
char *data; | |
int length; |
View ta_file_read_all.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Read file as binary, but append \0 to the end of the buffer | |
// filename: name of file to read | |
// buf : if file read successfully, this will be set to a pointer to the file contents on the heap | |
// len : if file read successfully, this will be set to the file length | |
// Returns 0 on success, negative error code on failure (see stderr for more info) | |
// WARN: you must free(buf) when you're done with it!! | |
int ta_file_read_all(const char *filename, char **buf, size_t *len) | |
{ | |
assert(filename); | |
assert(buf); |
NewerOlder