| 12 | using namespace gte; |
| 13 | |
| 14 | Window2::Window2(Parameters& parameters) |
| 15 | : |
| 16 | Window(parameters), |
| 17 | mPixelColor(0), |
| 18 | mThick(0), |
| 19 | mClampToWindow(true), |
| 20 | mDoFlip(false), |
| 21 | mScreenTextureNeedsUpdate(false) |
| 22 | { |
| 23 | mOverlay = std::make_shared<OverlayEffect>(mProgramFactory, |
| 24 | mXSize, mYSize, mXSize, mYSize, |
| 25 | SamplerState::Filter::MIN_P_MAG_P_MIP_P, |
| 26 | SamplerState::Mode::CLAMP, |
| 27 | SamplerState::Mode::CLAMP, |
| 28 | true); |
| 29 | |
| 30 | mScreenTexture = std::make_shared<Texture2>(DF_R8G8B8A8_UNORM, mXSize, mYSize); |
| 31 | mScreenTexture->SetUsage(Resource::Usage::DYNAMIC_UPDATE); |
| 32 | mOverlay->SetTexture(mScreenTexture); |
| 33 | |
| 34 | // The default is to disable depth and stenciling. For layered drawing in |
| 35 | // the z-direction, an application can choose to restore the default mode |
| 36 | // of depth and stenciling turned on. |
| 37 | mNoDepthStencilState = std::make_shared<DepthStencilState>(); |
| 38 | mNoDepthStencilState->depthEnable = false; |
| 39 | mNoDepthStencilState->stencilEnable = false; |
| 40 | mEngine->SetDepthStencilState(mNoDepthStencilState); |
| 41 | |
| 42 | // Callback functions for ImageUtility2 functions. |
| 43 | mDrawPixel = [this](int32_t x, int32_t y) { SetPixel(x, y, mPixelColor); }; |
| 44 | mDrawThickPixel = [this](int32_t x, int32_t y) |
| 45 | { |
| 46 | for (int32_t dy = -mThick; dy <= mThick; ++dy) |
| 47 | { |
| 48 | for (int32_t dx = -mThick; dx <= mThick; ++dx) |
| 49 | { |
| 50 | SetPixel(x + dx, y + dy, mPixelColor); |
| 51 | } |
| 52 | } |
| 53 | }; |
| 54 | } |
| 55 | |
| 56 | bool Window2::OnResize(int32_t xSize, int32_t ySize) |
| 57 | { |
nothing calls this directly
no test coverage detected