yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
8abaec701
master
1// png-serialize-util.cpp 2#define _CRT_SECURE_NO_WARNINGS 3 4#include "png-serialize-util.h" 5 6#include <stdio.h> 7#include <stdlib.h> 8 9#define STB_IMAGE_WRITE_IMPLEMENTATION 10#include "stb_image_write.h" 11 12namespace renderer_test 13{ 14using namespace Slang ; 15 16/* static */ Slang ::Result PngSerializeUtil ::write ( 17const char * filename , 18ISlangBlob * pixels , 19uint32_t width , 20uint32_t height , 21uint32_t rowPitch ) 22{ 23int stbResult = 24stbi_write_png (filename ,width ,height ,4 ,pixels -> getBufferPointer (),rowPitch ); 25 26return stbResult ?SLANG_OK :SLANG_FAIL ; 27} 28 29}// namespace renderer_test