SpoutReceiver.h 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. SpoutReceiver.h
  3. Copyright (c) 2014-2015, Lynn Jarvis. All rights reserved.
  4. Redistribution and use in source and binary forms, with or without modification,
  5. are permitted provided that the following conditions are met:
  6. 1. Redistributions of source code must retain the above copyright notice,
  7. this list of conditions and the following disclaimer.
  8. 2. Redistributions in binary form must reproduce the above copyright notice,
  9. this list of conditions and the following disclaimer in the documentation
  10. and/or other materials provided with the distribution.
  11. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
  12. EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  13. OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  15. INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  16. PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  17. INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  18. LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  19. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  20. */
  21. #pragma once
  22. #ifndef __SpoutReceiver__
  23. #define __SpoutReceiver__
  24. #include "spoutSDK.h"
  25. class SPOUT_DLLEXP SpoutReceiver {
  26. public:
  27. SpoutReceiver();
  28. ~SpoutReceiver();
  29. bool CreateReceiver(char* Sendername, unsigned int &width, unsigned int &height, bool bUseActive = false);
  30. bool ReceiveTexture(char* Sendername, unsigned int &width, unsigned int &height, GLuint TextureID = 0, GLuint TextureTarget = 0, bool bInvert = false, GLuint HostFBO = 0);
  31. bool ReceiveImage (char* Sendername, unsigned int &width, unsigned int &height, unsigned char * pixels, GLenum glFormat = GL_RGBA, GLuint HostFBO = 0);
  32. bool CheckReceiver (char* Sendername, unsigned int &width, unsigned int &height, bool &bConnected);
  33. bool GetImageSize (char* Sendername, unsigned int &width, unsigned int &height, bool &bMemoryMode);
  34. void ReleaseReceiver();
  35. bool BindSharedTexture();
  36. bool UnBindSharedTexture();
  37. bool DrawSharedTexture(float max_x = 1.0, float max_y = 1.0, float aspect = 1.0, bool bInvert = true);
  38. int GetSenderCount();
  39. bool GetSenderName(int index, char* Sendername, int MaxSize = 256);
  40. bool GetSenderInfo(const char* Sendername, unsigned int &width, unsigned int &height, HANDLE &dxShareHandle, DWORD &dwFormat);
  41. bool GetActiveSender(char* Sendername);
  42. bool SetActiveSender(const char* Sendername);
  43. bool SelectSenderPanel(const char* message = NULL);
  44. bool SetDX9(bool bDX9 = true); // set to use DirectX 9 (default is DirectX 11)
  45. bool GetDX9();
  46. bool SetMemoryShareMode(bool bMem = true);
  47. bool GetMemoryShareMode();
  48. void SetDX9compatible(bool bCompatible = true);
  49. bool GetDX9compatible();
  50. int GetNumAdapters(); // Get the number of graphics adapters in the system
  51. bool GetAdapterName(int index, char *adaptername, int maxchars); // Get an adapter name
  52. bool SetAdapter(int index = 0); // Set required graphics adapter for output
  53. int GetAdapter(); // Get the current adapter index
  54. bool GetHostPath(const char *sendername, char *hostpath, int maxchars); // The path of the host that produced the sender
  55. bool SetVerticalSync(bool bSync = true);
  56. int GetVerticalSync();
  57. Spout spout; // for debug
  58. protected :
  59. bool bInv; // Transition flag for a 2.005 app with a 2.004 user installation
  60. };
  61. #endif