You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.4 KiB

  1. //
  2. // Lol Engine
  3. //
  4. // Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the Do What The Fuck You Want To
  7. // Public License, Version 2, as published by Sam Hocevar. See
  8. // http://sam.zoy.org/projects/COPYING.WTFPL for more details.
  9. //
  10. //
  11. // The Video interface
  12. // -------------------
  13. // Helper GL functions to set up the scene.
  14. //
  15. #if !defined __LOL_VIDEO_H__
  16. #define __LOL_VIDEO_H__
  17. #include <stdint.h>
  18. namespace lol
  19. {
  20. struct ClearMask
  21. {
  22. enum Value
  23. {
  24. /* Note: D3D9 doesn't appear to support the accumulation buffer,
  25. * and it is a deprecated OpenGL feature. No reason to support it. */
  26. Color = 1 << 0,
  27. Depth = 1 << 1,
  28. Stencil = 1 << 2,
  29. All = 0xffffffff
  30. }
  31. m_value;
  32. inline ClearMask(Value v) : m_value(v) {}
  33. inline ClearMask(uint64_t i) : m_value((Value)i) {}
  34. inline operator Value() { return m_value; }
  35. };
  36. class Video
  37. {
  38. public:
  39. static void Setup(ivec2 size);
  40. static void Destroy();
  41. static void SetFov(float theta);
  42. static void SetDepth(bool set);
  43. static void SetClearColor(vec4 color);
  44. static void SetClearDepth(float f);
  45. static void Clear(ClearMask m);
  46. static void Capture(uint32_t *buffer);
  47. static ivec2 GetSize();
  48. };
  49. } /* namespace lol */
  50. #endif // __LOL_VIDEO_H__