ViewPort.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* Copyright (c) 2002-2012 Croteam Ltd.
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of version 2 of the GNU General Public License as published by
  4. the Free Software Foundation
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License along
  10. with this program; if not, write to the Free Software Foundation, Inc.,
  11. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
  12. #ifndef SE_INCL_VIEWPORT_H
  13. #define SE_INCL_VIEWPORT_H
  14. #ifdef PRAGMA_ONCE
  15. #pragma once
  16. #endif
  17. #include <Engine/Graphics/Raster.h>
  18. #ifdef SE1_D3D
  19. #include <d3d8.h>
  20. #endif // SE1_D3D
  21. /*
  22. * ViewPort
  23. */
  24. /* rcg !!! FIXME: This will need to go away. */
  25. #ifdef PLATFORM_WIN32
  26. class CTempDC {
  27. public:
  28. HDC hdc;
  29. HWND hwnd;
  30. CTempDC(HWND hWnd);
  31. ~CTempDC(void);
  32. };
  33. #endif
  34. // base abstract class for viewport
  35. class ENGINE_API CViewPort {
  36. public:
  37. // implementation
  38. HWND vp_hWnd; // canvas (child) window
  39. HWND vp_hWndParent; // window of the viewport
  40. CRaster vp_Raster; // the used Raster
  41. #ifdef SE1_D3D
  42. LPDIRECT3DSWAPCHAIN8 vp_pSwapChain; // swap chain for D3D
  43. LPDIRECT3DSURFACE8 vp_pSurfDepth; // z-buffer for D3D
  44. #endif // SE1_D3D
  45. INDEX vp_ctDisplayChanges; // number of display driver
  46. // open/close canvas window
  47. void OpenCanvas(void);
  48. void CloseCanvas(BOOL bRelease=FALSE);
  49. // interface
  50. /* Constructor for given window. */
  51. CViewPort(PIX pixWidth, PIX pixHeight, HWND hWnd);
  52. /* Destructor. */
  53. ~CViewPort(void);
  54. /* Display the back buffer on screen. */
  55. void SwapBuffers(void);
  56. // change size of this viewport, it's raster and all it's drawports to fit it window
  57. void Resize(void);
  58. };
  59. #endif /* include-once check. */