rolmodl
C++ API for the Simple Directmedia Library 2 (SDL2)
Public Member Functions | Friends | List of all members
rolmodl::Ren Class Reference

Renderer class that does not support rendering to texture. Use rolmodl::TexRen for rendering to texture support. More...

#include <Ren.hpp>

Inheritance diagram for rolmodl::Ren:
rolmodl::TexRen

Public Member Functions

 Ren (Win &win, int i, ren::Flags flags)
 Initialize a renderer for window win, using the ith 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 ith 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.
 
Renoperator= (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.
 
Renoperator= (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::RectWHclipRect () 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::SizelogicalSize () 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.
 

Detailed Description

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.

See also
https://wiki.libsdl.org/SDL_Renderer

Definition at line 305 of file Ren.hpp.

Constructor & Destructor Documentation

◆ Ren() [1/4]

rolmodl::Ren::Ren ( Win win,
int  i,
ren::Flags  flags 
)

Initialize a renderer for window win, using the ith rendering driver, with configuration flags.

Exceptions
rolmodl::sdlexceptionSDL reported an error.
See also
https://wiki.libsdl.org/SDL_CreateRenderer

Definition at line 44 of file Ren.cpp.

◆ Ren() [2/4]

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.

Exceptions
rolmodl::sdlexceptionSDL reported an error.
See also
https://wiki.libsdl.org/SDL_CreateRenderer

Definition at line 50 of file Ren.cpp.

◆ Ren() [3/4]

rolmodl::Ren::Ren ( Win win,
int  i 
)

Initialize a renderer for window win, using the ith rendering driver, with the default configuration.

Exceptions
rolmodl::sdlexceptionSDL reported an error.
See also
https://wiki.libsdl.org/SDL_CreateRenderer

Definition at line 52 of file Ren.cpp.

◆ Ren() [4/4]

rolmodl::Ren::Ren ( Win win)
explicit

Initialize a renderer for window win, with the default configuration, using the first rendering driver that supports it.

Exceptions
rolmodl::sdlexceptionSDL reported an error.
See also
https://wiki.libsdl.org/SDL_CreateRenderer

Definition at line 54 of file Ren.cpp.

◆ ~Ren()

rolmodl::Ren::~Ren ( )
noexcept

Free the underlying SDL_Renderer.

See also
https://wiki.libsdl.org/SDL_DestroyRenderer

Definition at line 57 of file Ren.cpp.

Member Function Documentation

◆ clear()

void rolmodl::Ren::clear ( )

Paint over the entire rendering target with the current color.

See also
https://wiki.libsdl.org/SDL_RenderClear

Definition at line 96 of file Ren.cpp.

References rolmodl::detail::throwOnErr(), and unsafeRaw().

◆ present()

void rolmodl::Ren::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.

Todo:
How does this work with non-window rendering targets?
See also
https://wiki.libsdl.org/SDL_RenderPresent

Definition at line 99 of file Ren.cpp.

References unsafeRaw().

◆ drawTex() [1/36]

void rolmodl::Ren::drawTex ( Tex tex)

Copy the entire texture tex to fill the entire rendering target.

See also
https://wiki.libsdl.org/SDL_RenderCopy

Definition at line 104 of file Ren.cpp.

References rolmodl::detail::throwOnErr(), and unsafeRaw().

Referenced by drawTex().

◆ drawTex() [2/36]

void rolmodl::Ren::drawTex ( Tex tex,
const SrcRectWH  src 
)

Copy the part of texture tex specified by the source rectangle src to fill the entire rendering target.

See also
https://wiki.libsdl.org/SDL_RenderCopy

Definition at line 108 of file Ren.cpp.

References rolmodl::geom::RectWH::sdl(), rolmodl::detail::throwOnErr(), and unsafeRaw().

◆ drawTex() [3/36]

void rolmodl::Ren::drawTex ( Tex tex,
const SrcRectXY  src 
)

Copy the part of texture tex specified by the source rectangle src to fill the entire rendering target.

See also
https://wiki.libsdl.org/SDL_RenderCopy

Definition at line 112 of file Ren.cpp.

References drawTex(), and rolmodl::SrcRectXY::wh().

◆ drawTex() [4/36]

void rolmodl::Ren::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.

See also
https://wiki.libsdl.org/SDL_RenderCopy

Definition at line 116 of file Ren.cpp.

References rolmodl::geom::RectWH::sdl(), rolmodl::detail::throwOnErr(), and unsafeRaw().

◆ drawTex() [5/36]

void rolmodl::Ren::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.

See also
https://wiki.libsdl.org/SDL_RenderCopy

Definition at line 120 of file Ren.cpp.

References drawTex(), and rolmodl::DstRectXY::wh().

◆ drawTex() [6/36]

void rolmodl::Ren::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.

See also
https://wiki.libsdl.org/SDL_RenderCopy

Definition at line 124 of file Ren.cpp.

References rolmodl::geom::RectWH::sdl(), rolmodl::detail::throwOnErr(), and unsafeRaw().

◆ drawTex() [7/36]

void rolmodl::Ren::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.

See also
https://wiki.libsdl.org/SDL_RenderCopy

Definition at line 129 of file Ren.cpp.

References drawTex(), and rolmodl::DstRectXY::wh().

◆ drawTex() [8/36]

void rolmodl::Ren::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.

See also
https://wiki.libsdl.org/SDL_RenderCopy

Definition at line 132 of file Ren.cpp.

References drawTex(), and rolmodl::SrcRectXY::wh().

◆ drawTex() [9/36]

void rolmodl::Ren::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.

See also
https://wiki.libsdl.org/SDL_RenderCopy

Definition at line 135 of file Ren.cpp.

References drawTex(), rolmodl::SrcRectXY::wh(), and rolmodl::DstRectXY::wh().

◆ drawTex() [10/36]

void rolmodl::Ren::drawTex ( Tex tex,
const Flip  flip 
)

Copy the entire texture tex to fill the entire rendering target, respecting the flipping configuration flip.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 140 of file Ren.cpp.

References drawTex().

◆ drawTex() [11/36]

void rolmodl::Ren::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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 143 of file Ren.cpp.

References rolmodl::detail::throwOnErr(), rolmodl::Flip::toSDLEnum(), and unsafeRaw().

◆ drawTex() [12/36]

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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 146 of file Ren.cpp.

References rolmodl::detail::throwOnErr(), rolmodl::Flip::toSDLEnum(), and unsafeRaw().

◆ drawTex() [13/36]

void rolmodl::Ren::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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 151 of file Ren.cpp.

References drawTex().

◆ drawTex() [14/36]

void rolmodl::Ren::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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 154 of file Ren.cpp.

References drawTex(), and rolmodl::SrcRectXY::wh().

◆ drawTex() [15/36]

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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 157 of file Ren.cpp.

References rolmodl::geom::RectWH::sdl(), rolmodl::detail::throwOnErr(), rolmodl::Flip::toSDLEnum(), and unsafeRaw().

◆ drawTex() [16/36]

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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 161 of file Ren.cpp.

References drawTex(), and rolmodl::SrcRectXY::wh().

◆ drawTex() [17/36]

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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 164 of file Ren.cpp.

References rolmodl::geom::RectWH::sdl(), rolmodl::detail::throwOnErr(), rolmodl::Flip::toSDLEnum(), and unsafeRaw().

◆ drawTex() [18/36]

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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 169 of file Ren.cpp.

References drawTex(), and rolmodl::SrcRectXY::wh().

◆ drawTex() [19/36]

void rolmodl::Ren::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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 173 of file Ren.cpp.

References drawTex().

◆ drawTex() [20/36]

void rolmodl::Ren::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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 176 of file Ren.cpp.

References drawTex(), and rolmodl::DstRectXY::wh().

◆ drawTex() [21/36]

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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 179 of file Ren.cpp.

References rolmodl::geom::RectWH::sdl(), rolmodl::detail::throwOnErr(), rolmodl::Flip::toSDLEnum(), and unsafeRaw().

◆ drawTex() [22/36]

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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 183 of file Ren.cpp.

References drawTex(), and rolmodl::DstRectXY::wh().

◆ drawTex() [23/36]

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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 186 of file Ren.cpp.

References rolmodl::geom::RectWH::sdl(), rolmodl::detail::throwOnErr(), rolmodl::Flip::toSDLEnum(), and unsafeRaw().

◆ drawTex() [24/36]

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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 191 of file Ren.cpp.

References drawTex(), and rolmodl::DstRectXY::wh().

◆ drawTex() [25/36]

void rolmodl::Ren::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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 195 of file Ren.cpp.

References drawTex().

◆ drawTex() [26/36]

void rolmodl::Ren::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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 198 of file Ren.cpp.

References drawTex(), and rolmodl::DstRectXY::wh().

◆ drawTex() [27/36]

void rolmodl::Ren::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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 201 of file Ren.cpp.

References drawTex(), and rolmodl::SrcRectXY::wh().

◆ drawTex() [28/36]

void rolmodl::Ren::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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 204 of file Ren.cpp.

References drawTex(), rolmodl::SrcRectXY::wh(), and rolmodl::DstRectXY::wh().

◆ drawTex() [29/36]

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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 207 of file Ren.cpp.

References rolmodl::geom::RectWH::sdl(), rolmodl::detail::throwOnErr(), rolmodl::Flip::toSDLEnum(), and unsafeRaw().

◆ drawTex() [30/36]

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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 212 of file Ren.cpp.

References drawTex(), and rolmodl::DstRectXY::wh().

◆ drawTex() [31/36]

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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 215 of file Ren.cpp.

References drawTex(), and rolmodl::SrcRectXY::wh().

◆ drawTex() [32/36]

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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 218 of file Ren.cpp.

References drawTex(), rolmodl::SrcRectXY::wh(), and rolmodl::DstRectXY::wh().

◆ drawTex() [33/36]

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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 221 of file Ren.cpp.

References rolmodl::geom::RectWH::sdl(), rolmodl::detail::throwOnErr(), rolmodl::Flip::toSDLEnum(), and unsafeRaw().

◆ drawTex() [34/36]

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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 227 of file Ren.cpp.

References drawTex(), and rolmodl::DstRectXY::wh().

◆ drawTex() [35/36]

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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 230 of file Ren.cpp.

References drawTex(), and rolmodl::SrcRectXY::wh().

◆ drawTex() [36/36]

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.

See also
https://wiki.libsdl.org/SDL_RenderCopyEx

Definition at line 233 of file Ren.cpp.

References drawTex(), rolmodl::SrcRectXY::wh(), and rolmodl::DstRectXY::wh().

◆ drawLine()

void rolmodl::Ren::drawLine ( const geom::Pos  a,
const geom::Pos  b 
)

Draw a line from point a to point b with the drawing color.

Todo:
needs ContigousIterators, for which no check can be done at compile-time also needs SDL_Point structs, or byte-equivalent reinterpret_cast geom::Point?
See also
https://wiki.libsdl.org/SDL_RenderDrawLine

Definition at line 237 of file Ren.cpp.

References rolmodl::detail::throwOnErr(), and unsafeRaw().

◆ drawPoint()

void rolmodl::Ren::drawPoint ( const geom::Pos  p)

Set the pixel at point p to the drawing color.

See also
https://wiki.libsdl.org/SDL_RenderDrawPoint

Definition at line 242 of file Ren.cpp.

References rolmodl::detail::throwOnErr(), and unsafeRaw().

◆ drawRect() [1/2]

void rolmodl::Ren::drawRect ( const geom::RectWH  r)

Draw the outline of the width-height rect r with the drawing color.

See also
https://wiki.libsdl.org/SDL_RenderDrawRect

Definition at line 247 of file Ren.cpp.

References rolmodl::detail::throwOnErr(), and unsafeRaw().

Referenced by drawRect().

◆ drawRect() [2/2]

void rolmodl::Ren::drawRect ( const geom::RectXY  r)

Draw the outline of the xy-rect rect r with the drawing color.

See also
https://wiki.libsdl.org/SDL_RenderDrawRect

Definition at line 251 of file Ren.cpp.

References drawRect().

◆ fillRect() [1/2]

void rolmodl::Ren::fillRect ( const geom::RectWH  r)

Fill the width-height rect r with the drawing color.

See also
https://wiki.libsdl.org/SDL_RenderFillRect

Definition at line 256 of file Ren.cpp.

References rolmodl::detail::throwOnErr(), and unsafeRaw().

Referenced by fillRect().

◆ fillRect() [2/2]

void rolmodl::Ren::fillRect ( const geom::RectXY  r)

Fill the xy-rect rect r with the drawing color.

See also
https://wiki.libsdl.org/SDL_RenderFillRect

Definition at line 260 of file Ren.cpp.

References fillRect().

◆ outlineScreen()

void rolmodl::Ren::outlineScreen ( )

Draw an outline around the rendering target with the drawing color.

Todo:
Rename to outlineTarget
See also
https://wiki.libsdl.org/SDL_RenderDrawRect

Definition at line 265 of file Ren.cpp.

References rolmodl::detail::throwOnErr(), and unsafeRaw().

◆ fillScreen()

void rolmodl::Ren::fillScreen ( )

Fill the rendering target with the drawing color.

Todo:

Rename to fillTarget

How is this functionally different from clear()?

See also
https://wiki.libsdl.org/SDL_RenderFillRect

Definition at line 268 of file Ren.cpp.

References rolmodl::detail::throwOnErr(), and unsafeRaw().

◆ clipRect()

std::optional< geom::RectWH > rolmodl::Ren::clipRect ( )
noexcept

Get the clipping rectangle. std::nullopt is returned if the clipping rectangle has not been set.

Todo:
What is the difference between clipping being disabled and the rectangle not being set yet.
See also
https://wiki.libsdl.org/SDL_RenderGetClipRect

Definition at line 272 of file Ren.cpp.

References std::nullopt, and unsafeRaw().

◆ setClipRect() [1/2]

void rolmodl::Ren::setClipRect ( const geom::RectWH  r)

Set the clipping rectangle to r.

See also
https://wiki.libsdl.org/SDL_RenderSetClipRect

Definition at line 279 of file Ren.cpp.

References rolmodl::detail::throwOnErr(), and unsafeRaw().

Referenced by setClipRect().

◆ setClipRect() [2/2]

void rolmodl::Ren::setClipRect ( const geom::RectXY  r)

Set the clipping rectangle to r.

See also
https://wiki.libsdl.org/SDL_RenderSetClipRect

Definition at line 283 of file Ren.cpp.

References setClipRect().

◆ disableClip()

void rolmodl::Ren::disableClip ( )

Unset the clipping rectangle.

See also
https://wiki.libsdl.org/SDL_RenderSetClipRect

Definition at line 286 of file Ren.cpp.

References rolmodl::detail::throwOnErr(), and unsafeRaw().

◆ isClipOn()

bool rolmodl::Ren::isClipOn ( )
noexcept

Query whether the clipping rectangle has been set.

Todo:

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.

See also
https://wiki.libsdl.org/SDL_RenderIsClipEnabled

Definition at line 289 of file Ren.cpp.

References unsafeRaw().

◆ logicalSize()

std::optional< geom::Size > rolmodl::Ren::logicalSize ( )
noexcept

Query the device-independent resolution.

Todo:
Explain how to use this with resolution-independent rendering.
See also
https://wiki.libsdl.org/SDL_RenderGetLogicalSize

Definition at line 293 of file Ren.cpp.

References std::nullopt, and unsafeRaw().

◆ setLogicalSize()

void rolmodl::Ren::setLogicalSize ( const geom::Size  s)

Set the device-independent resolution to s.

Todo:
Explain how to use this with resolution-independent rendering.
See also
https://wiki.libsdl.org/SDL_RenderGetLogicalSize

Definition at line 300 of file Ren.cpp.

References rolmodl::detail::throwOnErr(), and unsafeRaw().

◆ getRealSize()

geom::Size rolmodl::Ren::getRealSize ( )

Query the target resolution in device pixels.

Todo:
Explain how to use this with resolution-independent rendering.
See also
https://wiki.libsdl.org/SDL_GetRendererOutputSize

Definition at line 304 of file Ren.cpp.

References rolmodl::detail::throwOnErr(), and unsafeRaw().

◆ scale()

RenScale rolmodl::Ren::scale ( )
noexcept

Query the rendering scaling factors.

Todo:
Explain how to use this, including with resolution-independent rendering.
See also
https://wiki.libsdl.org/SDL_RenderGetScale

Definition at line 310 of file Ren.cpp.

References unsafeRaw().

◆ setScale()

void rolmodl::Ren::setScale ( const RenScale  s)

Set the rendering scaling factors to s.

Todo:
Explain how to use this, including with resolution-independent rendering.
See also
https://wiki.libsdl.org/SDL_RenderSetScale

Definition at line 315 of file Ren.cpp.

References rolmodl::detail::throwOnErr(), and unsafeRaw().

◆ viewport()

geom::RectWH rolmodl::Ren::viewport ( )
noexcept

Query the subarea of the target used for drawing.

Todo:

How does this work? Does it scale? Clip?

Explain how to use this, including with resolution-independent rendering.

See also
https://wiki.libsdl.org/SDL_RenderGetViewport

Definition at line 319 of file Ren.cpp.

References unsafeRaw().

◆ setViewport()

void rolmodl::Ren::setViewport ( const geom::RectWH  r)

Set the subarea of the target used for drawing to the rectangle r.

See also
https://wiki.libsdl.org/SDL_RenderSetViewport

Definition at line 324 of file Ren.cpp.

References rolmodl::detail::throwOnErr(), and unsafeRaw().

◆ getBlendMode()

BlendMode rolmodl::Ren::getBlendMode ( )

Get the blending mode used for draw operations. Textures have their own separate belnding mode.

Todo:
Verify that textures indeed ignore this.
See also
https://wiki.libsdl.org/SDL_SetRenderDrawBlendMode

Definition at line 329 of file Ren.cpp.

References rolmodl::blendMode::unsafe::fromSDLEnum(), rolmodl::detail::throwOnErr(), and unsafeRaw().

◆ setBlendMode()

void rolmodl::Ren::setBlendMode ( const BlendMode  m)

Set the blending mode used for draw operations to m. Does not effect how textures are blended.

Todo:
Verify that textures indeed ignore this.
See also
https://wiki.libsdl.org/SDL_GetRenderDrawBlendMode

Definition at line 334 of file Ren.cpp.

References rolmodl::detail::throwOnErr(), rolmodl::blendMode::unsafe::toSDLEnum(), and unsafeRaw().

◆ color()

RGBA rolmodl::Ren::color ( )

Query the current drawing color.

See also
https://wiki.libsdl.org/SDL_GetRenderDrawColor

Definition at line 339 of file Ren.cpp.

References rolmodl::detail::throwOnErr(), and unsafeRaw().

◆ setColor()

void rolmodl::Ren::setColor ( const RGBA  c)

Set the drawing color to c.

See also
https://wiki.libsdl.org/SDL_SetRenderDrawColor

Definition at line 345 of file Ren.cpp.

References rolmodl::detail::throwOnErr(), and unsafeRaw().


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