public void SetupTexture() { //fCamera1 = VideoTexture.CreateFromDeviceIndex(GI, 0, 320, 240); //fCamera2 = VideoTexture.CreateFromDeviceIndex(GI, 1, 320, 240); fCamera1 = VideoTexture.CreateFromDeviceIndex(GI, 0, true); fCamera2 = VideoTexture.CreateFromDeviceIndex(GI, 1, true); fPictureTexture = TextureHelper.CreateTextureFromFile(GI, "EELogo.jpg", false); flagTexture = fPictureTexture; }
public static VideoTexture CreateFromDevicePath(GraphicsInterface gi, string devicePath, int width, int height, bool autoStart) { VideoCaptureDevice vidCap = VideoCaptureDevice.CreateCaptureDeviceFromName(devicePath, width, height); if (null == vidCap) return null; VideoTexture tex = new VideoTexture(gi, vidCap, autoStart); return tex; }
public static VideoTexture CreateFromDeviceIndex(GraphicsInterface gi, int deviceIndex, bool autoStart) { int numDevices = VideoCaptureDevice.GetNumberOfInputDevices(); if ((deviceIndex >= 0) && (deviceIndex <= numDevices - 1)) { VideoCaptureDevice vidCap = VideoCaptureDevice.CreateCaptureDeviceFromIndex(deviceIndex,0,0); VideoTexture tex = new VideoTexture(gi, vidCap, autoStart); return tex; } // Return a checkerboard pattern return null; }