backBuffer.h
资源名称:pong.rar [点击查看]
上传用户:szsg028
上传日期:2022-08-01
资源大小:12k
文件大小:1k
源码类别:
GDI/图象编程
开发平台:
Visual C++
- #ifndef BACKBUFFER_H
- #define BACKBUFFER_H
- #include <windows.h>
- class backBuffer
- {
- public:
- backBuffer(HWND hWnd, int width, int height);
- ~backBuffer();
- HDC getDC();
- int width();
- int height();
- void present();
- private:
- // Make copy constructor and assignment operator private
- // so client cannot copy BackBuffers. We do this because
- // this class is not designed to be copied because it
- // is not efficient--copying bitmaps is slow (lots of memory).
- // In addition, most applications will probably only need one
- // BackBuffer anyway.
- backBuffer(const backBuffer& rhs);
- backBuffer& operator=(const backBuffer& rhs);
- private:
- HWND m_hWnd;
- HDC m_hDC;
- HBITMAP m_hSurface;
- HBITMAP m_hOldObject;
- int m_Width;
- int m_Height;
- };
- #endif //BACKBUFFER_H