|
ObjectivelyMVC
Object oriented MVC framework for SDL3 and GNU C
|
#include <assert.h>#include <math.h>#include <stdlib.h>#include <string.h>#include <Objectively/Vector.h>#include <ObjectivelyGPU/CopyPass.h>#include <ObjectivelyGPU/Mathlib.h>#include <ObjectivelyGPU/RenderPass.h>#include "Renderer.h"#include "View.h"#include "Window.h"#include "../Assets/Renderer.frag.dxil.h"#include "../Assets/Renderer.frag.metal.h"#include "../Assets/Renderer.frag.spv.h"#include "../Assets/Renderer.vert.dxil.h"#include "../Assets/Renderer.vert.metal.h"#include "../Assets/Renderer.vert.spv.h"Go to the source code of this file.
Macros | |
| #define | _Class _Renderer |
Functions | |
| Class * | _Renderer (void) |
| static void | beginFrame (Renderer *self) |
| static void | beginFrameWith (Renderer *self, CommandBuffer *commands, Framebuffer *framebuffer) |
| static void | dealloc (Object *self) |
| static void | drawBevel (const Renderer *self, const SDL_Rect *rect, int radius, int width, const SDL_Color *topLeft, const SDL_Color *bottomRight) |
| static void | drawLine (const Renderer *self, const SDL_Point *points, const SDL_Color *color) |
| static void | drawLines (const Renderer *self, const SDL_Point *points, size_t count, const SDL_Color *color) |
| static void | drawPolygon (const Renderer *self, const SDL_Point *points, size_t count, int width, const SDL_Color *color) |
| static void | drawPolygonFilled (const Renderer *self, const SDL_Point *points, size_t count, int angle, const SDL_Color *from, const SDL_Color *to) |
| static void | drawRect (const Renderer *self, const SDL_Rect *rect, const SDL_Color *color) |
| static void | drawRectFilled (const Renderer *self, const SDL_Rect *rect, const SDL_Color *color) |
| static void | drawRoundedRect (const Renderer *self, const SDL_Rect *rect, int radius, int width, const SDL_Color *color) |
| static void | drawRoundedRectFilled (const Renderer *self, const SDL_Rect *rect, int radius, const SDL_Color *color) |
| static void | drawRoundedRectGradientFilled (const Renderer *self, const SDL_Rect *rect, int radius, int angle, const SDL_Color *from, const SDL_Color *to) |
| static void | drawRoundedTexture (const Renderer *self, Texture *texture, const SDL_FRect *dest, int radius, const SDL_Color *color) |
| static void | drawRoundedTextureRegion (const Renderer *self, Texture *texture, const SDL_Rect *src, const SDL_FRect *dest, int radius, const SDL_Color *color) |
| static void | drawTexture (const Renderer *self, Texture *texture, const SDL_FRect *dest, const SDL_Color *color) |
| static void | drawTextureRegion (const Renderer *self, Texture *texture, const SDL_Rect *src, const SDL_FRect *dest, const SDL_Color *color) |
| static void | drawView (Renderer *self, View *view) |
| static void | endFrame (Renderer *self) |
| static SDL_Color | gradientColor (float x, float y, const SDL_FRect *bounds, int angle, const SDL_Color *from, const SDL_Color *to) |
The color at x, y for a gradient of angle degrees across bounds. | |
| static void | initialize (Class *clazz) |
| static Renderer * | initWithDevice (Renderer *self, RenderDevice *device) |
| static void | pushDrawArrays (const Renderer *self, const MVC_Vertex *verts, size_t count, Texture *texture, const SDL_Color *color) |
| static void | renderDeviceDidReset (Renderer *self) |
| static void | renderDeviceWillReset (Renderer *self) |
| static void | roundedRectVertices (MVC_Vertex *verts, const SDL_FRect *rect, int radius, int stroke, const SDL_FRect *uv) |
Fills six vertices covering rect as two triangles, tagged so the fragment shader shades them as a rounded rectangle of the given radius and stroke width. | |
| static void | setClippingFrame (Renderer *self, const SDL_Rect *clippingFrame) |
| static Data * | shaderResourceProvider (const char *name) |
ResourceProvider for loading shaders from xxd headers. | |
| static void | strokePolyline (const Renderer *self, const SDL_Point *points, size_t count, bool closed, float width, const SDL_Color *color) |
Appends the quads stroking points, of width, optionally closing the loop. | |
| static SDL_FRect | textureRegion (const Texture *texture, const SDL_Rect *src) |
Resolves the normalized texture coordinates of src within texture, or of the whole texture when src is NULL. | |
| #define _Class _Renderer |
Definition at line 69 of file Renderer.c.
| Class * _Renderer | ( | void | ) |
Definition at line 890 of file Renderer.c.
|
static |
Definition at line 101 of file Renderer.c.
|
static |
Definition at line 109 of file Renderer.c.
|
static |
Definition at line 76 of file Renderer.c.
|
static |
Definition at line 247 of file Renderer.c.
|
static |
Definition at line 266 of file Renderer.c.
|
static |
Definition at line 277 of file Renderer.c.
|
static |
Definition at line 293 of file Renderer.c.
|
static |
Definition at line 310 of file Renderer.c.
|
static |
Definition at line 365 of file Renderer.c.
|
static |
Definition at line 384 of file Renderer.c.
|
static |
Definition at line 407 of file Renderer.c.
|
static |
Definition at line 424 of file Renderer.c.
|
static |
Definition at line 441 of file Renderer.c.
|
static |
Definition at line 465 of file Renderer.c.
|
static |
Definition at line 473 of file Renderer.c.
|
static |
Definition at line 489 of file Renderer.c.
|
static |
Definition at line 497 of file Renderer.c.
Definition at line 525 of file Renderer.c.
|
static |
Definition at line 555 of file Renderer.c.
|
static |
The color at x, y for a gradient of angle degrees across bounds.
angle is measured clockwise from south, so 0 fills downwards and 90 to the right. The interpolant is the point's projection onto the gradient axis, normalized by the extent of bounds along that axis, which makes the color an affine function of position: barycentric interpolation across the triangle then reproduces the gradient exactly, at any angle, from colors assigned only at the vertices.
Definition at line 170 of file Renderer.c.
|
static |
Definition at line 855 of file Renderer.c.
Definition at line 639 of file Renderer.c.
|
static |
Definition at line 660 of file Renderer.c.
|
static |
Definition at line 705 of file Renderer.c.
|
static |
Definition at line 820 of file Renderer.c.
|
static |
Fills six vertices covering rect as two triangles, tagged so the fragment shader shades them as a rounded rectangle of the given radius and stroke width.
The first triangle is the half above the bottom-left to top-right diagonal.
Definition at line 128 of file Renderer.c.
|
static |
Definition at line 841 of file Renderer.c.
|
static |
ResourceProvider for loading shaders from xxd headers.
Definition at line 48 of file Renderer.c.
|
static |
Appends the quads stroking points, of width, optionally closing the loop.
Definition at line 202 of file Renderer.c.
|
static |
Resolves the normalized texture coordinates of src within texture, or of the whole texture when src is NULL.
Definition at line 151 of file Renderer.c.