Skip to content

Commit

Permalink
Forced paint buffer to 24 bit, avoiding slow path for alpha blits.
Browse files Browse the repository at this point in the history
  • Loading branch information
aardappel committed Jun 12, 2016
1 parent a0df2f3 commit c5fb4d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ Windows:
- Make sure your wxWidgets folder sits parallel to the src folder, that way the TreeSheets project will pick
it up without further modifications
- (if from git): copy include\wx\msw\setup0.h to include\wx\msw\setup.h
- (on Windows): comment out the big ifdef inside src/msw/dc.cpp/AlphaBlt.
see: http://trac.wxwidgets.org/ticket/14403
- Inside wxWidgets/build/msw, open wx_vc14.sln with Visual Studio 2015
- Select all projects in the solution explorer, and go to properties:
Set configuration to debug, and C/C++ -> Code Generation -> Runtime library
Expand Down
4 changes: 3 additions & 1 deletion src/mycanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ struct TSCanvas : public wxScrolledWindow

void OnPaint(wxPaintEvent &event)
{
wxAutoBufferedPaintDC dc(this);
auto sz = GetClientSize();
wxBitmap buffer(sz.GetX(), sz.GetY(), 24);
wxBufferedPaintDC dc(this, buffer);
// DoPrepareDC(dc);
doc->Draw(dc);
};
Expand Down

0 comments on commit c5fb4d0

Please sign in to comment.