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.

88 lines
3.5 KiB

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef IMATSYSTEMSURFACEV5_H
  7. #define IMATSYSTEMSURFACEV5_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include <vgui/VGUI.h>
  12. #include "vgui/isurfacev30.h"
  13. namespace MatSystemSurfaceV5
  14. {
  15. #define MAT_SYSTEM_SURFACE_INTERFACE_VERSION_5 "MatSystemSurface005"
  16. class IMatSystemSurface : public SurfaceV30::ISurface
  17. {
  18. public:
  19. // Hook needed to get input to work.
  20. // If the app drives the input (like the engine needs to do for VCR mode),
  21. // it can set bLetAppDriveInput to true and call HandleWindowMessage for the Windows messages.
  22. virtual void AttachToWindow( void *hwnd, bool bLetAppDriveInput=false ) = 0;
  23. // If you specified true for bLetAppDriveInput, then call this for each window message that comes in.
  24. virtual void HandleWindowMessage( void *hwnd, unsigned int uMsg, unsigned int wParam, long lParam ) = 0;
  25. // Tells the surface to ignore windows messages
  26. virtual void EnableWindowsMessages( bool bEnable ) = 0;
  27. // Starts, ends 3D painting
  28. // NOTE: These methods should only be called from within the paint()
  29. // method of a panel.
  30. virtual void Begin3DPaint( int iLeft, int iTop, int iRight, int iBottom ) = 0;
  31. virtual void End3DPaint() = 0;
  32. // NOTE: This also should only be called from within the paint()
  33. // method of a panel. Use it to disable clipping for the rendering
  34. // of this panel.
  35. virtual void DisableClipping( bool bDisable ) = 0;
  36. // Prevents vgui from changing the cursor
  37. virtual bool IsCursorLocked() const = 0;
  38. // Sets the mouse get + set callbacks
  39. virtual void SetMouseCallbacks( GetMouseCallback_t getFunc, SetMouseCallback_t setFunc ) = 0;
  40. // Installs a function to play sounds
  41. virtual void InstallPlaySoundFunc( PlaySoundFunc_t soundFunc ) = 0;
  42. // Some drawing methods that cannot be accomplished under Win32
  43. virtual void DrawColoredCircle( int centerx, int centery, float radius, int r, int g, int b, int a ) = 0;
  44. virtual int DrawColoredText( vgui::HFont font, int x, int y, int r, int g, int b, int a, const char *fmt, ... ) = 0;
  45. // Draws text with current font at position and wordwrapped to the rect using color values specified
  46. virtual void DrawColoredTextRect( vgui::HFont font, int x, int y, int w, int h, int r, int g, int b, int a, const char *fmt, ... ) = 0;
  47. virtual void DrawTextHeight( vgui::HFont font, int w, int& h, char *fmt, ... ) = 0;
  48. // Returns the length of the text string in pixels
  49. virtual int DrawTextLen( vgui::HFont font, const char *fmt, ... ) = 0;
  50. // Draws a panel in 3D space. Assumes view + projection are already set up
  51. // Also assumes the (x,y) coordinates of the panels are defined in 640xN coords
  52. // (N isn't necessary 480 because the panel may not be 4x3)
  53. // The width + height specified are the size of the panel in world coordinates
  54. virtual void DrawPanelIn3DSpace( vgui::VPANEL pRootPanel, const VMatrix &panelCenterToWorld, int nPixelWidth, int nPixelHeight, float flWorldWidth, float flWorldHeight ) = 0;
  55. // Binds a material to a surface texture ID
  56. virtual void DrawSetTextureMaterial( int id, IMaterial *pMaterial ) = 0;
  57. };
  58. }
  59. //-----------------------------------------------------------------------------
  60. // FIXME: This works around using scoped interfaces w/ EXPOSE_SINGLE_INTERFACE
  61. //-----------------------------------------------------------------------------
  62. class IMatSystemSurfaceV5 : public MatSystemSurfaceV5::IMatSystemSurface
  63. {
  64. public:
  65. };
  66. #endif // IMATSYSTEMSURFACEV5_H