gdisurface.h

来自「手机游戏绘图类」· C头文件 代码 · 共 62 行

H
62
字号
//////////////////////////////////////////////////////////////////////////////
//
// PocketHAL
// Copyright 2004 by Thierry Tremblay
//
//////////////////////////////////////////////////////////////////////////////

/** @file
    Windows only - Surface that wraps a GDI Device Independant Bitmap (DIB).
*/

#ifndef POCKETHAL_GDISURFACE_H
#define POCKETHAL_GDISURFACE_H

#include <PocketHAL/surface.h>
#include <windows.h>



namespace PHAL
{


//////////////////////////////////////////////////////////////////////////////
//
/// A GDISurface is a surface that wraps a Device Independant Bitmap (DIB).
/// You can retrieve a DC to the surface and draw on it using the GDI functions.
/// This class is only available on Windows platforms.
//
//////////////////////////////////////////////////////////////////////////////

class GDISurface : public Surface
{
public:

    /// Static constructor: create a GDI surface.
    /// Returns NULL if there is not enough memory.
    static GDISurface* Create( unsigned width, unsigned height );

    /// Destructor
    ~GDISurface();

    /// Retrieve the internal DC. Do NOT release/destroy it. The DC's lifetime is tied to the GDISurface object.
    HDC GetDC() const { return m_hDC; }


private:

    GDISurface( unsigned width, unsigned height );

    HBITMAP  m_hBitmap;
    HDC      m_hDC;
};



} // end of namespace PHAL



#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?