Team Fortress 2 Source Code as on 22/4/2020
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.

79 lines
3.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef IMATRENDERCONTEXTINTERNAL_H
  7. #define IMATRENDERCONTEXTINTERNAL_H
  8. #if defined( _WIN32 )
  9. #pragma once
  10. #endif
  11. // typedefs to allow use of delegation macros
  12. typedef Vector4D LightCube_t[6];
  13. abstract_class IMatRenderContextInternal : public IMatRenderContext
  14. {
  15. // For now, stuck implementing these until IMaterialSystem is reworked
  16. bool Connect(CreateInterfaceFn) { return true; }
  17. void Disconnect(void) {}
  18. void *QueryInterface(const char *pszInterface) { return NULL; }
  19. InitReturnVal_t Init(void) { return INIT_OK; }
  20. void Shutdown(void) {}
  21. public:
  22. virtual float GetFloatRenderingParameter(int parm_number) const = 0;
  23. virtual int GetIntRenderingParameter(int parm_number) const = 0;
  24. virtual Vector GetVectorRenderingParameter(int parm_number) const = 0;
  25. virtual void SwapBuffers() = 0;
  26. virtual void SetCurrentMaterialInternal(IMaterialInternal* pCurrentMaterial) = 0;
  27. virtual IMaterialInternal* GetCurrentMaterialInternal() const = 0;
  28. virtual int GetLightmapPage() = 0;
  29. virtual void ForceDepthFuncEquals( bool) = 0;
  30. virtual bool InFlashlightMode() const = 0;
  31. virtual void BindStandardTexture( Sampler_t, StandardTextureId_t ) = 0;
  32. virtual void GetLightmapDimensions( int *, int *) = 0;
  33. virtual MorphFormat_t GetBoundMorphFormat() = 0;
  34. virtual ITexture *GetRenderTargetEx( int ) = 0;
  35. virtual void DrawClearBufferQuad( unsigned char, unsigned char, unsigned char, unsigned char, bool, bool, bool ) = 0;
  36. virtual bool OnDrawMesh( IMesh *pMesh, int firstIndex, int numIndices ) = 0;
  37. virtual bool OnDrawMesh( IMesh *pMesh, CPrimList *pLists, int nLists ) = 0;
  38. virtual bool OnSetFlexMesh( IMesh *pStaticMesh, IMesh *pMesh, int nVertexOffsetInBytes ) = 0;
  39. virtual bool OnSetColorMesh( IMesh *pStaticMesh, IMesh *pMesh, int nVertexOffsetInBytes ) = 0;
  40. virtual bool OnSetPrimitiveType( IMesh *pMesh, MaterialPrimitiveType_t type ) = 0;
  41. virtual bool OnFlushBufferedPrimitives() = 0;
  42. virtual void SyncMatrices() = 0;
  43. virtual void SyncMatrix( MaterialMatrixMode_t ) = 0;
  44. virtual void ForceHardwareSync() = 0;
  45. virtual void BeginFrame() = 0;
  46. virtual void EndFrame() = 0;
  47. virtual void SetFrameTime( float frameTime ) = 0;
  48. virtual void SetCurrentProxy( void *pProxy ) = 0;
  49. virtual void MarkRenderDataUnused( bool bBeginFrame ) = 0;
  50. virtual CMatCallQueue *GetCallQueueInternal() = 0;
  51. // Map and unmap a texture. The pRecipient->OnAsyncMapComplete is called when complete.
  52. virtual void AsyncMap( ITextureInternal* pTexToMap, IAsyncTextureOperationReceiver* pRecipient, void* pExtraArgs ) = 0;
  53. virtual void AsyncUnmap( ITextureInternal* pTexToUnmap ) = 0;
  54. // Copy from a render target to a staging texture, in order with other async commands.
  55. virtual void AsyncCopyRenderTargetToStagingTexture( ITexture* pDst, ITexture* pSrc, IAsyncTextureOperationReceiver* pRecipient, void* pExtraArgs ) = 0;
  56. #ifdef DX_TO_GL_ABSTRACTION
  57. virtual void DoStartupShaderPreloading( void ) = 0;
  58. #endif
  59. virtual void TextureManagerUpdate() = 0;
  60. };
  61. #endif // IMATRENDERCONTEXTINTERNAL_H