preparation to receive camera image data from physics server

increase shadowmap world size default to 50 units (meter), 10 units (meter) was too small for most examples.
This commit is contained in:
erwin coumans
2016-05-31 10:23:04 -07:00
parent de9bd65c19
commit 14aa666c6f
21 changed files with 301 additions and 22 deletions

View File

@@ -657,6 +657,19 @@ SimpleOpenGL3App::~SimpleOpenGL3App()
delete m_data ;
}
void SimpleOpenGL3App::getScreenPixels(unsigned char* rgbaBuffer, int bufferSizeInBytes)
{
int width = (int)m_window->getRetinaScale()*m_instancingRenderer->getScreenWidth();
int height = (int)m_window->getRetinaScale()*m_instancingRenderer->getScreenHeight();
if ((width*height*4) == bufferSizeInBytes)
{
glReadPixels(0,0,width, height, GL_RGBA, GL_UNSIGNED_BYTE, rgbaBuffer);
int glstat = glGetError();
b3Assert(glstat==GL_NO_ERROR);
}
}
//#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "stb_image_write.h"
static void writeTextureToFile(int textureWidth, int textureHeight, const char* fileName, FILE* ffmpegVideo)