wxBufferedDC(3erl)
π wxBufferedDC β Erlang Module Definition π
okay bestie, welcome to the wxBufferedDC(3erl) page β yes, thatβs the manual name, and yes, weβre gonna get through it together. Functions for the wxBufferedDC class are right below, and I promise itβs giving βflicker-free main character energy,β not βcryptic C++ jump scare.β β¨
πΈ NAME πΈ
wxBufferedDC β Functions for wxBufferedDC class
β¨ DESCRIPTION β¨
Okay so picture this: this class is the lowkey hero for avoiding flicker. When you draw on it, everything is actually drawn first on an in-memory buffer (a wxBitmap) and then copied to the screen using the associated wxDC β only once, when this object is destroyed. Slay. π
wxBufferedDC itself is typically associated with wxClientDC. If you want to use it in your EVT_PAINT handler, you should look at wxBufferedPaintDC instead. iykyk, different vibe. π¦
When used like this, a valid DC must be specified in the constructor, while the buffer bitmap doesnβt have to be explicitly provided β by default this class will allocate the bitmap of required size itself. However, using a dedicated bitmap can speed up the redrawing process by eliminating the repeated creation and destruction of a possibly big bitmap. Otherwise, wxBufferedDC can be used in the same way as any other device context. No cap. β¨
Another possible use for wxBufferedDC is to use it to maintain a backing store for the window contents. In this case, the associated DC may be NULL but a valid backing store bitmap should be specified. Very specific, very important. π
Finally, please note that GTK+ 2.0 as well as macOS provide double buffering themselves natively. You can either use wxWindow:isDoubleBuffered/1 to determine whether you need to use buffering or not, or use wxAutoBufferedPaintDC (not implemented in wx) to avoid needless double buffering on the systems which already do it automatically. π
See: wxDC, wxMemoryDC, wxBufferedPaintDC, wxAutoBufferedPaintDC (not implemented in wx)
This class is derived (and can use functions) from: wxMemoryDC wxDC
wxWidgets docs: wxBufferedDC
π DATA TYPES π
wxBufferedDC() = wx:wx_object()
π«Ά EXPORTS π«Ά
new() -> wxBufferedDC()
Default constructor.
You must call one of the init/4 methods later in order to use the device context.
new(Dc) -> wxBufferedDC()
Types:
Dc = wxDC:wxDC()
new(Dc, Area) -> wxBufferedDC()
This one is listed with no extra type block in the original β just the signature, bestie.
new(Dc, Area :: [Option]) -> wxBufferedDC()
Types:
Dc = wxDC:wxDC()
Option = {buffer, wxBitmap:wxBitmap()} | {style, integer()}
Creates a buffer for the provided dc.
init/4 must not be called when using this constructor.
new(Dc, Area, Options :: [Option]) -> wxBufferedDC()
Types:
Dc = wxDC:wxDC()
Area = {W :: integer(), H :: integer()}
Option = {style, integer()}
Creates a buffer for the provided dc.
init/4 must not be called when using this constructor.
destroy(This :: wxBufferedDC()) -> ok
Copies everything drawn on the DC so far to the underlying DC associated with this object, if any.
init(This, Dc) -> ok
Types:
This = wxBufferedDC()
Dc = wxDC:wxDC()
init(This, Dc, Area) -> ok
No extra type block listed here in the original β the signature is the whole moment. π
init(This, Dc, Area :: [Option]) -> ok
Types:
This = wxBufferedDC()
Dc = wxDC:wxDC()
Option = {buffer, wxBitmap:wxBitmap()} | {style, integer()}
init(This, Dc, Area, Options :: [Option]) -> ok
Types:
This = wxBufferedDC()
Dc = wxDC:wxDC()
Area = {W :: integer(), H :: integer()}
Option = {style, integer()}
Initializes the object created using the default constructor.
Please see the constructors for parameter details.
π big shoutout to the wxWidgets team β this is the wx 2.2.2.1 edition of wxBufferedDC(3erl), and the footer didnβt give us a date, so no cap: no date listed. π«Άβ¨
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms