yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::gui::CanvasFrame Class Reference

Lightweight RAII guard for existing Canvas instances. More...

#include <canvas.h>

Collaboration diagram for yaze::gui::CanvasFrame:

Public Member Functions

 CanvasFrame (Canvas &canvas, CanvasFrameOptions options=CanvasFrameOptions())
 
 ~CanvasFrame ()
 
 CanvasFrame (const CanvasFrame &)=delete
 
CanvasFrameoperator= (const CanvasFrame &)=delete
 
 CanvasFrame (CanvasFrame &&other) noexcept
 
CanvasFrameoperator= (CanvasFrame &&other) noexcept
 
Canvasoperator-> ()
 
const Canvasoperator-> () const
 

Private Attributes

Canvascanvas_
 
CanvasFrameOptions options_
 
bool active_
 

Detailed Description

Lightweight RAII guard for existing Canvas instances.

Usage:

opts.grid_step = 32.0f;
gui::CanvasFrame frame(canvas, opts);
canvas.DrawBitmap(bitmap, 2, 2, 1.0f);
// Grid/overlay/persistent popups auto-render on destruction.
Lightweight RAII guard for existing Canvas instances.
Definition canvas.h:872
std::optional< float > grid_step
Definition canvas.h:70

Definition at line 872 of file canvas.h.

Constructor & Destructor Documentation

◆ CanvasFrame() [1/3]

yaze::gui::CanvasFrame::CanvasFrame ( Canvas & canvas,
CanvasFrameOptions options = CanvasFrameOptions() )

Definition at line 2436 of file canvas.cc.

References yaze::gui::Canvas::Begin(), canvas_, and options_.

Here is the call graph for this function:

◆ ~CanvasFrame()

yaze::gui::CanvasFrame::~CanvasFrame ( )

Definition at line 2441 of file canvas.cc.

References active_, canvas_, yaze::gui::Canvas::End(), and options_.

Here is the call graph for this function:

◆ CanvasFrame() [2/3]

yaze::gui::CanvasFrame::CanvasFrame ( const CanvasFrame & )
delete

◆ CanvasFrame() [3/3]

yaze::gui::CanvasFrame::CanvasFrame ( CanvasFrame && other)
noexcept

Definition at line 2447 of file canvas.cc.

Member Function Documentation

◆ operator=() [1/2]

CanvasFrame & yaze::gui::CanvasFrame::operator= ( const CanvasFrame & )
delete

◆ operator=() [2/2]

CanvasFrame & yaze::gui::CanvasFrame::operator= ( CanvasFrame && other)
noexcept

Definition at line 2452 of file canvas.cc.

References yaze::gui::Canvas::End().

Here is the call graph for this function:

◆ operator->() [1/2]

Canvas * yaze::gui::CanvasFrame::operator-> ( )
inline

Definition at line 884 of file canvas.h.

References canvas_.

◆ operator->() [2/2]

const Canvas * yaze::gui::CanvasFrame::operator-> ( ) const
inline

Definition at line 885 of file canvas.h.

References canvas_.

Member Data Documentation

◆ canvas_

Canvas* yaze::gui::CanvasFrame::canvas_
private

Definition at line 888 of file canvas.h.

Referenced by CanvasFrame(), operator->(), operator->(), and ~CanvasFrame().

◆ options_

CanvasFrameOptions yaze::gui::CanvasFrame::options_
private

Definition at line 889 of file canvas.h.

Referenced by CanvasFrame(), and ~CanvasFrame().

◆ active_

bool yaze::gui::CanvasFrame::active_
private

Definition at line 890 of file canvas.h.

Referenced by ~CanvasFrame().


The documentation for this class was generated from the following files: