def consider_resize(self):
        """ Checks if the target has to get resized, and if this is the case,
        performs the resize. This should be called when the window resolution
        changed. """
        current_size = LVecBase2i(self._size)
        self._compute_size_from_constraint()
        if current_size != self._size:
            if self._internal_buffer:
                self._internal_buffer.set_size(self._size.x, self._size.y)
 Checks if the target has to get resized, and if this is the case,
        performs the resize. This should be called when the window resolution
        changed. 
metadrive/render_pipeline/rpcore/render_target.py