Counter Strike : Global Offensive Source Code
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.

73 lines
2.1 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #ifndef RUNTIMEDEMO1_H
  8. #define RUNTIMEDEMO1_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "materialsystem/materialsystemutil.h"
  13. #include "tier1/utlvector.h"
  14. //-----------------------------------------------------------------------------
  15. // Initial state: Quad rendering library
  16. // Contains two main classes; First is a quad
  17. //-----------------------------------------------------------------------------
  18. class CQuadV1
  19. {
  20. public:
  21. CQuadV1() { m_x0 = m_x1 = m_y0 = m_y1 = 0; m_Color.r = m_Color.g = m_Color.g = m_Color.a = 255; }
  22. int m_x0;
  23. int m_x1;
  24. int m_y0;
  25. int m_y1;
  26. color32 m_Color;
  27. };
  28. //-----------------------------------------------------------------------------
  29. // Second main class is the manager which contains a list of quads
  30. // to render and the code to do the rendering
  31. // It's usually a good idea to start with the run-time implementation
  32. // because it will impose the most constraints on the data and therefore
  33. // on how the editor should work
  34. //
  35. // Should the runtime lib be a static lib or a DLL?
  36. // It needs to be a DLL if it needs to have global state which is accessible
  37. // across many other DLLs. There are some advantages to having it be a static
  38. // lib, however: for example, some editors, like the particle system, use
  39. // the runtime lib to render the preview. In this case, you want to have it
  40. // be a static lib so that the editor + the game have different notions about
  41. // what data is associated with the particle systems.
  42. //-----------------------------------------------------------------------------
  43. class CQuadManagerV1
  44. {
  45. public:
  46. // Init, shutdown
  47. void Init();
  48. void Shutdown();
  49. // Quad management
  50. CQuadV1* AddQuad( );
  51. void RemoveQuad( CQuadV1* pQuad );
  52. void RemoveAllQuads();
  53. // Quad rendering
  54. void DrawQuads();
  55. private:
  56. CUtlVector< CQuadV1 * > m_Quads;
  57. CMaterialReference m_Material;
  58. };
  59. extern CQuadManagerV1 *g_pQuadManagerV1;
  60. #endif // RUNTIMEDEMO1_H