Branimir Karadžić 7 years ago
parent
commit
b48813cf48
1 changed files with 3 additions and 3 deletions
  1. 3 3
      examples/07-callback/callback.cpp

+ 3 - 3
examples/07-callback/callback.cpp

@@ -69,13 +69,13 @@ static const uint16_t s_cubeIndices[36] =
 	6, 3, 7,
 	6, 3, 7,
 };
 };
 
 
-void savePng(const char* _filePath, uint32_t _width, uint32_t _height, uint32_t _srcPitch, const void* _src, bool _grayscale, bool _yflip)
+void savePng(const char* _filePath, uint32_t _width, uint32_t _height, uint32_t _srcPitch, const void* _src, bimg::TextureFormat::Enum _format, bool _yflip)
 {
 {
 	bx::FileWriter writer;
 	bx::FileWriter writer;
 	bx::Error err;
 	bx::Error err;
 	if (bx::open(&writer, _filePath, false, &err) )
 	if (bx::open(&writer, _filePath, false, &err) )
 	{
 	{
-		bimg::imageWritePng(&writer, _width, _height, _srcPitch, _src, _grayscale, _yflip, &err);
+		bimg::imageWritePng(&writer, _width, _height, _srcPitch, _src, _format, _yflip, &err);
 		bx::close(&writer);
 		bx::close(&writer);
 	}
 	}
 }
 }
@@ -188,7 +188,7 @@ struct BgfxCallback : public bgfx::CallbackI
 
 
 		// Save screen shot as PNG.
 		// Save screen shot as PNG.
 		bx::snprintf(temp, BX_COUNTOF(temp), "%s.png", _filePath);
 		bx::snprintf(temp, BX_COUNTOF(temp), "%s.png", _filePath);
-		savePng(temp, _width, _height, _pitch, _data, false, _yflip);
+		savePng(temp, _width, _height, _pitch, _data, bimg::TextureFormat::BGRA8, _yflip);
 
 
 		// Save screen shot as TGA.
 		// Save screen shot as TGA.
 		bx::snprintf(temp, BX_COUNTOF(temp), "%s.tga", _filePath);
 		bx::snprintf(temp, BX_COUNTOF(temp), "%s.tga", _filePath);