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.

75 lines
2.6 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //===========================================================================//
  8. #ifndef IBVHNODE_H
  9. #define IBVHNODE_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "worldstructures.h"
  14. #include "bvhsupport.h"
  15. class IResourceDictionary;
  16. //-----------------------------------------------------------------------------
  17. // Methods related to rendering nodes
  18. //-----------------------------------------------------------------------------
  19. abstract_class IBVHNode
  20. {
  21. public:
  22. // helpers
  23. virtual int GetID() = 0;
  24. virtual int GetFlags() = 0;
  25. virtual void SetFlags( int nFlags ) = 0;
  26. virtual TiledPosition_t GetOrigin() = 0;
  27. virtual AABB_t GetBounds() = 0;
  28. virtual void SetBounds( AABB_t bounds ) = 0;
  29. virtual float GetMinDistance() = 0;
  30. virtual int GetNumChildren() = 0;
  31. virtual int GetNumResources() = 0;
  32. virtual int GetNumDrawCalls() = 0;
  33. virtual bool IsFullyResident() = 0;
  34. virtual void SetIsFullyResident( bool bRes ) = 0;
  35. virtual bool IsLoading() = 0;
  36. virtual void SetIsLoading( bool bLoading ) = 0;
  37. virtual int GetChild( int c ) = 0;
  38. virtual int GetParent() = 0;
  39. virtual void SetParent( int i ) = 0;
  40. virtual int GetResourceIndex( int r ) = 0;
  41. virtual void SetResourceIndex( int r, int index ) = 0;
  42. virtual CBVHDrawCall &GetDrawCall( int d ) = 0;
  43. virtual void Draw( IRenderContext *pRenderContext,
  44. CBVHDrawCall *pDrawCall,
  45. IResourceDictionary *pDictionary,
  46. ShaderComboVariation_t nVariation = VARIATION_DEFAULT,
  47. ConstantBufferHandle_t hObjectCB = 0 ) = 0;
  48. virtual void Draw( IRenderContext *pRenderContext,
  49. IResourceDictionary *pDictionary,
  50. CFrustum &frustum,
  51. Vector &vOriginShift,
  52. uint nCurrentFrameNumber,
  53. ShaderComboVariation_t nVariation = VARIATION_DEFAULT,
  54. ConstantBufferHandle_t hObjectCB = 0 ) = 0;
  55. virtual int GetNumPointLights() = 0;
  56. virtual int GetNumHemiLights() = 0;
  57. virtual int GetNumSpotLights() = 0;
  58. virtual PointLightData_t *GetPointLights() = 0;
  59. virtual HemiLightData_t *GetHemiLights() = 0;
  60. virtual SpotLightData_t *GetSpotLights() = 0;
  61. // loading-related
  62. virtual unsigned char* Init( unsigned char *pData ) = 0;
  63. // Tools only
  64. virtual void SetupMaterialForDraw( IRenderContext *pRenderContext, IResourceDictionary *pIDictionary, RenderInputLayout_t inputLayout, int nDraw, ShaderComboVariation_t nVariation ) = 0;
  65. virtual void SetNodeResources( int *pResources, int nResources ) = 0;
  66. };
  67. #endif