Raster.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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_RASTER_H
  13. #define SE_INCL_RASTER_H
  14. #ifdef PRAGMA_ONCE
  15. #pragma once
  16. #endif
  17. #include <Engine/Base/Lists.h>
  18. #include <Engine/Graphics/DrawPort.h>
  19. /*
  20. * Raster
  21. */
  22. class CRaster {
  23. public:
  24. CViewPort *ra_pvpViewPort; // viewport if existing
  25. CDrawPort ra_MainDrawPort; // initial drawport for entire raster
  26. CListHead ra_DrawPortList; // list of drawports
  27. PIX ra_Width; // number of pixels in one row
  28. PIX ra_Height; // number of pixels in one column
  29. SLONG ra_LockCount; // counter for memory locking
  30. ULONG ra_Flags; // special flags
  31. /* Recalculate dimensions for all drawports. */
  32. void RecalculateDrawPortsDimensions(void);
  33. /* Constructor for given size. */
  34. CRaster( PIX pixWidth, PIX pixHeight, ULONG ulFlags);
  35. /* Destructor. */
  36. virtual ~CRaster(void);
  37. /* Change size of this raster and all it's drawports. */
  38. void Resize(PIX pixNewWidth, PIX pixNewHeight);
  39. public:
  40. /* Lock for drawing. */
  41. virtual BOOL Lock();
  42. /* Unlock after drawing. */
  43. virtual void Unlock();
  44. };
  45. #endif /* include-once check. */