| 187 | } |
| 188 | |
| 189 | virtual void screenShot(const char *_filePath, u32 _width, u32 _height, u32 _pitch, const void *_data, u32 _size, bool _yflip) override |
| 190 | { |
| 191 | CE_UNUSED(_size); |
| 192 | |
| 193 | bx::Error err; |
| 194 | bx::FileWriter writer; |
| 195 | if (bx::open(&writer, _filePath, false, &err)) { |
| 196 | bimg::imageWritePng(&writer |
| 197 | , _width |
| 198 | , _height |
| 199 | , _pitch |
| 200 | , _data |
| 201 | , bimg::TextureFormat::BGRA8 |
| 202 | , _yflip |
| 203 | , &err |
| 204 | ); |
| 205 | bx::close(&writer); |
| 206 | } |
| 207 | |
| 208 | _screenshot_path = _filePath; |
| 209 | _screenshot_ready = 1; |
| 210 | ++device()->_needs_draw; // 1 frame for _screenshot_ready to be evaluated. |
| 211 | } |
| 212 | |
| 213 | virtual void captureBegin(u32 _width, u32 _height, u32 _pitch, bgfx::TextureFormat::Enum _format, bool _yflip) override |
| 214 | { |
nothing calls this directly
no test coverage detected