Guest User

Untitled

a guest
Apr 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.09 KB | None | 0 0
  1. #include <framework/application.h>
  2. #include <framework/core/clock.h>
  3. #include <framework/ui/uimanager.h>
  4. #include <framework/ui/uiframecounter.h>
  5. #include <framework/graphics/fontmanager.h>
  6. #include <framework/core/modulemanager.h>
  7. #include <framework/core/resourcemanager.h>
  8.  
  9. class MyApp : public Application
  10. {
  11. public:
  12.     MyApp() : Application("MyApp") { }
  13.  
  14.     void init(const std::vector<std::string>& args) {
  15.         Application::init(args, Fw::AppEnableGraphics);
  16.  
  17.         g_resources.addToSearchPath("/home/bart/projects/otclient/modules");
  18.         g_modules.discoverModule("/core_fonts/core_fonts.otmod")->load();
  19.  
  20.         UIFrameCounterPtr frameCounter(new UIFrameCounter);
  21.         frameCounter->resize(Size(80, 20));
  22.         frameCounter->moveTo(Point(4,4));
  23.         g_ui.getRootWidget()->addChild(frameCounter);
  24.     }
  25.  
  26.     void render() {
  27.  
  28.         Application::render();
  29.     }
  30. };
  31.  
  32. int main(int argc, const char* argv[])
  33. {
  34.     std::vector<std::string> args(argv, argv + argc);
  35.     MyApp app;
  36.     app.init(args);
  37.     app.run();
  38.     app.terminate();
  39.     return 0;
  40. }
Add Comment
Please, Sign In to add comment