deal properly with resize/retina in eglPlugin/eglRendererVisualShapeConverter
This commit is contained in:
@@ -1839,9 +1839,12 @@ bool PhysXServerCommandProcessor::processForwardDynamicsCommand(const struct Sha
|
|||||||
float* depthBuffer = 0;
|
float* depthBuffer = 0;
|
||||||
int* segmentationMaskBuffer = 0;
|
int* segmentationMaskBuffer = 0;
|
||||||
int startPixelIndex = 0;
|
int startPixelIndex = 0;
|
||||||
|
|
||||||
int width = 1024;
|
int width = 1024;
|
||||||
int height = 768;
|
int height = 768;
|
||||||
|
m_data->m_pluginManager.getRenderInterface()->getWidthAndHeight(width, height);
|
||||||
int numPixelsCopied = 0;
|
int numPixelsCopied = 0;
|
||||||
|
|
||||||
|
|
||||||
m_data->m_pluginManager.getRenderInterface()->copyCameraImageData(pixelRGBA, numRequestedPixels,
|
m_data->m_pluginManager.getRenderInterface()->copyCameraImageData(pixelRGBA, numRequestedPixels,
|
||||||
depthBuffer, numRequestedPixels,
|
depthBuffer, numRequestedPixels,
|
||||||
|
|||||||
@@ -241,7 +241,9 @@ static void SimpleResizeCallback(float widthf, float heightf)
|
|||||||
if (gWindow && gWindow->m_data->m_instancingRenderer)
|
if (gWindow && gWindow->m_data->m_instancingRenderer)
|
||||||
{
|
{
|
||||||
gWindow->m_data->m_instancingRenderer->resize(width, height);
|
gWindow->m_data->m_instancingRenderer->resize(width, height);
|
||||||
|
gWindow->setWidthAndHeight(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//if (gApp && gApp->m_instancingRenderer)
|
//if (gApp && gApp->m_instancingRenderer)
|
||||||
// gApp->m_instancingRenderer->resize(width, height);
|
// gApp->m_instancingRenderer->resize(width, height);
|
||||||
@@ -1281,7 +1283,7 @@ void EGLRendererVisualShapeConverter::copyCameraImageDataGL(
|
|||||||
{
|
{
|
||||||
m_data->m_window->endRendering();
|
m_data->m_window->endRendering();
|
||||||
m_data->m_window->startRendering();
|
m_data->m_window->startRendering();
|
||||||
glViewport(0,0, sourceWidth, sourceHeight);
|
glViewport(0,0, sourceWidth*m_data->m_window->getRetinaScale(), sourceHeight*m_data->m_window->getRetinaScale());
|
||||||
B3_PROFILE("m_instancingRenderer render");
|
B3_PROFILE("m_instancingRenderer render");
|
||||||
m_data->m_instancingRenderer->writeTransforms();
|
m_data->m_instancingRenderer->writeTransforms();
|
||||||
if (m_data->m_hasLightDirection)
|
if (m_data->m_hasLightDirection)
|
||||||
@@ -1373,7 +1375,7 @@ void EGLRendererVisualShapeConverter::copyCameraImageDataGL(
|
|||||||
{
|
{
|
||||||
{
|
{
|
||||||
m_data->m_window->startRendering();
|
m_data->m_window->startRendering();
|
||||||
glViewport(0,0, sourceWidth, sourceHeight);
|
glViewport(0,0, sourceWidth*m_data->m_window->getRetinaScale(), sourceHeight*m_data->m_window->getRetinaScale());
|
||||||
BT_PROFILE("renderScene");
|
BT_PROFILE("renderScene");
|
||||||
m_data->m_instancingRenderer->renderSceneInternal(B3_SEGMENTATION_MASK_RENDERMODE);
|
m_data->m_instancingRenderer->renderSceneInternal(B3_SEGMENTATION_MASK_RENDERMODE);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user