wxGraphicsRenderer(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

πŸ’– wxGraphicsRenderer πŸ’–

okay bestie, gather round, because we're talking about wxGraphicsRenderer β€” the Erlang module definition for the renderer that's basically the glow-up engine of wxWidgets. this is the instance that corresponds to the rendering engine used. that's it. that's the whole vibe. ✨


🌸 NAME 🌸

wxGraphicsRenderer β€” a wxGraphicsRenderer is the instance corresponding to the rendering engine used. no cap. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

ok so here's the tea: there may be multiple instances on a system, if there are different rendering engines present. but β€” and this is the important part β€” there is always only one instance per engine. every single one. no duplicates, no clones, no drama. πŸ‘‘

and the way you find that one instance? all objects created by it (wxGraphicsContext, wxGraphicsPath etc.) point right back to it, and you can grab it through their wxGraphicsObject:getRenderer/1 method. so if you ever wanna create an additional instance of a path or whatever, you hit up wxGraphicsObject:getRenderer/1 and then use the appropriate CreateXXX() function of that renderer. it's giving "ask your bestie for the connect." 🫢

wxWidgets docs: wxGraphicsRenderer


✨ DATA TYPES ✨

  • wxGraphicsRenderer() :: wx:wx_object().

πŸ’… FUNCTIONS πŸ’…

🌈 createBrush(This, Brush) -> wxGraphicsBrush:wxGraphicsBrush()

createBrush(This, Brush) -> wxGraphicsBrush:wxGraphicsBrush()
    when
        This :: wxGraphicsRenderer(),
        Brush :: wxBrush:wxBrush().

creates a native brush from a wxBrush. that's the whole task, and it ate. πŸ”₯


🌈 createContext(This, WindowDC) -> wxGraphicsContext:wxGraphicsContext()

createContext(This, WindowDC) ->
                  wxGraphicsContext:wxGraphicsContext()
                  when
                      This :: wxGraphicsRenderer(),
                      WindowDC ::
                          wxWindowDC:wxWindowDC() |
                          wxWindow:wxWindow() |
                          wxMemoryDC:wxMemoryDC().

creates a wxGraphicsContext from a wxWindowDC. iconic behavior honestly. ⭐


🌈 createFont(This, SizeInPixels, Facename) -> wxGraphicsFont:wxGraphicsFont()

createFont(This, SizeInPixels, Facename) ->
               wxGraphicsFont:wxGraphicsFont()
               when
                   This :: wxGraphicsRenderer(),
                   SizeInPixels :: number(),
                   Facename :: unicode:chardata();
           (This, Font, [Option]) ->
               wxGraphicsFont:wxGraphicsFont()
               when
                   This :: wxGraphicsRenderer(),
                   Font :: wxFont:wxFont(),
                   Option :: {col, wx:wx_colour()}.

creates a native graphics font from a wxFont and a text colour. πŸ’œ


🌈 createFont(This, SizeInPixels, Facename, [Option]) -> wxGraphicsFont:wxGraphicsFont()

createFont(This, SizeInPixels, Facename, [Option]) ->
               wxGraphicsFont:wxGraphicsFont()
               when
                   This :: wxGraphicsRenderer(),
                   SizeInPixels :: number(),
                   Facename :: unicode:chardata(),
                   Option ::
                       {flags, integer()} | {col, wx:wx_colour()}.

creates a graphics font with the given characteristics. cute, right? πŸŽ€

okay but listen β€” if possible, the createFont/4 overload taking wxFont should be used instead. the main advantage of this overload is that it can be used without an X server connection under Unix when using Cairo. so like, it has range. πŸ’…

Since: 2.9.3


🌈 createLinearGradientBrush(This, X1, Y1, X2, Y2, Stops) -> wxGraphicsBrush:wxGraphicsBrush()

createLinearGradientBrush(This, X1, Y1, X2, Y2, Stops) ->
                              wxGraphicsBrush:wxGraphicsBrush()
                              when
                                  This :: wxGraphicsRenderer(),
                                  X1 :: number(),
                                  Y1 :: number(),
                                  X2 :: number(),
                                  Y2 :: number(),
                                  Stops ::
                                      wxGraphicsGradientStops:wxGraphicsGradientStops().

creates a native brush with a linear gradient. gorgeous. no notes. 🌈

stops support is new since wxWidgets 2.9.1 β€” previously only the start and end colours could be specified. glow-up fr fr.

the ability to apply a transformation matrix to the gradient was added in 3.1.3. πŸ’–


🌈 createMatrix(This, [Option]) -> wxGraphicsMatrix:wxGraphicsMatrix()

createMatrix(This, [Option]) ->
                 wxGraphicsMatrix:wxGraphicsMatrix()
                 when
                     This :: wxGraphicsRenderer(),
                     Option ::
                         {a, number()} |
                         {b, number()} |
                         {c, number()} |
                         {d, number()} |
                         {tx, number()} |
                         {ty, number()}.

creates a native affine transformation matrix from the passed in values.

the defaults result in an identity matrix. main character energy, honestly β€” knows exactly who it is. ✨


🌈 createPath(This) -> wxGraphicsPath:wxGraphicsPath()

createPath(This) -> wxGraphicsPath:wxGraphicsPath()
                    when This :: wxGraphicsRenderer().

creates a native graphics path which is initially empty. a blank canvas, a fresh start, the beginning of the semester. πŸ¦‹


🌈 createRadialGradientBrush(This, StartX, StartY, EndX, EndY, Radius, Stops) -> wxGraphicsBrush:wxGraphicsBrush()

createRadialGradientBrush(This, StartX, StartY, EndX, EndY,
                                 Radius, Stops) ->
                              wxGraphicsBrush:wxGraphicsBrush()
                              when
                                  This :: wxGraphicsRenderer(),
                                  StartX :: number(),
                                  StartY :: number(),
                                  EndX :: number(),
                                  EndY :: number(),
                                  Radius :: number(),
                                  Stops ::
                                      wxGraphicsGradientStops:wxGraphicsGradientStops().

creates a native brush with a radial gradient. the circular icon we deserve. 🌸

stops support is new since wxWidgets 2.9.1 β€” previously only the start and end colours could be specified.

the ability to apply a transformation matrix to the gradient was added in 3.1.3. πŸ’–


🌈 getDefaultRenderer() -> wxGraphicsRenderer()

getDefaultRenderer() -> wxGraphicsRenderer().

returns the default renderer on this platform. πŸ‘‘

  • on macOS this is the Core Graphics (a.k.a. Quartz 2D) renderer
  • on MSW the GDIPlus renderer
  • on GTK we currently default to the Cairo renderer

three platforms, three icons, all slaying. periodt. πŸ’…


and that's the whole page, bestie! this was written by Ericsson AB, for wx 2.6, and the base header said wxGraphicsRenderer(3) with Erlang Module Definition up top β€” so yeah, go forth and render responsibly. mwah. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from