Renderer colors now have floating point precision

This commit is contained in:
Sam Lantinga
2024-01-29 13:28:33 -08:00
parent da8fc70a83
commit 554f0625d3
21 changed files with 603 additions and 347 deletions

View File

@@ -69,7 +69,7 @@ struct SDL_Texture
int h; /**< The height of the texture */
SDL_BlendMode blendMode; /**< The texture blend mode */
SDL_ScaleMode scaleMode; /**< The texture scale mode */
SDL_Color color; /**< Texture modulation values */
SDL_FColor color; /**< Texture modulation values */
SDL_RenderViewState view; /**< Target texture view state */
SDL_Renderer *renderer;
@@ -126,14 +126,14 @@ typedef struct SDL_RenderCommand
{
size_t first;
size_t count;
Uint8 r, g, b, a;
SDL_FColor color;
SDL_BlendMode blend;
SDL_Texture *texture;
} draw;
struct
{
size_t first;
Uint8 r, g, b, a;
SDL_FColor color;
} color;
} data;
struct SDL_RenderCommand *next;
@@ -142,7 +142,7 @@ typedef struct SDL_RenderCommand
typedef struct SDL_VertexSolid
{
SDL_FPoint position;
SDL_Color color;
SDL_FColor color;
} SDL_VertexSolid;
typedef enum
@@ -175,7 +175,7 @@ struct SDL_Renderer
const SDL_FRect *srcquad, const SDL_FRect *dstrect,
const double angle, const SDL_FPoint *center, const SDL_FlipMode flip, float scale_x, float scale_y);
int (*QueueGeometry)(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture,
const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride,
const float *xy, int xy_stride, const SDL_FColor *color, int color_stride, const float *uv, int uv_stride,
int num_vertices, const void *indices, int num_indices, int size_indices,
float scale_x, float scale_y);
@@ -249,14 +249,14 @@ struct SDL_Renderer
SDL_Texture *target;
SDL_Mutex *target_mutex;
SDL_Color color; /**< Color for drawing operations values */
SDL_FColor color; /**< Color for drawing operations values */
SDL_BlendMode blendMode; /**< The drawing blend mode */
SDL_RenderCommand *render_commands;
SDL_RenderCommand *render_commands_tail;
SDL_RenderCommand *render_commands_pool;
Uint32 render_command_generation;
Uint32 last_queued_color;
SDL_FColor last_queued_color;
SDL_Rect last_queued_viewport;
SDL_Rect last_queued_cliprect;
SDL_bool last_queued_cliprect_enabled;