Added documentation and fixed HINLINE spelling error.

This commit is contained in:
Zak Strange
2016-03-12 10:51:03 -07:00
parent 8ee6f8a20d
commit e5ba943f38
2 changed files with 45 additions and 11 deletions

View File

@@ -1,6 +1,49 @@
/* /*
Author: Zak Strange HandmadeMath.h v0.1
This is a single header file with a bunch of useful functions for
basic game math operations.
==========================================================================
You MUST
#define HANDMADE_MATH_IMPLEMENTATION
in EXACTLY one C or C++ file that includes this header, BEFORE the
include, like this:
#define HANDMADE_MATH_IMPLEMENTATION
#include "HandmadeMade.h"
All other files should just #include "HandmadeMath.h" without the #define.
==========================================================================
For overloaded, and operator overloaded versions of the base C functions.
You MUST
#define HANDMADE_MATH_CPP_MODE
in EXACTLY one C or C++ file that includes this header, BEFORE the
include, like this:
#define HANDMADE_MATH_IMPLEMENTATION
#define HANDMADE_MATH_CPP_MODE
#include "HandmadeMade.h"
All other files should just #include "HandmadeMath.h" without the #define.
==========================================================================
LICENSE
This software is in the public domain. Where that dedication is not
recognized, you are granted a perpetual, irrevocable license to copy,
distribute, and modify this file as you see fit.
CREDITS
Written by Zakary Strange (zak@strangedev.net)
Fixes:
Jeroen van Rijn (@J_vanRijn)
*/ */
#ifndef HANDMADE_MATH_H #ifndef HANDMADE_MATH_H
@@ -19,7 +62,7 @@ extern "C" {
#if _MSC_VER && !__INTEL_COMPILER #if _MSC_VER && !__INTEL_COMPILER
#define HINLINE __inline #define HINLINE __inline
#else #else
#define HINLLINE inline #define HINLINE inline
#endif #endif
typedef union vec2 typedef union vec2

9
main.c
View File

@@ -1,15 +1,6 @@
/*
HANDMADE_MATH_IMPLEMENTATION:
This is for the implementation you want this.
HANDMADE_MATH_CPP_MODE:
This will give the function overloaded and operator overloaded version of the functions
*/
#include <conio.h> #include <conio.h>
#define HANDMADE_MATH_IMPLEMENTATION #define HANDMADE_MATH_IMPLEMENTATION
#define HANDMADE_MATH_CPP_MODE
#include "HandmadeMath.h" #include "HandmadeMath.h"