Platform_Win32_Screen_DDraw.h
Go to the documentation of this file.00001 00010 #ifndef __Platform_Win32_Screen_DDraw_H__ 00011 #define __Platform_Win32_Screen_DDraw_H__ 00012 00013 // Includes 00014 #include "Platform_Win32_Screen_Technology.h" 00015 00016 // Forward declares 00017 struct IDirectDraw2; 00018 struct IDirectDrawSurface; 00019 struct IDirectDrawClipper; 00020 00021 // Platform_Win32_Screen_DDraw 00022 class Platform_Win32_Screen_DDraw:public Platform_Win32_Screen_Technology 00023 { 00024 public: 00025 Platform_Win32_Screen_DDraw(struct HWND__* windowHandle, bool fullscreen, int screenWidth, int screenHeight); 00026 virtual ~Platform_Win32_Screen_DDraw(); 00027 00028 virtual bool Setup(); 00029 00030 00031 virtual bool Present( 00032 unsigned short* bitmapData, 00033 int bitmapWidth, 00034 int bitmapHeight, 00035 unsigned short modulate, 00036 unsigned short backgroundColor 00037 ); 00038 00039 virtual void SetInterpolationMode(bool enabled); 00040 00041 virtual void TransformCursorCoordinates(float& x, float& y); 00042 00043 private: 00044 bool CopyBitmapToBackBufferInterpolation( 00045 unsigned short* bitmapData, 00046 int bitmapWidth, 00047 int bitmapHeight, 00048 unsigned short modulate 00049 ); 00050 00051 bool CopyBitmapToBackBufferNoInterpolation( 00052 unsigned short* bitmapData, 00053 int bitmapWidth, 00054 int bitmapHeight, 00055 unsigned short modulate, 00056 unsigned short backgroundColor, 00057 bool clearBorders 00058 ); 00059 00060 bool CopyBackBufferToFrontBufferInterpolation( 00061 int width, 00062 int height, 00063 unsigned short backgroundColor, 00064 bool clearBorder); 00065 00066 bool CopyBackBufferToFrontBufferNoInterpolation(); 00067 00068 bool ClearBackBuffer( 00069 int x1, 00070 int y1, 00071 int x2, 00072 int y2, 00073 unsigned short color 00074 ); 00075 00076 private: 00077 struct HWND__* windowHandle_; 00078 bool interpolationMode_; 00079 bool fullscreen_; 00080 int screenWidth_; 00081 int screenHeight_; 00082 void* ddrawDLL_; 00083 IDirectDraw2* directDraw_; 00084 IDirectDrawSurface* frontBuffer_; 00085 IDirectDrawSurface* backBuffer_; 00086 IDirectDrawClipper* clipper_; 00087 bool canUseAsyncBlt_; 00088 bool pixelFormat16_; 00089 unsigned short previousPresentColor_; 00090 int previousPresentWidth_; 00091 int previousPresentHeight_; 00092 int previousPresent_AppliedToBackBuffer_; 00093 int lastPresentWidth_; 00094 int lastPresentHeight_; 00095 }; 00096 00097 #endif /* __Platform_Win32_Screen_DDraw_H__ */
Reproduction/republishing of any material on this site without permission is strictly prohibited.
