// Assuming your renderer is named 'renderer'
// Check if the VR device is presenting
const isVRPresenting = renderer.xr.isPresenting;
// Change the size only if the VR device is not presenting
if (!isVRPresenting) {
renderer.setSize(newWidth, newHeight);
}
// The rest of your rendering code...