MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / Construct

Method Construct

olcPixelGameEngine.h:2486–2501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2484
2485
2486 olc::rcode PixelGameEngine::Construct(int32_t screen_w, int32_t screen_h, int32_t pixel_w, int32_t pixel_h, bool full_screen, bool vsync, bool cohesion, bool realwindow)
2487 {
2488 bPixelCohesion = cohesion;
2489 bRealWindowMode = realwindow;
2490 vScreenSize = { screen_w, screen_h };
2491 vInvScreenSize = { 1.0f / float(screen_w), 1.0f / float(screen_h) };
2492 vPixelSize = { pixel_w, pixel_h };
2493 vWindowSize = vScreenSize * vPixelSize;
2494 bFullScreen = full_screen;
2495 bEnableVSYNC = vsync;
2496 vPixel = 2.0f / vScreenSize;
2497
2498 if (vPixelSize.x <= 0 || vPixelSize.y <= 0 || vScreenSize.x <= 0 || vScreenSize.y <= 0)
2499 return olc::FAIL;
2500 return olc::OK;
2501 }
2502
2503
2504 void PixelGameEngine::SetScreenSize(int w, int h)

Callers 6

mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by 5

mainFunction · 0.64
mainFunction · 0.64
mainFunction · 0.64
mainFunction · 0.64
mainFunction · 0.64