G WinAPI Framework 2.0

Wersja polska

An object-oriented window application framework for games


When writing a game, have you ever thought - hey, wait a sec, haven't I written similar code before? Probably your answer is yes, especially when it was said while writing the window creation formulas and handles. You can say bye-bye to calling those nasty class-registration and system statements WinAPI functions, because G WinAPI Framework does all the dirty work for you.

Get G WinAPI Framework 2.0

Read also the article describing how the framework works. (only polish version available)


Wojciech Skóra

What makes G WinAPI Framework different:
  • Object oriented code.
  • Encapsulation of windows procedures.
  • Multiple window control.
  • Two main-loop modes (making use of GetMessage() and PeekMessage()).
  • Multiple screens support.
  • Window control (size and style adjustment, detecting activity and screen attachment, cropping, et cetera).
  • Implementation of a simple logger for error handling.
How does it work
The whole framework consists of four classes:
  • WinAPI_System - it's responsible for spreading messages. Additionally, there's code handling multi-screen systems and basic methods of encapsulation of pure system functions.
  • WinAPI_Window - includes all of the methods needed for window handling - creation, control, messages, et cetera. This is a class designed to be inherited in your own application.
  • WinAPI_Exception - a small class creating an exception object.
  • Logger - just a logger.
The way you use G WinAPI_Framework:
  • Inherit from the WinAPI_Window class (e.g. in your TestApp class).
  • Set the basic window parameters needed for its creation.
  • All you need to do now is WinAPI_System::Launch(), giving it the pointer to the application window (e.g. TestApp::this).
After these steps WinAPI_System calls the TestApp class methods (OnMessage, OnActivate, OnDeactivate, OnIdle, OnMonitorChange, OnResize).
There is no license - all of the source files are completely free. You can modify and use them any way you want.