32 lines
524 B
C++
32 lines
524 B
C++
#include <iostream>
|
|
#include "Window.h"
|
|
#include "Runtime.h"
|
|
#include <memory>
|
|
#include "System.h"
|
|
|
|
int main(int argc, char * argv[])
|
|
{
|
|
if (!System::init())
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
Runtime::init(argv[0], APPNAME);
|
|
|
|
std::shared_ptr<Buffer> b = std::make_shared<Buffer>();
|
|
if (argc > 1)
|
|
{
|
|
b->load_from_file(argv[1]);
|
|
}
|
|
Window w;
|
|
if (!w.create(b))
|
|
{
|
|
std::cerr << "Error creating window." << std::endl;
|
|
return 1;
|
|
}
|
|
|
|
w.run_event_loop();
|
|
|
|
return 0;
|
|
}
|