Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

91 Zeilen
2.1 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://www.wtfpl.net/ 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. struct DebugRenderMode
  37. {
  38. enum Value
  39. {
  40. //Add your new rendermode at your convenience
  41. Default,
  42. Wireframe,
  43. Lighting,
  44. Normal,
  45. UV,
  46. Max
  47. }
  48. m_value;
  49. inline DebugRenderMode() : m_value(Default) {}
  50. inline DebugRenderMode(Value v) : m_value(v) {}
  51. inline DebugRenderMode(int v) : m_value((Value)v) {}
  52. inline operator Value() { return m_value; }
  53. };
  54. class Video
  55. {
  56. public:
  57. static void Setup(ivec2 size);
  58. static void SetCustomSize(ivec2 size);
  59. static void RestoreSize();
  60. static void Destroy();
  61. static void SetFov(float theta);
  62. static void SetDepth(bool set);
  63. static void SetFaceCulling(bool set);
  64. static bool HasFaceCulling();
  65. static void SetAlphaBlend(bool set);
  66. static bool HasAlphaBlend();
  67. static void SetClearColor(vec4 color);
  68. static void SetClearDepth(float f);
  69. static void SetDebugRenderMode(DebugRenderMode d);
  70. static DebugRenderMode GetDebugRenderMode();
  71. static void Clear(ClearMask m);
  72. static void Capture(uint32_t *buffer);
  73. static ivec2 GetSize();
  74. };
  75. } /* namespace lol */
  76. #endif // __LOL_VIDEO_H__