VPIXX hardware class?

Looking through the API, there are a few deprecated methods. For example, the visual.Window class contains a deprecated bitsMode, who’s entry now says

DEPRECATED in 1.80.02. Use BitsSharp class from pycrsltd instead.

However, I can’t see the pycrsltd library being loaded anywhere.

So, yes the way this works had to change to make it possible to make it more possible to support other hardware. That means that, rather than the window, itself, needing to know about all the boxes that might interact with it, Window just does its own thing but allows hooks (methods) to be overridden by other objects. For instance, with

win = Window( ... )
bits = BitsSharp(win, ... )

the idea is that bits goes and changes the Window so that it will operate correctly with this device. In the init of BitsSharp. it takes the Window method _prepareFBOrender and replaces it with its own (so that it can render the framebuffer using Mono++ mode etc) and replaces win.gammaRamp with a linear ramp so that it can take over the gamma ramp control itself. Does that make sense?

So the Window no longer knows about CRS, it’s that CRS changes the necessary parts of the Window.

You sort of don’t pass either object anything from the other.

I expect that you’d most naturally create a ViewPixx class in PsychoPy that is a subclass of the one they provide (just as the BitsSharp class is a sub-class of SerialDevice) and where some methods need overriding so that they also trigger some action on the visual.Window as needed.

You’ll need to use settings from the ViewPixx to set things in the Window, and vice-versa. e.g. the choice of what shader program you apply when rendering the FBO into the actual back buffer will depend on what mode the ViewPixx is set to. So you could override the function setVideoMode() like this:

    def setVideoMode(self, videoMode):
        super(self).setVideoMode(videoMode)  # set the mode on the ViewPix
        
        # then also set up the Window to use this mode (changed FBO shader)

Conversely some methods (like setBacklightIntensity ) won’t need overriding because the window doesn’t need to behave differently

A question here: how should I include a dependency to pypixxlib within PsychoPy? Obviously we don’t want this to be required for all users, but rather we would like the system to check for it if the VPIXX hardware is used. How should I implement that in an import statement?

Your device will be in psychopy/hardware/pypixx and pypixxlib will just be imported if the user does

from psychopy.hardware import pypixx