rolmodl
C++ API for the Simple Directmedia Library 2 (SDL2)
|
Renderer class that does not support rendering to texture. Use rolmodl::TexRen for rendering to texture support. More...
#include <Ren.hpp>
Public Member Functions | |
Ren (Win &win, int i, ren::Flags flags) | |
Initialize a renderer for window win , using the i th rendering driver, with configuration flags . More... | |
Ren (Win &win, ren::Flags flags) | |
Initialize a renderer for window win , with configuration flags , using the first rendering driver that supports it. More... | |
Ren (Win &win, int i) | |
Initialize a renderer for window win , using the i th rendering driver, with the default configuration. More... | |
Ren (Win &win) | |
Initialize a renderer for window win , with the default configuration, using the first rendering driver that supports it. More... | |
~Ren () noexcept | |
Free the underlying SDL_Renderer . More... | |
Ren (const Ren &that)=delete | |
Copying rolmodl renderers is not allowed because their lifetime is tied to the underlying SDL_Renderer 's. Use references or some other pointer type instead. | |
Ren (Ren &&that) noexcept | |
Take over the underlying SDL_Renderer of that . | |
Ren & | operator= (const Ren &that)=delete |
Copying rolmodl renderers is not allowed because their lifetime is tied to the underlying SDL_Renderer 's. Use references or some other pointer type instead. | |
Ren & | operator= (Ren &&that) noexcept |
Take over the underlying SDL_Renderer of that . | |
SDL_Renderer * | unsafeRaw () noexcept |
Get the underlying SDL_Renderer* . Unsafe because this value might be nullptr and using it with some SDL functions can lead to rolmodl invariant violation. | |
const SDL_Renderer * | unsafeRaw () const noexcept |
Get the underlying SDL_Renderer* in a const context. Unsafe because this value might be nullptr and using it with some SDL functions can lead to rolmodl invariant violation. | |
void | clear () |
Paint over the entire rendering target with the current color. More... | |
void | present () noexcept |
Push the backbuffer to screen, displaying any changes made since the last present . This operation invalidates the rendering buffer and it must be cleared with rolmodl::Ren::clear. More... | |
void | drawTex (Tex &tex) |
Copy the entire texture tex to fill the entire rendering target. More... | |
void | drawTex (Tex &tex, const SrcRectWH src) |
Copy the part of texture tex specified by the source rectangle src to fill the entire rendering target. More... | |
void | drawTex (Tex &tex, const SrcRectXY src) |
Copy the part of texture tex specified by the source rectangle src to fill the entire rendering target. More... | |
void | drawTex (Tex &tex, const DstRectWH dst) |
Copy the entire texture tex to fill the part of the rendering target specified by the destination rectangle dst . More... | |
void | drawTex (Tex &tex, const DstRectXY dst) |
Copy the entire texture tex to fill the part of the rendering target specified by the destination rectangle dst . More... | |
void | drawTex (Tex &tex, const SrcRectWH src, const DstRectWH dst) |
Copy the part of texture tex specified by the source rectangle src to fill the part of the rendering target specified by the destination rectangle dst . More... | |
void | drawTex (Tex &tex, const SrcRectWH src, const DstRectXY dst) |
Copy the part of texture tex specified by the source rectangle src to fill the part of the rendering target specified by the destination rectangle dst . More... | |
void | drawTex (Tex &tex, const SrcRectXY src, const DstRectWH dst) |
Copy the part of texture tex specified by the source rectangle src to fill the part of the rendering target specified by the destination rectangle dst . More... | |
void | drawTex (Tex &tex, const SrcRectXY src, const DstRectXY dst) |
Copy the part of texture tex specified by the source rectangle src to fill the part of the rendering target specified by the destination rectangle dst . More... | |
void | drawTex (Tex &tex, const Flip flip) |
Copy the entire texture tex to fill the entire rendering target, respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const double rot, const Flip flip=Flip()) |
Copy the entire texture tex to fill the entire rendering target, rotating it by rot radian around its center, respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const double rot, const geom::Pos rotCenter, const Flip flip=Flip()) |
Copy the entire texture tex to fill the entire rendering target, rotating it by rot radian around rotCenter , respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const SrcRectWH src, const Flip flip) |
Copy the part of texture tex specified by the source rectangle src to fill the entire rendering target, respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const SrcRectXY src, const Flip flip) |
Copy the part of texture tex specified by the source rectangle src to fill the entire rendering target, respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const SrcRectWH src, const double rot, const Flip flip=Flip()) |
Copy the part of texture tex specified by the source rectangle src to fill the entire rendering target, rotating it by rot radian around its center, respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const SrcRectXY src, const double rot, const Flip flip=Flip()) |
Copy the part of texture tex specified by the source rectangle src to fill the entire rendering target, rotating it by rot radian around its center, respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const SrcRectWH src, const double rot, const geom::Pos rotCenter, const Flip flip=Flip()) |
Copy the part of texture tex specified by the source rectangle src to fill the entire rendering target, rotating it by rot radian around rotCenter , respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const SrcRectXY src, const double rot, const geom::Pos rotCenter, const Flip flip=Flip()) |
Copy the part of texture tex specified by the source rectangle src to fill the entire rendering target, rotating it by rot radian around rotCenter , respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const DstRectWH dst, const Flip flip) |
Copy the entire texture tex to fill the part of the rendering target specified by the destination rectangle dst , respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const DstRectXY dst, const Flip flip) |
Copy the entire texture tex to fill the part of the rendering target specified by the destination rectangle dst , respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const DstRectWH dst, const double rot, const Flip flip=Flip()) |
Copy the entire texture tex to fill the part of the rendering target specified by the destination rectangle dst , rotating it by rot radian around its center, respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const DstRectXY dst, const double rot, const Flip flip=Flip()) |
Copy the entire texture tex to fill the part of the rendering target specified by the destination rectangle dst , rotating it by rot radian around its center, respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const DstRectWH dst, const double rot, const geom::Pos rotCenter, const Flip flip=Flip()) |
Copy the entire texture tex to fill the part of the rendering target specified by the destination rectangle dst , rotating it by rot radian around rotCenter , respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const DstRectXY dst, const double rot, const geom::Pos rotCenter, const Flip flip=Flip()) |
Copy the entire texture tex to fill the part of the rendering target specified by the destination rectangle dst , rotating it by rot radian around rotCenter , respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const SrcRectWH src, const DstRectWH dst, const Flip flip) |
Copy the part of texture tex specified by the source rectangle src to fill the part of the rendering target specified by the destination rectangle dst , respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const SrcRectWH src, const DstRectXY dst, const Flip flip) |
Copy the part of texture tex specified by the source rectangle src to fill the part of the rendering target specified by the destination rectangle dst , respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const SrcRectXY src, const DstRectWH dst, const Flip flip) |
Copy the part of texture tex specified by the source rectangle src to fill the part of the rendering target specified by the destination rectangle dst , respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const SrcRectXY src, const DstRectXY dst, const Flip flip) |
Copy the part of texture tex specified by the source rectangle src to fill the part of the rendering target specified by the destination rectangle dst , respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const SrcRectWH src, const DstRectWH dst, const double rot, const Flip flip=Flip()) |
Copy the part of texture tex specified by the source rectangle src to fill the part of the rendering target specified by the destination rectangle dst , rotating it by rot radian around its center, respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const SrcRectWH src, const DstRectXY dst, const double rot, const Flip flip=Flip()) |
Copy the part of texture tex specified by the source rectangle src to fill the part of the rendering target specified by the destination rectangle dst , rotating it by rot radian around its center, respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const SrcRectXY src, const DstRectWH dst, const double rot, const Flip flip=Flip()) |
Copy the part of texture tex specified by the source rectangle src to fill the part of the rendering target specified by the destination rectangle dst , rotating it by rot radian around its center, respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const SrcRectXY src, const DstRectXY dst, const double rot, const Flip flip=Flip()) |
Copy the part of texture tex specified by the source rectangle src to fill the part of the rendering target specified by the destination rectangle dst , rotating it by rot radian around its center, respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const SrcRectWH src, const DstRectWH dst, const double rot, const geom::Pos rotCenter, const Flip flip=Flip()) |
Copy the part of texture tex specified by the source rectangle src to fill the part of the rendering target specified by the destination rectangle dst , rotating it by rot radian around rotCenter , respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const SrcRectWH src, const DstRectXY dst, const double rot, const geom::Pos rotCenter, const Flip flip=Flip()) |
Copy the part of texture tex specified by the source rectangle src to fill the part of the rendering target specified by the destination rectangle dst , rotating it by rot radian around rotCenter , respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const SrcRectXY src, const DstRectWH dst, const double rot, const geom::Pos rotCenter, const Flip flip=Flip()) |
Copy the part of texture tex specified by the source rectangle src to fill the part of the rendering target specified by the destination rectangle dst , rotating it by rot radian around rotCenter , respecting the flipping configuration flip . More... | |
void | drawTex (Tex &tex, const SrcRectXY src, const DstRectXY dst, const double rot, const geom::Pos rotCenter, const Flip flip=Flip()) |
Copy the part of texture tex specified by the source rectangle src to fill the part of the rendering target specified by the destination rectangle dst , rotating it by rot radian around rotCenter , respecting the flipping configuration flip . More... | |
void | drawLine (const geom::Pos a, const geom::Pos b) |
Draw a line from point a to point b with the drawing color. More... | |
void | drawPoint (const geom::Pos p) |
Set the pixel at point p to the drawing color. More... | |
void | drawRect (const geom::RectWH r) |
Draw the outline of the width-height rect r with the drawing color. More... | |
void | drawRect (const geom::RectXY r) |
Draw the outline of the xy-rect rect r with the drawing color. More... | |
void | fillRect (const geom::RectWH r) |
Fill the width-height rect r with the drawing color. More... | |
void | fillRect (const geom::RectXY r) |
Fill the xy-rect rect r with the drawing color. More... | |
void | outlineScreen () |
Draw an outline around the rendering target with the drawing color. More... | |
void | fillScreen () |
Fill the rendering target with the drawing color. More... | |
std::optional< geom::RectWH > | clipRect () noexcept |
Get the clipping rectangle. std::nullopt is returned if the clipping rectangle has not been set. More... | |
void | setClipRect (const geom::RectWH r) |
Set the clipping rectangle to r . More... | |
void | setClipRect (const geom::RectXY r) |
Set the clipping rectangle to r . More... | |
void | disableClip () |
Unset the clipping rectangle. More... | |
bool | isClipOn () noexcept |
Query whether the clipping rectangle has been set. More... | |
std::optional< geom::Size > | logicalSize () noexcept |
Query the device-independent resolution. More... | |
void | setLogicalSize (const geom::Size s) |
Set the device-independent resolution to s . More... | |
geom::Size | getRealSize () |
Query the target resolution in device pixels. More... | |
RenScale | scale () noexcept |
Query the rendering scaling factors. More... | |
void | setScale (const RenScale s) |
Set the rendering scaling factors to s . More... | |
geom::RectWH | viewport () noexcept |
Query the subarea of the target used for drawing. More... | |
void | setViewport (const geom::RectWH r) |
Set the subarea of the target used for drawing to the rectangle r . More... | |
BlendMode | getBlendMode () |
Get the blending mode used for draw operations. Textures have their own separate belnding mode. More... | |
void | setBlendMode (const BlendMode m) |
Set the blending mode used for draw operations to m . Does not effect how textures are blended. More... | |
RGBA | color () |
Query the current drawing color. More... | |
void | setColor (const RGBA c) |
Set the drawing color to c . More... | |
Friends | |
void | swap (Ren &a, Ren &b) noexcept |
Exchange the underlying SDL_Renderer with that . | |
Renderer class that does not support rendering to texture. Use rolmodl::TexRen for rendering to texture support.
Wrapper around SDL_Renderer
.
The renderer managed by this class may actually support rendering to texture, based on the configuration with which it is created. However, it does not provide any methods to use this ability because no effort is made to ensure that the support was actually enabled.
rolmodl::Ren::Ren | ( | Win & | win, |
int | i, | ||
ren::Flags | flags | ||
) |
Initialize a renderer for window win
, using the i
th rendering driver, with configuration flags
.
rolmodl::sdlexception | SDL reported an error. |
rolmodl::Ren::Ren | ( | Win & | win, |
ren::Flags | flags | ||
) |
Initialize a renderer for window win
, with configuration flags
, using the first rendering driver that supports it.
rolmodl::sdlexception | SDL reported an error. |
rolmodl::Ren::Ren | ( | Win & | win, |
int | i | ||
) |
Initialize a renderer for window win
, using the i
th rendering driver, with the default configuration.
rolmodl::sdlexception | SDL reported an error. |
|
explicit |
Initialize a renderer for window win
, with the default configuration, using the first rendering driver that supports it.
rolmodl::sdlexception | SDL reported an error. |
|
noexcept |
Free the underlying SDL_Renderer
.
void rolmodl::Ren::clear | ( | ) |
Paint over the entire rendering target with the current color.
Definition at line 96 of file Ren.cpp.
References rolmodl::detail::throwOnErr(), and unsafeRaw().
|
noexcept |
Push the backbuffer to screen, displaying any changes made since the last present
. This operation invalidates the rendering buffer and it must be cleared with rolmodl::Ren::clear.
Definition at line 99 of file Ren.cpp.
References unsafeRaw().
void rolmodl::Ren::drawTex | ( | Tex & | tex | ) |
Copy the entire texture tex
to fill the entire rendering target.
Definition at line 104 of file Ren.cpp.
References rolmodl::detail::throwOnErr(), and unsafeRaw().
Referenced by drawTex().
Copy the part of texture tex
specified by the source rectangle src
to fill the entire rendering target.
Definition at line 108 of file Ren.cpp.
References rolmodl::geom::RectWH::sdl(), rolmodl::detail::throwOnErr(), and unsafeRaw().
Copy the part of texture tex
specified by the source rectangle src
to fill the entire rendering target.
Definition at line 112 of file Ren.cpp.
References drawTex(), and rolmodl::SrcRectXY::wh().
Copy the entire texture tex
to fill the part of the rendering target specified by the destination rectangle dst
.
Definition at line 116 of file Ren.cpp.
References rolmodl::geom::RectWH::sdl(), rolmodl::detail::throwOnErr(), and unsafeRaw().
Copy the entire texture tex
to fill the part of the rendering target specified by the destination rectangle dst
.
Definition at line 120 of file Ren.cpp.
References drawTex(), and rolmodl::DstRectXY::wh().
Copy the part of texture tex
specified by the source rectangle src
to fill the part of the rendering target specified by the destination rectangle dst
.
Definition at line 124 of file Ren.cpp.
References rolmodl::geom::RectWH::sdl(), rolmodl::detail::throwOnErr(), and unsafeRaw().
Copy the part of texture tex
specified by the source rectangle src
to fill the part of the rendering target specified by the destination rectangle dst
.
Definition at line 129 of file Ren.cpp.
References drawTex(), and rolmodl::DstRectXY::wh().
Copy the part of texture tex
specified by the source rectangle src
to fill the part of the rendering target specified by the destination rectangle dst
.
Definition at line 132 of file Ren.cpp.
References drawTex(), and rolmodl::SrcRectXY::wh().
Copy the part of texture tex
specified by the source rectangle src
to fill the part of the rendering target specified by the destination rectangle dst
.
Definition at line 135 of file Ren.cpp.
References drawTex(), rolmodl::SrcRectXY::wh(), and rolmodl::DstRectXY::wh().
Copy the entire texture tex
to fill the entire rendering target, rotating it by rot
radian around its center, respecting the flipping configuration flip
.
Definition at line 143 of file Ren.cpp.
References rolmodl::detail::throwOnErr(), rolmodl::Flip::toSDLEnum(), and unsafeRaw().
void rolmodl::Ren::drawTex | ( | Tex & | tex, |
const double | rot, | ||
const geom::Pos | rotCenter, | ||
const Flip | flip = Flip() |
||
) |
Copy the entire texture tex
to fill the entire rendering target, rotating it by rot
radian around rotCenter
, respecting the flipping configuration flip
.
Definition at line 146 of file Ren.cpp.
References rolmodl::detail::throwOnErr(), rolmodl::Flip::toSDLEnum(), and unsafeRaw().
Copy the part of texture tex
specified by the source rectangle src
to fill the entire rendering target, respecting the flipping configuration flip
.
Definition at line 154 of file Ren.cpp.
References drawTex(), and rolmodl::SrcRectXY::wh().
void rolmodl::Ren::drawTex | ( | Tex & | tex, |
const SrcRectWH | src, | ||
const double | rot, | ||
const Flip | flip = Flip() |
||
) |
Copy the part of texture tex
specified by the source rectangle src
to fill the entire rendering target, rotating it by rot
radian around its center, respecting the flipping configuration flip
.
Definition at line 157 of file Ren.cpp.
References rolmodl::geom::RectWH::sdl(), rolmodl::detail::throwOnErr(), rolmodl::Flip::toSDLEnum(), and unsafeRaw().
void rolmodl::Ren::drawTex | ( | Tex & | tex, |
const SrcRectXY | src, | ||
const double | rot, | ||
const Flip | flip = Flip() |
||
) |
Copy the part of texture tex
specified by the source rectangle src
to fill the entire rendering target, rotating it by rot
radian around its center, respecting the flipping configuration flip
.
Definition at line 161 of file Ren.cpp.
References drawTex(), and rolmodl::SrcRectXY::wh().
void rolmodl::Ren::drawTex | ( | Tex & | tex, |
const SrcRectWH | src, | ||
const double | rot, | ||
const geom::Pos | rotCenter, | ||
const Flip | flip = Flip() |
||
) |
Copy the part of texture tex
specified by the source rectangle src
to fill the entire rendering target, rotating it by rot
radian around rotCenter
, respecting the flipping configuration flip
.
Definition at line 164 of file Ren.cpp.
References rolmodl::geom::RectWH::sdl(), rolmodl::detail::throwOnErr(), rolmodl::Flip::toSDLEnum(), and unsafeRaw().
void rolmodl::Ren::drawTex | ( | Tex & | tex, |
const SrcRectXY | src, | ||
const double | rot, | ||
const geom::Pos | rotCenter, | ||
const Flip | flip = Flip() |
||
) |
Copy the part of texture tex
specified by the source rectangle src
to fill the entire rendering target, rotating it by rot
radian around rotCenter
, respecting the flipping configuration flip
.
Definition at line 169 of file Ren.cpp.
References drawTex(), and rolmodl::SrcRectXY::wh().
Copy the entire texture tex
to fill the part of the rendering target specified by the destination rectangle dst
, respecting the flipping configuration flip
.
Definition at line 176 of file Ren.cpp.
References drawTex(), and rolmodl::DstRectXY::wh().
void rolmodl::Ren::drawTex | ( | Tex & | tex, |
const DstRectWH | dst, | ||
const double | rot, | ||
const Flip | flip = Flip() |
||
) |
Copy the entire texture tex
to fill the part of the rendering target specified by the destination rectangle dst
, rotating it by rot
radian around its center, respecting the flipping configuration flip
.
Definition at line 179 of file Ren.cpp.
References rolmodl::geom::RectWH::sdl(), rolmodl::detail::throwOnErr(), rolmodl::Flip::toSDLEnum(), and unsafeRaw().
void rolmodl::Ren::drawTex | ( | Tex & | tex, |
const DstRectXY | dst, | ||
const double | rot, | ||
const Flip | flip = Flip() |
||
) |
Copy the entire texture tex
to fill the part of the rendering target specified by the destination rectangle dst
, rotating it by rot
radian around its center, respecting the flipping configuration flip
.
Definition at line 183 of file Ren.cpp.
References drawTex(), and rolmodl::DstRectXY::wh().
void rolmodl::Ren::drawTex | ( | Tex & | tex, |
const DstRectWH | dst, | ||
const double | rot, | ||
const geom::Pos | rotCenter, | ||
const Flip | flip = Flip() |
||
) |
Copy the entire texture tex
to fill the part of the rendering target specified by the destination rectangle dst
, rotating it by rot
radian around rotCenter
, respecting the flipping configuration flip
.
Definition at line 186 of file Ren.cpp.
References rolmodl::geom::RectWH::sdl(), rolmodl::detail::throwOnErr(), rolmodl::Flip::toSDLEnum(), and unsafeRaw().
void rolmodl::Ren::drawTex | ( | Tex & | tex, |
const DstRectXY | dst, | ||
const double | rot, | ||
const geom::Pos | rotCenter, | ||
const Flip | flip = Flip() |
||
) |
Copy the entire texture tex
to fill the part of the rendering target specified by the destination rectangle dst
, rotating it by rot
radian around rotCenter
, respecting the flipping configuration flip
.
Definition at line 191 of file Ren.cpp.
References drawTex(), and rolmodl::DstRectXY::wh().
Copy the part of texture tex
specified by the source rectangle src
to fill the part of the rendering target specified by the destination rectangle dst
, respecting the flipping configuration flip
.
Definition at line 198 of file Ren.cpp.
References drawTex(), and rolmodl::DstRectXY::wh().
Copy the part of texture tex
specified by the source rectangle src
to fill the part of the rendering target specified by the destination rectangle dst
, respecting the flipping configuration flip
.
Definition at line 201 of file Ren.cpp.
References drawTex(), and rolmodl::SrcRectXY::wh().
Copy the part of texture tex
specified by the source rectangle src
to fill the part of the rendering target specified by the destination rectangle dst
, respecting the flipping configuration flip
.
Definition at line 204 of file Ren.cpp.
References drawTex(), rolmodl::SrcRectXY::wh(), and rolmodl::DstRectXY::wh().
void rolmodl::Ren::drawTex | ( | Tex & | tex, |
const SrcRectWH | src, | ||
const DstRectWH | dst, | ||
const double | rot, | ||
const Flip | flip = Flip() |
||
) |
Copy the part of texture tex
specified by the source rectangle src
to fill the part of the rendering target specified by the destination rectangle dst
, rotating it by rot
radian around its center, respecting the flipping configuration flip
.
Definition at line 207 of file Ren.cpp.
References rolmodl::geom::RectWH::sdl(), rolmodl::detail::throwOnErr(), rolmodl::Flip::toSDLEnum(), and unsafeRaw().
void rolmodl::Ren::drawTex | ( | Tex & | tex, |
const SrcRectWH | src, | ||
const DstRectXY | dst, | ||
const double | rot, | ||
const Flip | flip = Flip() |
||
) |
Copy the part of texture tex
specified by the source rectangle src
to fill the part of the rendering target specified by the destination rectangle dst
, rotating it by rot
radian around its center, respecting the flipping configuration flip
.
Definition at line 212 of file Ren.cpp.
References drawTex(), and rolmodl::DstRectXY::wh().
void rolmodl::Ren::drawTex | ( | Tex & | tex, |
const SrcRectXY | src, | ||
const DstRectWH | dst, | ||
const double | rot, | ||
const Flip | flip = Flip() |
||
) |
Copy the part of texture tex
specified by the source rectangle src
to fill the part of the rendering target specified by the destination rectangle dst
, rotating it by rot
radian around its center, respecting the flipping configuration flip
.
Definition at line 215 of file Ren.cpp.
References drawTex(), and rolmodl::SrcRectXY::wh().
void rolmodl::Ren::drawTex | ( | Tex & | tex, |
const SrcRectXY | src, | ||
const DstRectXY | dst, | ||
const double | rot, | ||
const Flip | flip = Flip() |
||
) |
Copy the part of texture tex
specified by the source rectangle src
to fill the part of the rendering target specified by the destination rectangle dst
, rotating it by rot
radian around its center, respecting the flipping configuration flip
.
Definition at line 218 of file Ren.cpp.
References drawTex(), rolmodl::SrcRectXY::wh(), and rolmodl::DstRectXY::wh().
void rolmodl::Ren::drawTex | ( | Tex & | tex, |
const SrcRectWH | src, | ||
const DstRectWH | dst, | ||
const double | rot, | ||
const geom::Pos | rotCenter, | ||
const Flip | flip = Flip() |
||
) |
Copy the part of texture tex
specified by the source rectangle src
to fill the part of the rendering target specified by the destination rectangle dst
, rotating it by rot
radian around rotCenter
, respecting the flipping configuration flip
.
Definition at line 221 of file Ren.cpp.
References rolmodl::geom::RectWH::sdl(), rolmodl::detail::throwOnErr(), rolmodl::Flip::toSDLEnum(), and unsafeRaw().
void rolmodl::Ren::drawTex | ( | Tex & | tex, |
const SrcRectWH | src, | ||
const DstRectXY | dst, | ||
const double | rot, | ||
const geom::Pos | rotCenter, | ||
const Flip | flip = Flip() |
||
) |
Copy the part of texture tex
specified by the source rectangle src
to fill the part of the rendering target specified by the destination rectangle dst
, rotating it by rot
radian around rotCenter
, respecting the flipping configuration flip
.
Definition at line 227 of file Ren.cpp.
References drawTex(), and rolmodl::DstRectXY::wh().
void rolmodl::Ren::drawTex | ( | Tex & | tex, |
const SrcRectXY | src, | ||
const DstRectWH | dst, | ||
const double | rot, | ||
const geom::Pos | rotCenter, | ||
const Flip | flip = Flip() |
||
) |
Copy the part of texture tex
specified by the source rectangle src
to fill the part of the rendering target specified by the destination rectangle dst
, rotating it by rot
radian around rotCenter
, respecting the flipping configuration flip
.
Definition at line 230 of file Ren.cpp.
References drawTex(), and rolmodl::SrcRectXY::wh().
void rolmodl::Ren::drawTex | ( | Tex & | tex, |
const SrcRectXY | src, | ||
const DstRectXY | dst, | ||
const double | rot, | ||
const geom::Pos | rotCenter, | ||
const Flip | flip = Flip() |
||
) |
Copy the part of texture tex
specified by the source rectangle src
to fill the part of the rendering target specified by the destination rectangle dst
, rotating it by rot
radian around rotCenter
, respecting the flipping configuration flip
.
Definition at line 233 of file Ren.cpp.
References drawTex(), rolmodl::SrcRectXY::wh(), and rolmodl::DstRectXY::wh().
Draw a line from point a
to point b
with the drawing color.
Definition at line 237 of file Ren.cpp.
References rolmodl::detail::throwOnErr(), and unsafeRaw().
void rolmodl::Ren::drawPoint | ( | const geom::Pos | p | ) |
Set the pixel at point p
to the drawing color.
Definition at line 242 of file Ren.cpp.
References rolmodl::detail::throwOnErr(), and unsafeRaw().
void rolmodl::Ren::drawRect | ( | const geom::RectWH | r | ) |
Draw the outline of the width-height rect r
with the drawing color.
Definition at line 247 of file Ren.cpp.
References rolmodl::detail::throwOnErr(), and unsafeRaw().
Referenced by drawRect().
void rolmodl::Ren::drawRect | ( | const geom::RectXY | r | ) |
Draw the outline of the xy-rect rect r
with the drawing color.
Definition at line 251 of file Ren.cpp.
References drawRect().
void rolmodl::Ren::fillRect | ( | const geom::RectWH | r | ) |
Fill the width-height rect r
with the drawing color.
Definition at line 256 of file Ren.cpp.
References rolmodl::detail::throwOnErr(), and unsafeRaw().
Referenced by fillRect().
void rolmodl::Ren::fillRect | ( | const geom::RectXY | r | ) |
Fill the xy-rect rect r
with the drawing color.
Definition at line 260 of file Ren.cpp.
References fillRect().
void rolmodl::Ren::outlineScreen | ( | ) |
Draw an outline around the rendering target with the drawing color.
Definition at line 265 of file Ren.cpp.
References rolmodl::detail::throwOnErr(), and unsafeRaw().
void rolmodl::Ren::fillScreen | ( | ) |
Fill the rendering target with the drawing color.
Rename to fillTarget
How is this functionally different from clear()?
Definition at line 268 of file Ren.cpp.
References rolmodl::detail::throwOnErr(), and unsafeRaw().
|
noexcept |
Get the clipping rectangle. std::nullopt is returned if the clipping rectangle has not been set.
Definition at line 272 of file Ren.cpp.
References std::nullopt, and unsafeRaw().
void rolmodl::Ren::setClipRect | ( | const geom::RectWH | r | ) |
Set the clipping rectangle to r
.
Definition at line 279 of file Ren.cpp.
References rolmodl::detail::throwOnErr(), and unsafeRaw().
Referenced by setClipRect().
void rolmodl::Ren::setClipRect | ( | const geom::RectXY | r | ) |
void rolmodl::Ren::disableClip | ( | ) |
Unset the clipping rectangle.
Definition at line 286 of file Ren.cpp.
References rolmodl::detail::throwOnErr(), and unsafeRaw().
|
noexcept |
Query whether the clipping rectangle has been set.
What is the difference between clipping being disabled and the rectangle not being set yet.
not clear if false is an error state because the docs suggest "call `SDL_GetError()` for more information." if SDL_FALSE
is returned.
Definition at line 289 of file Ren.cpp.
References unsafeRaw().
|
noexcept |
Query the device-independent resolution.
Definition at line 293 of file Ren.cpp.
References std::nullopt, and unsafeRaw().
void rolmodl::Ren::setLogicalSize | ( | const geom::Size | s | ) |
Set the device-independent resolution to s
.
Definition at line 300 of file Ren.cpp.
References rolmodl::detail::throwOnErr(), and unsafeRaw().
geom::Size rolmodl::Ren::getRealSize | ( | ) |
Query the target resolution in device pixels.
Definition at line 304 of file Ren.cpp.
References rolmodl::detail::throwOnErr(), and unsafeRaw().
|
noexcept |
Query the rendering scaling factors.
Definition at line 310 of file Ren.cpp.
References unsafeRaw().
void rolmodl::Ren::setScale | ( | const RenScale | s | ) |
Set the rendering scaling factors to s
.
Definition at line 315 of file Ren.cpp.
References rolmodl::detail::throwOnErr(), and unsafeRaw().
|
noexcept |
Query the subarea of the target used for drawing.
How does this work? Does it scale? Clip?
Explain how to use this, including with resolution-independent rendering.
Definition at line 319 of file Ren.cpp.
References unsafeRaw().
void rolmodl::Ren::setViewport | ( | const geom::RectWH | r | ) |
Set the subarea of the target used for drawing to the rectangle r
.
Definition at line 324 of file Ren.cpp.
References rolmodl::detail::throwOnErr(), and unsafeRaw().
BlendMode rolmodl::Ren::getBlendMode | ( | ) |
Get the blending mode used for draw
operations. Textures have their own separate belnding mode.
Definition at line 329 of file Ren.cpp.
References rolmodl::blendMode::unsafe::fromSDLEnum(), rolmodl::detail::throwOnErr(), and unsafeRaw().
void rolmodl::Ren::setBlendMode | ( | const BlendMode | m | ) |
Set the blending mode used for draw
operations to m
. Does not effect how textures are blended.
Definition at line 334 of file Ren.cpp.
References rolmodl::detail::throwOnErr(), rolmodl::blendMode::unsafe::toSDLEnum(), and unsafeRaw().
RGBA rolmodl::Ren::color | ( | ) |
Query the current drawing color.
Definition at line 339 of file Ren.cpp.
References rolmodl::detail::throwOnErr(), and unsafeRaw().
void rolmodl::Ren::setColor | ( | const RGBA | c | ) |
Set the drawing color to c
.
Definition at line 345 of file Ren.cpp.
References rolmodl::detail::throwOnErr(), and unsafeRaw().