/*
 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
 */
#ifndef _GRAPHICS_2D_
#define _GRAPHICS_2D_

#include <jni.h>
#include <windows.h>

class Graphics2D {
public:
    Graphics2D();
    virtual ~Graphics2D();

    void SetWindow(HWND window);
    HWND GetWindow() { return m_hwnd; }

    HDC GetDC() { return m_hdc; }

    void begin();
    void end();

    void SelectFont(HFONT hFont);

private:
    HWND m_hwnd;
    HDC m_hdc;

    HBITMAP backBuffer;
    int width, height;

    HBITMAP oldBitmap;
    HBRUSH oldBrush;
    HPEN oldPen;
    HFONT oldFont;  // original font in the m_hdc
    HFONT copyFont; // a copy of Rain's font currently selected

}; /* Graphics2D */

#endif _GRAPHICS_2D_
