Upcoming Events
Unite 2010
11/10 - 11/12 @ Montréal, Canada

GDC China
12/5 - 12/7 @ Shanghai, China

Asia Game Show 2010
12/24 - 12/27  

GDC 2011
2/28 - 3/4 @ San Francisco, CA

More events...
Quick Stats
39 people currently visiting GDNet.
2406 articles in the reference section.

Help us fight cancer!
Join SETI Team GDNet!
Link to us Events 4 Gamers
Home » Articles & Resources » Programming » Sweet Snippets
Intel sponsors gamedev.net search:
Sweet Snippets

Sweet Snippets are relatively short articles that focus on a very specific aspect of programming. They contain source code and an explanation of how to use it. If you'd like to contribute a Sweet Snippets article (which can be as simple as expounding on a post you've made to the forums) send it to writers@gamedev.net.
Resources Listed: 91
Sweet Snippets
Topic Author Description
2D Alpha Blending Using MMX Technology
[Added: 9/1/2001]
Matthias Hofmann  Provides an improvement to a blending technique described in an earlier article. 
3D Sound with DirectX Audio
[Added: 2/13/2003]
Toby Murray  This tutorial gives a basic explanation of how to use DirectX Audio to create and play 3D sound effects. 
A Guide To Starting With OpenAL
[Added: 10/23/2003]
Lee Winder  Provides an introductory tutorial to adding sounds via OpenAL. 
A Quick Guide to FMOD
[Added: 5/21/2004]
Joachim Rohde  Provides an overview of and samples of using the FMOD sound system. 
A Simple COM Tutorial
[Added: 2/2/2001]
Odin Jensen  Provides a brief explanation of COM and an example program using it. 
A Simple Third-Person Camera
[Added: 11/13/2001]
actdevil  Explains how a polar coordinate system can be used to implement a 3rd person camera. 
An Introduction to Hash Tables with Chaining
[Added: 3/16/2004]
GaulerTheGoat  Provides an introduction to and implementation of chained hash tables. 
Area and Volume Calculations
[Added: 5/12/2005]
Kyle Owen  Presents a three dimensional volume calculator based on the pressure volume model. 
ASSERT(), VERIFY() and TRACE() for non-MFC Applications
[Added: 7/23/2002]
Gabriel Fleseriu  This article explains how to create your own ASSERT(), VERIFY(), and TRACE() macros for non-MFC applications. 
Basic Encryption
[Added: 12/15/2001]
Matt Recker  Covers the essentials involved with encryption. 
Basics of GLUT
[Added: 1/29/2002]
Ben Woodhouse  Covers the basics of setting up and using GLUT with VC++, and explains how to initialize a GLUT display, open a window and display a smooth-shaded multicoloured triangle in it. 
Box Filtering Height Maps for Smooth Rolling Hills
[Added: 10/23/2004]
Graham Wihlidal  Explains how to remove the sharp edges in height maps using a simple convolution filter. 
Building an .X File Frame Hierarchy
[Added: 9/24/2001]
Jim Adams  Shows you how to load and create a frame hierarchy from an .X file. 
Character Animation with DirectX 8.0
[Added: 1/16/2002]
Johannes Leimbach  Provides instructions and a wrapper class for loading and MD2 model in DirectX 8. 
Code Organization with Namespaces
[Added: 12/14/2003]
Michael V. De Palatis  A brief article introducing namespaces to the uninitiated. 
Compiling OpenGL Code with MFC
[Added: 4/16/2002]
David Nishimoto  This article is little more than code, but it should at least give you a framework for using OpenGL in MFC applications. 
Compressed Quantized Unit Vectors
[Added: 8/21/2000]
Rafael Baptista  This article descibes a method for mapping 12 byte vectors into 2 byte quantized normals and back. 
Concatenating Triangle Strips
[Added: 11/27/2002]
Marc Reilly  Explains how to use degenerate triangles to improve batch processing of triangle strips. 
Continuous Updating in MFC
[Added: 2/13/2005]
Chris "iNsAn1tY" Mantle  Presents a method for allowing smooth updates in MFC. 
Coordinates in Hexagon-Based Tile Maps
[Added: 4/13/2002]
Thomas Jahn  Provides some solutions to problems encountered when working with hexagonal tile maps. 
Creating a Useful Camera Class
[Added: 10/13/2004]
Michael Schuld  An implementation of a camera that flies around in 3d space with math explanations as well as source code. 
Creating a Windows NT/2000/XP Service
[Added: 3/20/2003]
Dean Harding  Provides an explanation of and sample code for creating a Windows service. 
Direct3D 9.0 with Allegro
[Added: 1/25/2006]
Homer Cuevas  Tutorial and demo code for using Direct3D and Allegro together. 
Direct3D Without All The Garbage
[Added: 6/8/2000]
Lee Mazurek  Explains an easy way to implement the bare minimum of 3D engine features. 
DirectInput Initialization
[Added: 2/21/2001]
Anthony Wlodarski  Covers the necessary steps in setting up DirectInput objects and devices. 
DirectX 8 and the Keyboard
[Added: 1/2/2002]
Mason Smith  Provides basic coverage of the keyboard under DirectInput, including a class wrapper. 
do { ... } while (false);
[Added: 5/25/2007]
Dennis B, SlickEdit  A small little programming idiom 
Enhancing Stenciled Shadow Volumes
[Added: 8/17/2003]
Christian Mendl  The article deals with transforming vertex position data and storing it in a floating-point surface to be able to reuse it when rendering. 
Fast Computation of Terrain Shadow Maps
[Added: 5/7/2002]
Mircea Marghidanu  Covers the lighting and shadowing aspects of terrain rendering. 
Fast Fourier Transforms
[Added: 3/19/2001]
Magmai Kai Holmlor  Provides a brief explanation of FFTs, with sample programs. 
Frame Rate Independent Movement
[Added: 6/4/2001]
Ben Dilts  Explains how to keep game objects moving at the same rate independently of the frame rate. 
General Purpose Call Stack Tracer
[Added: 10/22/2002]
Bryan Ross  This is a short little snippet whose purpose is to aid in debugging, by keeping track of which function the thread of execution is currently in, using a staticly allocated doubly-linked list 
Generating a Screenshot in DirectX 8.1
[Added: 7/2/2002]
Keith Newton  Explains how to output a screenshot using only a few lines of code. 
Handy PC/Mac OS X Snippets for Indie Development
[Added: 1/9/2006]
Julio Gorgé, Pablo Pérez  A number of useful code snippets that abstract common operations for both Mac OS X and Windows. 
Higher Accuracy Quantized Normals
[Added: 12/8/2000]
Raphael Baptista  Provides an update improving the quantization technique presented in Compressed Quantized Unit Vectors. 
How to Load a Bitmap
[Added: 7/23/2003]
Mark Bernard  Answers a commonly asked question. 
How to parse .X files
[Added: 9/13/2001]
Jim Adams  Provides coverage of what you need to know to start working with .X file-based meshes. 
Identification of x86 CPUs and their features with CPUID
[Added: 10/5/2000]
Benjamin Swayne  Shows how to check your CPU's capabilities. 
Implementing 2D Vectors
[Added: 5/21/2000]
Willem van Doesburg  A vector implementation in C++. 
In Memory Data Compression and Decompression
[Added: 12/12/2005]
Lee Millward  Shows how to perform compression and decompression between data buffers in memory using the zlib library. 
Integrating Direct3D 8.1 With MFC Using Visual Studio 6.0
[Added: 3/2/2002]
Frank D. Luna V  This paper walks the reader through setting up a simple DirectX application in the MFC framework using wizards and the document/view architecture. 
Introduction to Linked Lists
[Added: 1/19/2001]
Shadow Mint  Provides a basic explanation of a very useful data structure. 
Introduction to Ogg Vorbis
[Added: 12/29/2003]
Anthony "TangentZ" Yuen  Shows how to set up a system to play Ogg Vorbis files through the use of the Ogg Vorbis SDK and OpenAL. 
Keyboard I/O Considerations in Game Development
[Added: 6/18/2004]
Rakesh Iyer  Presents a method for dealing with keyboard sampling rates changing over time as hardware advances. 
Lighting and Normals
[Added: 1/29/2002]
Ben Woodhouse  Extending on the previous tutorial's spinning cube code, this tutorial will explain how to calculate your cube's face normals and add OpenGL lighting to your program.  
Lightning
[Added: 10/24/2001]
Ian McDougall  Covers a simple lightning effect in Visual Basic. 
Line Drawing Algorithm Explained
[Added: 1/7/2001]
Tom Ootjers  Explains how and why the Bresenham line algorithm works 
Loading 3DS Files
[Added: 12/18/2000]
P.P.A.Narayanan  Gives an example of loading a model from a 3DSMax file. 
Loading a Texture From a Zip File in DirectX 9
[Added: 9/11/2003]
Greg Stewart  This is a simple article on how to load textures from .ZIP files using DirectX 9. 
Loading Bitmap Files into DirectDraw
[Added: 6/22/2000]
Kieren Johnstone  Describes how to use Windows functions to load a bitmap to a DirectDraw surface. 
Making Your Libraries Release-Friendly
[Added: 10/15/2003]
Sobeit Void  Presents some tips for distributing your libraries to make them more user-friendly. 
Multiple Monitor Support Code
[Added: 8/15/2000]
David Stubbs  This code allows the user to select which video card to use if there are more than one present. 
One Layer XOR Based Encryption
[Added: 1/11/2002]
Kurifu Roushu  Provides a basic overview of encryption using a single key and the XOR operator. 
Playing MIDIs and WAVs using DirectX
[Added: 4/18/2003]
Stephen Johnson  Basic introduction to playing sounds with DirectX. 
Pointers: Beginning to Intermediate
[Added: 4/24/2003]
James Poag  The purpose of this article is explain to a beginning or intermediate programmer what pointers are and to provide a few examples of how they are used. 
Programming 3D Sound With OpenAL in Windows
[Added: 7/2/2003]
Dan Ricart  This article explains the basics of OpenAL and how to get started adding 3D sound to your project. 
Putting it all together: How to best arrange C++ source and header files
[Added: 11/4/2000]
Ben Dilts  Covers the basics of what you need to do to share globals across multiple files. 
Random Name-Generation Using Grammars
[Added: 11/24/2003]
Constantin Christmann  Demonstrates a method for building reasonable names using grammars, with pronouncibility guaranteed. 
Real-Time Heightmap Self-Shadowing Using the Strider Technique
[Added: 7/22/2004]
Matthew Strahan  Describes a technique for creating terrain shadows. 
Recognition of Handwritten Gestures
[Added: 1/9/2004]
Oleg Dopertchouk  Explains how to use gesture recognition for input. 
Screen Update API for Allegro
[Added: 9/30/2004]
Chris "23yrold3yrold" Barry  Provides code and documentation for updating the screen in Allegro. 
SDL & Fonts
[Added: 6/9/2003]
Doug Manley  Describes how to easily use text with SDL. 
SDL & Fonts Part 2: PrintStrings
[Added: 7/9/2003]
Doug Manley  Continues where the previous article left off, covering how to handle multiple lines of text. 
Simple Clouds Part 1
[Added: 4/13/2004]
Francis "AK 47" Huang  Demonstrates how to procedurally generate clouds and render them using OpenGL. 
Simple File I/O Using C++
[Added: 7/17/2000]
John Peregrine  Covers the basics of stream-based I/O in C++. 
'Slope Lighting' Terrain
[Added: 7/8/2001]
Charlie Van Noland  Describes a fast terrain lighting technique. 
Smooth interpolation of irregularly spaced keyframes
[Added: 10/1/2001]
Jon Langridge  Describes a method of grouping keyframes where they're most needed to obtain smooth animation. 
Spinning Cube
[Added: 1/29/2002]
Ben Woodhouse  Expands on the previous tutorial's code to show you the basics of animation and models using OpenGL and GLUT. By the end you should know how to create a spinning cube. 
SSE2 for Dummies (who know C/C++)
[Added: 8/31/2003]
Zach Dwiel  Provides an overview of Intel's SSE2 and examples of how to use it. 
Starting Direct3D9: Setting Up a Window
[Added: 5/20/2003]
Mason Smith  This article will teach you the basics of Direct3D and using it to setup a Direct3D-enabled window. 
Static Libraries From a Game Programming Perspective
[Added: 3/2/2001]
Stefan Hajnoczi  Explains what static libraries are and how to use them. 
Static Library Tips
[Added: 11/1/2001]
Sobeit Void  Provides suggestions for improving the efficiency and correctness of static libraries. 
Synchronizing Walking Animations
[Added: 4/5/2005]
Nicolás Vinacur  Presents a technique for spacing 2D animations. 
Text Input in an Allegro Game
[Added: 8/14/2004]
Chris "23yrold3yrold" Barry  Describes how to process input using both C and C++. 
The Basics to Using DirectShow
[Added: 3/13/2001]
Kurifu Roushu  A simple explanation and example of using DirectShow 
The C++ Pimpl
[Added: 4/2/2002]
Sobeit Void  Describes a method allowing you to modify the private interface of your class while avoiding recompilation of code using the public interface. 
The Singleton Class Cluster
[Added: 7/6/2005]
Tristam MacDonald  Suggests an optimal implementation of the singleton and a way to combine it with the class cluster design pattern. 
Tips for Cross-Platform I/O in C/C++
[Added: 5/3/2005]
John Bolton  A brief list of useful tips. 
Understanding Pointers: A Game Developer's Approach
[Added: 11/20/2002]
Warren Moore  This article exists as a reference and tutorial for those who are learning C++ and need a little extra help in the area of pointers. 
Understanding the QuickSort Algorithm
[Added: 6/28/2000]
Joe Farrell  Provides an implementation and explanation of the quicksort algorithm. 
Using a CallHandler and Caller Object to Simplify Function Calling Between Anonymous Objects
[Added: 3/26/2003]
John Hattan  If the title doesn't give you an idea of what the article is about, I can't help you. 
Using DirectX Audio 8
[Added: 2/6/2002]
Mason Smith  Covers the basics of setting up DirectX Audio and playing sounds. 
Using Function Pointers
[Added: 7/1/2004]
Jason Mickela  Describes how to use function pointers in various ways to increase the performance and readability of your code. 
Using Linked Lists to Represent Game Objects
[Added: 1/13/2004]
Jackson Allan  Explains how to use linked lists in the context of a game. 
Using Lua with C#
[Added: 11/7/2005]
Martin Echenique  Explains how to embed Lua into a C# application. 
Using Text-To-Speech as a Game Programming Tool
[Added: 4/16/2003]
Desmond (Dez) Lang  The purpose of this article is to introduce the use of Microsoft's Speech API (SAPI) 5.1 as an effective tool in game development. 
Using Vertex Buffers With DirectX
[Added: 5/26/2003]
Erik Yuzwa  A few tips and pointers for working with vertex buffers. 
Working with the DirectX .X File Format and Animation in DirectX 9.0
[Added: 3/30/2004]
Jason Jurecka  Sets up a working model and plays animations for that model using the .X format. 
Writing Endian Independent Code in C++
[Added: 4/27/2004]
Promit Roy  Explains what endian means and shows how to write code to deal with it. 
 
 Key: = HTML article hosted here  , = HTML article hosted elsewhere  = link to another web site  = Adobe Acrobat document  = Zip files  = Word or text document