Monday, May 09, 2005

Monkeyboy Library


What is MBLib?
MBLib is a Win32 library that helps simplify the process of making graphics and game demos. Currently there are two modules available: MBApp and MBWin.

MBApp provides a base application interface that organizes the process used for each demo applicaton. MBWin provides a basic window class to get a simple Win32 window up and running with minimal effort. Together, they make it a cinch to launch a basic Win32 application with a functional window. Below is an example of a simple application that uses the MBLib:



// BEGIN demo.cpp

#include "MBApp_application.h"
#include "MBWin_window.h"

class DemoApp : public MBApp_ApplicationInterface
{
public:
DemoApp(HINSTANCE inst_) : MBApp_ApplicationInterface(inst_){}
~DemoApp(){}

virtual bool DoInitialize()
{
if(m_win.Create(string("Demo App")))
return false;
m_win.Display();
return true;
}

private:
MBWin_Window m_win;
};

// User-defined factory method definition needed by the MBApp library to create the
// appropriate application interface.
MBApp_ApplicationInterface* CreateApplication(HINSTANCE inst_)
{
return new DemoApp(inst_);
}

// END demo.cpp
And that is all there is too it. That program there will create a basic Win32 window that has a caption bar, minimize, maximize, and close buttons and also the ability to use the ESC key to terminate the program.

The goal of MBLib is to make this process simple, with extra emphasis on "SIMPLE".

How can I get it?
MBLib can be downloaded from here. Once downloaded, unzip it to a desired location keeping the file structure intact. The include directory houses the necessary header files needed for compilation, and the lib directory houses the necessary library files needed for linking.

What's to come...
In the works is the graphics and input libraries. There progress will be updated here on the site when they become available. Presently, the idea, since the target platform is Microsoft Windows, is to wrap the DirectX API into a simple to use interface to launch application more effectively and easily. So stay tuned for more to come...

OOH OOH EEH EEH


No comments: