Making Sure the T-Lock System Works
T-Lock relies on the graphics card passing values from the Matlab code into the Bits++ completely accurately. The trouble is, graphics don't normally include 'special codes'. They are normally just pictures. And in a picture it generally doesn't matter too much if, say, one or two of the pixels have their values altered slightly.
When OpenGL does something like drawing a texture on the screen that texture can be enlarged or shrunk before it is drawn. In this case OpenGL has to decide how it will interpolate between the pixels in the original texture so that it can draw a different number of pixels on the screen. This should not be a problem for us as we are not shrinking or enlarging the texture when we draw it. The trouble is, if interpolation is switched on, a small amount of 'residual' interpolation happens. This is enough to mess up the T-Lock code, if the code is included in the texture.
To make sure this doesn't happen, when drawing the T-Lock code to the Bits++ screen using the DrawTexture function you should use 'nearest neighbour' rather than 'bilinear' intepolation. Type Screen DrawTexture? at the Matlab prompt to see how to do this.
LoadNormalizedGammaTable
Another thing that might stop the T-Lock system from working is the gamma table in the graphics card. If this is anything other than a linear greyscale ramp it will alter the values of pixels passed to the Bits++ and break the T-Lock code. So a LoadNormalizedGammaTable command is added to the start of every Bits++ Matlab script.