deal properly with resize/retina in eglPlugin/eglRendererVisualShapeConverter

This commit is contained in:
erwincoumans
2019-02-13 14:43:39 -08:00
parent b410e44137
commit a38093ad61
2 changed files with 7 additions and 2 deletions

View File

@@ -1839,9 +1839,12 @@ bool PhysXServerCommandProcessor::processForwardDynamicsCommand(const struct Sha
float* depthBuffer = 0;
int* segmentationMaskBuffer = 0;
int startPixelIndex = 0;
int width = 1024;
int height = 768;
m_data->m_pluginManager.getRenderInterface()->getWidthAndHeight(width, height);
int numPixelsCopied = 0;
m_data->m_pluginManager.getRenderInterface()->copyCameraImageData(pixelRGBA, numRequestedPixels,
depthBuffer, numRequestedPixels,

View File

@@ -241,7 +241,9 @@ static void SimpleResizeCallback(float widthf, float heightf)
if (gWindow && gWindow->m_data->m_instancingRenderer)
{
gWindow->m_data->m_instancingRenderer->resize(width, height);
gWindow->setWidthAndHeight(width, height);
}
//if (gApp && gApp->m_instancingRenderer)
// gApp->m_instancingRenderer->resize(width, height);
@@ -1281,7 +1283,7 @@ void EGLRendererVisualShapeConverter::copyCameraImageDataGL(
{
m_data->m_window->endRendering();
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");
m_data->m_instancingRenderer->writeTransforms();
if (m_data->m_hasLightDirection)
@@ -1373,7 +1375,7 @@ void EGLRendererVisualShapeConverter::copyCameraImageDataGL(
{
{
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");
m_data->m_instancingRenderer->renderSceneInternal(B3_SEGMENTATION_MASK_RENDERMODE);
}