SpoutSender.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. SpoutSender.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 __SpoutSender__
  23. #define __SpoutSender__
  24. #include "spoutSDK.h"
  25. class SPOUT_DLLEXP SpoutSender {
  26. public:
  27. SpoutSender();
  28. ~SpoutSender();
  29. // bool CreateSender(const char *Sendername, unsigned int width, unsigned int height, DWORD dwFormat = 0);
  30. bool CreateSender(char *Sendername, unsigned int width, unsigned int height, DWORD dwFormat = 0);
  31. // bool UpdateSender(const char *Sendername, unsigned int width, unsigned int height);
  32. bool UpdateSender(char *Sendername, unsigned int width, unsigned int height);
  33. void ReleaseSender(DWORD dwMsec = 0);
  34. bool SendImage(unsigned char* pixels, unsigned int width, unsigned int height, GLenum glFormat = GL_RGBA, bool bAlignment = true, bool bInvert=false);
  35. bool SendTexture(GLuint TextureID, GLuint TextureTarget, unsigned int width, unsigned int height, bool bInvert=true, GLuint HostFBO = 0);
  36. bool DrawToSharedTexture(GLuint TextureID, GLuint TextureTarget, unsigned int width, unsigned int height, float max_x = 1.0, float max_y = 1.0, float aspect = 1.0, bool bInvert = false, GLuint HostFBO = 0);
  37. bool SelectSenderPanel(const char* message = NULL);
  38. bool SetDX9(bool bDX9 = true); // set to use DirectX 9 (default is DirectX 11)
  39. bool GetDX9();
  40. bool SetMemoryShareMode(bool bMem = true);
  41. bool GetMemoryShareMode();
  42. void SetDX9compatible(bool bCompatible = true); // DirectX 11 format compatible with DirectX 9
  43. bool GetDX9compatible();
  44. int GetNumAdapters(); // Get the number of graphics adapters in the system
  45. bool GetAdapterName(int index, char *adaptername, int maxchars); // Get an adapter name
  46. bool SetAdapter(int index = 0); // Set required graphics adapter for output
  47. int GetAdapter(); // Get the current adapter index
  48. bool GetHostPath(const char *sendername, char *hostpath, int maxchars); // The path of the host that produced the sender
  49. bool SetVerticalSync(bool bSync = true);
  50. int GetVerticalSync();
  51. bool SenderDebug(char *Sendername, int size);
  52. Spout spout; // LJ DEBUG - for testing
  53. protected :
  54. bool bInv; // LJ DEBUG Transition flag for a 2.005 app with a 2.004 user installation
  55. };
  56. #endif