12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- #include <main.h>
- #include <Network.h>
- #include <HttpRequest.h>
- #include <JSON.h>
- #include <Fenster.h>
- #include <Bildschirm.h>
- #include <GraphicsApi.h>
- #include <RenderThread.h>
- #include <Datei.h>
- #include <Schrift.h>
- #include <DateiSystem.h>
- #include "Globals.h"
- #include "CustomDX11API.h"
- int KSGStart Framework::Start(Framework::Startparam p)
- {
- Network::Start(20);
- initVariables();
- setDebugDX(1);
- Datei d;
- d.setDatei("data/schriften");
- auto list = d.getDateiListe();
- for (Text* fontFile : *list)
- {
- LTDSDatei dat;
- dat.setPfad(new Text(Text("data/schriften/").operator+(fontFile->getText())));
- dat.leseDaten();
- Text* name = fontFile->getTeilText(0, fontFile->getLength() - 5);
- fontRegister->put(*name, RCPointer<Schrift>::of(dat.ladeSchrift()));
- name->release();
- }
- list->release();
- WFenster window;
- ::window = &window;
- WNDCLASS wc = Framework::F_Normal(p.hinst);
- wc.lpszClassName = "Factory Craft";
- window.erstellen(WS_POPUPWINDOW, wc);
- Monitor m = Framework::getMonitor(0);
- window.setBounds(Punkt(m.x, m.y), Punkt(m.breite, m.height));
- window.setAnzeigeModus(SW_SHOWNORMAL);
- window.setVSchließAktion([&window](void* p, void* f)
- {
- StopNachrichtenSchleife(window.getFensterHandle());
- });
- window.setMausAktion(_ret1ME);
- window.setTastaturAktion(_ret1TE);
- Bildschirm3D screen(dynamic_cast<WFenster*>(window.getThis()), new CustomDX11API());
- window.setBildschirm(dynamic_cast<Bildschirm*>(screen.getThis()));
- screen.setFillFarbe(0);
- uiFactory = Framework::defaultUI(fontRegister->get("normal"), &screen);
- initMenus();
- RenderTh rTh;
- rTh.setMaxFps(120);
- rTh.setBildschirm(dynamic_cast<Bildschirm*>(screen.getThis()));
- rTh.beginn();
- StartNachrichtenSchleife();
- rTh.beenden();
- releaseVariables();
- Network::Exit();
- return 0;
- }
|