Code Snippets
What's That?
I am using it actively
I planning to use/learn it
I don't plan to lean/use it
5th option
Home :: Programming :: Code Snippets :: Overview

[ Overview ]

This is the place where you can find code snippets about different programming subjects. They show you how to do something in some lines of code along with a little explanation. Do also want to write a code snippet or you want me to write something you are interested in? Then m@il me now!


Fast Variable Swapping
Learn how to do the fastest integer swap possible.
Pause your application
Ever wanted to pause your app for 200 ms? This snippet shows you how to do that.
Using a Logfile
This code snippet tells you how to use a logfile in your applications.
Platform Indepentent Timer
Shows how to use a platform indepentent timer that can be used with every OS.
Execute System Commands
If you want to program your own shell, this is the right snippet for you! Executing system commands is really easy.
Dynamic Type Information
About getting information about a variable at runtime.
FPS Indepentent Games
How to program games that run at the same speed whatever power the user's CPU has..
Loading TGA image files
This code snippets shows you platform-independent code to load TGA's.
Using POSIX Threads
This code snippet will show how easy it is to use threads under Unix operation systems.
Using MySQL
If you have ever been interested in knowing how to connect to a MySQL database with C/C++ then you're right here.
Listing Files Under Linux
The well-known unix command 'ls' needs exactly that what will be explained here!
Apache: C/C++ script
Short code snippet that shows how to setup Apache to run applications as cgi scripts along with a C/C++ code snippet as example.


This snippet shows you how to fade to a certain color in OpenGL.
Mouse Dragging
Learn how to move your viewport or objects depending on how the mouse moved.
Check for OGL acceleration
Does the user have a OpenGL accelerated graphics card? Want to know it? Then read this!
Drawing A Mouse Cursor
The second OpenGL-Mouse code snippet. This time it is about how to draw a little mouse
Shapes I: Drawing A Circle
Circles are beautiful shapes, aren't they? Take a look here to see how they are drawn!
Shapes II: Drawing An Ellipse
In the second Shapes snippet, you'll see that drawing an ellipse is not more difficult than drawing a circle!
Vertical Syncronisation - VSync
Learn how to enable/disable VSync and to check whether it it is turned on or off.
Window to OpenGL coordinates
To convert window coordinates to GL coords and vice versa is not too hard!
Drawing to a texture
Ever wanted to know how to draw a scene to an OpenGL texture? You're right here!
Using OpenGL Extensions
The basics about using OpenGL extensions. Simple and quick.
The Vertex Buffer Extension
The 'ARB_vertex_buffer_object' extension is something really interesting so don't miss it!
gluPerspective Replacement
gluPerspective(..) is one of those important functions everyone needs so why don't have our version?
Anisotropic Filtering
A nice and easy code snippet that shows you how to use the famous OpenGL extension GL_EXT_texture_filter_anisotropic.


SDL & OpenGL textures
Code snippet showing you how to use OpenGL textures with SDL correctly.
SDL & OpenGL extensions
SDL also makes using OpenGL extensions really easy.


Reading ID3 tags
This snippet shows you how to read ID3 v1 tags from MP3 files.
Writing to a textfile
This code snippet will show you how to write text into a textfile.


Fast Keyboard/Mouse Test
Easy, Fast and Good Keyboard/Mouse Test without the message handler.
Playing Soundfiles
About how to play sound files normally and from memory (very fast).
Enumerating Files In A Directory
Enumerating files located in a certain directory at runtime is really easy.
Drag & Drop Of Files
Make your application respond on the files dragged from the Explorer.
Setting the Screenmode
About how to change the screen resolution.
Using a Joystick
How to get a Joystick's position and button state? Take a look here!
Copying Text to the Clipboard
Hmm.. nothing to add to such a self-explanatory title.
Using Popup menus with Mfc
This code snippet shows the magic about context menus.
RGB Colour Values
Everything about colour values under Windows.
Changing File Attributes with Mfc
A snippet for the cheaters among us...

 Last edited 2003-03-30 15:20:00 by André Stein - printable version
» copyright by andré stein
» using stCM v1.0
» steinsoft.net revision 5.0