MCPcopy Create free account
hub / github.com/crownengine/crown / screenShot

Method screenShot

src/device/device.cpp:189–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 3

openFunction · 0.85
imageWritePngFunction · 0.85
deviceFunction · 0.85

Tested by

no test coverage detected