about news documentation discuss download add-ons credits
Cpw is a application framework library for OpenGL applications and games. It is designed with speed, simplicity, and portability in mind. The source is true "free software", there are no restrictions on it's use.
The Cpw interface API is modeled after the GLUT API but is not compatible with it. The core library includes support for windowing and events, user input, menuing, full screen rendering, performance timing, anti-aliased TrueType font rendering, basic image loading and saving, timers, primitive drawing, and more. For a look at Cpw's interface, take a look at the main header.

For a more in-depth look at Cpw view the API documentation or download the library's source and sample code. You may also browse the February 26th, 2002 source base.

Some example code, demo screenshots, and the readme are also available.

If your interested in porting Cpw to your OpenGL platform, take a look at the example source .c and .h files of the host interface adapter.

Extended API's
Cpw supports additional functionality through Cpw Add-ons. Add-ons are complimentary api's written by developers which give Cpw applications and games access to additional functionality beyond the score of the core Cpw API.

Current add-ons include support for Audio via the OpenAL audio library, and automatic initialization of OpenGL 1.2, OpenGL 1.3, and popular extension API's including NVidia pixel and vertex shaders.

Developers are welcome to create any type of add-on they like for Cpw. See the readme for specific details on how to write an add-on for Cpw.

Design Goals

Stability has always been an issue with GLUT. In some ways this has helped to create the perception that OpenGL is not stable on platforms such as Windows. The developers of Cpw have strived to create a stable OpenGL windowing and event library in Cpw through simplicity, organization, and a clean coding style.


Cpw supports modern interfaces game developers want to use. For example, the Win32 platform adapter supports both DirectInput (for game performance) and WinBase input (for stable event driven multi-windowed applications.)

Embedded Applications

Cpw was designed for embedded use, hence this was a primary design goal of the project. Cpw makes use of a 'host adapter' for interactions with the local operating system or host application. There are no calls to exit(), and the library frees resources it allocates. Cpw is context based, with no statics in the source. It is safe for multi-threaded programming within the same process.

Platform independance

The Cpw library is cross-platform in design. Localhost interactions are handled through a single platform specific adapater which is seperated from the core library code base. Take a look at the example source .c and .h files of the host interface adapter.

Quality Fonts

Cpw uses the FreeType 2.0 Font library for excellent anti-aliased font rendering.

Fun Development

One of the most enjoyable programming projects is writing a game. Unfortunately, programming a game today involves a great deal of complexity in simply getting a full-screen window to display, or in getting a small sound file to play. If it takes 3 months of studying complex api documentation just to get a polygon on the screen, the beginning game programmer is probably going to drop the idea before they ever get that far. Cpw, is an attempt at making the initial steps of game programming simple. Cpw also takes a step further in supporting the modern interfaces required in game development today.

Strict ANSI c

The Cpw library is pure ANSI c. Cpw does not use C++ but is suitable for use in C++ applications.

  • Fast prototyping of game concepts
  • Writing full-blown games
  • Writing OpenGL window based applications
  • Learning about the underlying programming api's Cpw uses
The Cpw library is open-source software, licensed under the Lua License. The library is free of licensing restrictions and is suitable for commercial use. The project developers encourage input from everyone, including feature suggestions, code patches, bug reports, and additional adapter platform ports. The best way to contribute to Cpw is to join the mailing-list.

SourceForge Logo