Game Dev, Graphics, Physics, Software Engineering, and more!
Home
 

C++

Easy initializer list editing

Im usually into keeping my code nice and neat, but sometimes its also difficult to edit too. But this tip is not like that actually. Constructor::Constructor() : var1 , var2 , var3 { } Setting up your initializer lists this way not only makes them nice and tidy, they’re easy to edit too. When you …Continue reading

assert( yourCodeCorrectly );

Everyone thinks asserts will somehow help you or somehow make your life easier or better. Sometimes they do, but sometimes n00bs don’t know how to use them properly. Here is an example of just such a case: int GetVal( void ) { int i = -1; assert( i < 0 || i >= array.Length() ); …Continue reading

Early-outs for n00bs

Sometimes I see people code something up like the following: void AwesomeFunc( void ) { if( var == 3 ) { if( var2 == 4 ) { if( var4 == “napkin” ) { if( var5 == 8495 ) { g_flag = true; } else { Debug.Log( “var5 wasn’t 8495″ ); } } else { Debug.Log( …Continue reading

Testing at Microsoft

I was a contract employee at Microsoft, an SDET I. While I was there I learned quite a lot about testing, and I really believe it made me a much better programmer. Although my time there was short lived, I managed to retain some of my testing knowledge, and I hope to share that with …Continue reading

Const qualifier reminder

Just a reminder how const-ness works. If I remember correctly. // These two lines are the same type // const and int can be switched around and the result is the same. const int i; int const j; // If the word “const” follows the “*”, it affects the pointer int* const k; // Both …Continue reading

Math trickery for 1D & 2D arrays

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 …Continue reading

What is the difference between aggregation and composition?

This question has bothered me for some time and I always forget. So I wrote it down here and added an answer. Composition : An object contains another object. When the container object dies, so does the composited objects. Aggregation : An object pseudo-contains another object (contains a pointer to it). When the container object …Continue reading

Engine Update 001

I’m in the process of redoing my “testing” engine. I hope to make it robust, scalable, modular, while supporting a lot of other different technologies. This is the start of it using D3D9, but don’t worry, I’ll eventually port it over to d3d11. I’m going to skip 10 though. I have lots of things in …Continue reading

C++ Casting

The hidden default constructor in C++

I think I’m going to start posting about general C++ stuff too and since C++ is my favorite language (aside from assembly) I thought it would be interesting to post obscure C++ things that I find. Today I’m going to talk about a blog post that I found a while ago regarding constructors. The fellow …Continue reading

A Few Code Snippets

Periodically I’ll stumble across a small but useful piece of code. I have a small list right now, but as I stumble across them, I’ll post them here. Note: I do not take credit for any of this code. Pausing your application __asm int 3; or __debugbreak(); Convert any data type to a std::string object …Continue reading

Sundown Cerose

Description: A fast-paced comic book style 3D isometric based action/adventure game where the player must battle hordes of minions in order to save the galaxy. Gameplay video footage of Sundown Cerose. Position: Technical Director Date: 2008 – 2009 Accomplishments: Designed and coded the input, using DirectInput, scene management system, using TinyXML, physics, collision detection, and …Continue reading

Top