diff --git a/src/game_tab/left_panel/board/BoardCanvas.cpp b/src/game_tab/left_panel/board/BoardCanvas.cpp index fec281e..476b3aa 100644 --- a/src/game_tab/left_panel/board/BoardCanvas.cpp +++ b/src/game_tab/left_panel/board/BoardCanvas.cpp @@ -14,6 +14,7 @@ BoardCanvas::BoardCanvas(wxFrame *parent) ApplyPreferences(); // The following should be called when using an EVT_PAINT handler SetBackgroundStyle(wxBG_STYLE_PAINT); + //buffer=new wxBitmap(500,500,32); } BoardCanvas::~BoardCanvas() { @@ -44,6 +45,14 @@ void BoardCanvas::OnPaint(wxPaintEvent &event) { if (boardY > canvas_size.y) boardY = 0; DrawBoard(dc); + + // TODO: Make DrawBoard() drawing into wxMemoryDC! + /*wxMemoryDC dc2(*buffer); + dc2.SetBackgroundMode(wxTRANSPARENT); + dc2.SetPen(wxPen(*wxBLACK, 3)); + dc2.DrawRectangle(10,10,100,100); + dc.Blit(0, 0, 500,500, (wxDC*)&dc2,0,0);*/ + } void BoardCanvas::ApplyPreferences() { diff --git a/src/game_tab/left_panel/board/BoardCanvas.hpp b/src/game_tab/left_panel/board/BoardCanvas.hpp index 7645414..4a610aa 100644 --- a/src/game_tab/left_panel/board/BoardCanvas.hpp +++ b/src/game_tab/left_panel/board/BoardCanvas.hpp @@ -52,6 +52,8 @@ class BoardCanvas : public wxPanel { ClockTime black_time, white_time; bool frozen,lock_square_size; + wxBitmap *buffer; + public: BoardCanvas(wxFrame *parent); BoardCanvas(wxFrame *parent,std::uint32_t square_width, bool frozen);