Git Product home page Git Product logo

rw's Introduction

rw

A collection of code/utilities/libraries that I have written from scratch, supporting Windows (MSCV), Mac and Linux (gcc or clang).

This repo contains code that I have already found or will find useful for my game development and graphics projects. Examples of projects being my Monte Carlo path tracer, OpenGL renderer and SDL2/OpenGL game engine. I found myself writing common code across all these projects so I decided to put it all in a single repo that all current (and future) projects can use. This repo will also continue to grow along with me. For anyone other than myself using this, all the code is considered to be for educational purposes and so I make no correctness nor optimality guarantees.

The design of these libraries and choices of which functions to implement are influenced by many great libraries I have seen and used (see Inspirations). Although I have taken influence from these sources, I have designed and coded my libraries to suit my needs and my tastes.

Table of Contents

Files

File Version Description
rw_types.h 0.2.0 Defines or redefines common types
rw_math.h 0.3.0 Math library for games/graphics
rw_transform.h 0.2.0 Matrix transformation data structure and functions (pbrt inspired)
rw_time.h 0.2.0 High resolution timer (nanoseconds) and other related utilities
rw_memory.h 0.2.0 Custom memory allocation -- aligned_alloc, arena, etc.
rw_th.h 0.1.0 Multithreading/syncronization related functions

General Usage Instructions

All files are designed to be single(ish)-file headers. Usage is like Sean Barrett's stb library. To reduce code repetition a little bit, some libraries depend on others. For example, rw_transform.h depends on rw_math.h.

For specific usage instructions, please see the header block comment for the file of interest.

Generally, include the header file and define the library specific preprocessor value to include the implementation as well. Note that including just the header file, will NOT include the implementation.

For example,

#define RWNAMESPACE_IMPLEMENTATION
#include <rw_mylib.h>

Other options in place of RWNAMESPACE_IMPLEMENTATION are:

#define RWNAMESPACE_HEADER_ONLY
// OR
#define RWNAMESPACE_STATIC

Some libaries also have specific defines that can be included beforehand to change some of the implementation details of the library. For example (in rw_math.h),

// To use the fast inverse sqrt intrinsic, also include before
#define RWM_USE_MM_RSQRT

TODO

  • rw_bvh.h - Bounding Volume Hierachy (BVH). Move this in from path tracing project.

  • rw_buffer.h - Dynamic buffers, ring buffers etc. (Move this in from RTOS project)

  • rw_hashtable.h - Hashtable

  • rw_mesh.h - Migrate OBJ loader/mesh code from other projects here

  • rw_sort.h - Various sorting algorithms

Inspirations

rw's People

Contributors

raywan avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.