| 7286 | namespace olc { |
| 7287 | |
| 7288 | class Platform_GLUT : public olc::Platform |
| 7289 | { |
| 7290 | public: |
| 7291 | static std::atomic<bool>* bActiveRef; |
| 7292 | |
| 7293 | virtual olc::rcode SetWindowSize(const olc::vi2d& vPos, const olc::vi2d& vSize) override |
| 7294 | { |
| 7295 | return olc::rcode::OK; |
| 7296 | } |
| 7297 | |
| 7298 | virtual olc::rcode ShowWindowFrame(const bool bShowFrame = true) override |
| 7299 | { |
| 7300 | return olc::rcode::OK; |
| 7301 | } |
| 7302 | |
| 7303 | |
| 7304 | virtual olc::rcode ApplicationStartUp() override { |
| 7305 | return olc::rcode::OK; |
| 7306 | } |
| 7307 | |
| 7308 | virtual olc::rcode ApplicationCleanUp() override |
| 7309 | { |
| 7310 | return olc::rcode::OK; |
| 7311 | } |
| 7312 | |
| 7313 | virtual olc::rcode ThreadStartUp() override |
| 7314 | { |
| 7315 | return olc::rcode::OK; |
| 7316 | } |
| 7317 | |
| 7318 | virtual olc::rcode ThreadCleanUp() override |
| 7319 | { |
| 7320 | renderer->DestroyDevice(); |
| 7321 | return olc::OK; |
| 7322 | } |
| 7323 | |
| 7324 | virtual olc::rcode CreateGraphics(bool bFullScreen, bool bEnableVSYNC, const olc::vi2d& vViewPos, const olc::vi2d& vViewSize) override |
| 7325 | { |
| 7326 | if (renderer->CreateDevice({}, bFullScreen, bEnableVSYNC) == olc::rcode::OK) |
| 7327 | { |
| 7328 | renderer->UpdateViewport(vViewPos, vViewSize); |
| 7329 | return olc::rcode::OK; |
| 7330 | } |
| 7331 | else |
| 7332 | return olc::rcode::FAIL; |
| 7333 | } |
| 7334 | |
| 7335 | static void ExitMainLoop() { |
| 7336 | if (!ptrPGE->OnUserDestroy()) { |
| 7337 | *bActiveRef = true; |
| 7338 | return; |
| 7339 | } |
| 7340 | platform->ThreadCleanUp(); |
| 7341 | platform->ApplicationCleanUp(); |
| 7342 | exit(0); |
| 7343 | } |
| 7344 | |
| 7345 | #if defined(__APPLE__) |
nothing calls this directly
no outgoing calls
no test coverage detected