|
libmx is a 2D/3D C++ library built on top of SDL and other
technlogies used to create 2D/3D multimedia applications. It works for
Mac OS X, Windows, and Linux and
you can download the source code @ http://lostsidedead.com/svn in
the haze repo. Or Issue the following:
/*
Example of mx framework
to compile:
$ g++ -framework mx -framework Cocoa -framework OpenGL example.cc -o example -lSDLmain
*/
#include<mx/mx.h>
namespace example {
class Example : public mx::mxWnd {
mx::Color white;
public:
Example();
virtual ~Example() { }
virtual void eventPassed(SDL_Event &e);
virtual void renderScreen();
};
Example::Example() : mxWnd(640, 480, 0) {
setTitle("Example");
white = mx::Color(255,255,255);
}
void Example::renderScreen() {
mx::mxSurface &surface = mxrenderSurface();
mx::mxPainter paint(surface);
paint.fillRect(0, 0, 640, 480, white);
surface.Flip();
}
void Example::eventPassed(SDL_Event &e) {
mxWnd::eventPassed(e);
}
}
int main(int argc, char **argv) {
try {
example::Example examp;
return examp.messageLoop();
}
catch( mx::mxException<std::string> &e ) {
e.printError(std::cerr);
}
catch( std::exception &e ) {
std::cerr << e.what() << "\n";
}
catch( ... ) {
std::cerr << "unknown error...\n";
}
return EXIT_FAILURE;
}
ExamplesDownload Example OpenGL Example Example Projects Mutatris Current HPPD-Light Ultimate MasterPiece3D |
1.5.8