Archive

Archive for the ‘Articles’ Category

Math trickery for 1D & 2D arrays

August 14th, 2011 No comments

Once upon a time, there was a language that didn’t have 2 dimensional arrays. This greatly upset the programmer. Fortunately, the programmer was swift in the art of arithmetic and overcame this obstacle easily.

Lets say for example, we only have access to a 1 dimensional array data structure and it has 50 elements in it.

int data[50];

Lets break this array up into 10 rows and 5 columns to make a grid. So how do we get access to a position say data[4][3]?
There are two things I’m going to teach you now:
1) Retrieve the column & row numbers from a linear index counter.
2) Retrieve the index from a row & column numbers.

Read more…

Categories: Articles, Blog, Miscellaneous Tags: , ,

C++ Casting

September 5th, 2010 No comments
Categories: Articles Tags:

How to get a perfectly sized client area

June 26th, 2010 No comments
Categories: Articles Tags:

Setting up windows git server & client

June 5th, 2010 No comments
Categories: Articles Tags: , , , ,

Graphics Pipeline

June 1st, 2010 No comments
Categories: Articles Tags:

Intersection and Non-intersection routines

May 1st, 2010 No comments
Categories: Articles Tags:

Composition vs Inheritance

May 1st, 2010 No comments
Categories: Articles Tags:

What is endianness?

February 19th, 2010 No comments
Categories: Articles Tags: