Go to the source code of this file.
|
static SDL_Surface * | SW_ActivateRenderer (SDL_Renderer *renderer) |
|
static void | SW_WindowEvent (SDL_Renderer *renderer, const SDL_WindowEvent *event) |
|
static int | SW_GetOutputSize (SDL_Renderer *renderer, int *w, int *h) |
|
static int | SW_CreateTexture (SDL_Renderer *renderer, SDL_Texture *texture) |
|
static int | SW_UpdateTexture (SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch) |
|
static int | SW_LockTexture (SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch) |
|
static void | SW_UnlockTexture (SDL_Renderer *renderer, SDL_Texture *texture) |
|
static int | SW_SetRenderTarget (SDL_Renderer *renderer, SDL_Texture *texture) |
|
static int | SW_QueueSetViewport (SDL_Renderer *renderer, SDL_RenderCommand *cmd) |
|
static int | SW_QueueDrawPoints (SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) |
|
static int | SW_QueueFillRects (SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FRect *rects, int count) |
|
static int | SW_QueueCopy (SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect) |
|
static int | SW_QueueCopyEx (SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip) |
|
static int | SW_RenderCopyEx (SDL_Renderer *renderer, SDL_Surface *surface, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_Rect *final_rect, const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip) |
|
static void | PrepTextureForCopy (const SDL_RenderCommand *cmd) |
|
static void | SetDrawState (SDL_Surface *surface, SW_DrawStateCache *drawstate) |
|
static int | SW_RunCommandQueue (SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) |
|
static int | SW_RenderReadPixels (SDL_Renderer *renderer, const SDL_Rect *rect, Uint32 format, void *pixels, int pitch) |
|
static void | SW_RenderPresent (SDL_Renderer *renderer) |
|
static void | SW_DestroyTexture (SDL_Renderer *renderer, SDL_Texture *texture) |
|
static void | SW_DestroyRenderer (SDL_Renderer *renderer) |
|
SDL_Renderer * | SW_CreateRendererForSurface (SDL_Surface *surface) |
|
static SDL_Renderer * | SW_CreateRenderer (SDL_Window *window, Uint32 flags) |
|
◆ PrepTextureForCopy()
◆ SetDrawState()
Definition at line 584 of file SDL_render_sw.c.
591 if (cliprect !=
NULL) {
595 clip_rect.
w = cliprect->
w;
596 clip_rect.
h = cliprect->
h;
References SW_DrawStateCache::cliprect, SDL_Rect::h, NULL, SDL_assert, SDL_FALSE, SDL_IntersectRect, SDL_SetClipRect, SW_DrawStateCache::surface_cliprect_dirty, viewport, SW_DrawStateCache::viewport, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by SW_RunCommandQueue().
◆ SW_ActivateRenderer()
◆ SW_CreateRenderer()
◆ SW_CreateRendererForSurface()
Definition at line 802 of file SDL_render_sw.c.
References SDL_Renderer::CreateTexture, SDL_Renderer::DestroyRenderer, SDL_Renderer::DestroyTexture, SDL_Renderer::driverdata, SDL_Renderer::GetOutputSize, SDL_Renderer::info, SDL_RenderDriver::info, SDL_Renderer::LockTexture, NULL, SDL_Renderer::QueueCopy, SDL_Renderer::QueueCopyEx, SDL_Renderer::QueueDrawLines, SDL_Renderer::QueueDrawPoints, SDL_Renderer::QueueFillRects, SDL_Renderer::QueueSetDrawColor, SDL_Renderer::QueueSetViewport, renderer, SDL_Renderer::RenderPresent, SDL_Renderer::RenderReadPixels, SDL_Renderer::RunCommandQueue, SDL_calloc, SDL_OutOfMemory, SDL_SetError, SDL_Renderer::SetRenderTarget, SW_ActivateRenderer(), SW_CreateTexture(), SW_DestroyRenderer(), SW_DestroyTexture(), SW_GetOutputSize(), SW_LockTexture(), SW_QueueCopy(), SW_QueueCopyEx(), SW_QueueDrawPoints(), SW_QueueFillRects(), SW_QueueSetViewport(), SW_RenderDriver, SW_RenderPresent(), SW_RenderReadPixels(), SW_RunCommandQueue(), SW_SetRenderTarget(), SW_UnlockTexture(), SW_UpdateTexture(), SW_WindowEvent(), SDL_Renderer::UnlockTexture, SDL_Renderer::UpdateTexture, and SDL_Renderer::WindowEvent.
Referenced by SDL_CreateSoftwareRenderer(), and SW_CreateRenderer().
◆ SW_CreateTexture()
Definition at line 107 of file SDL_render_sw.c.
110 Uint32 Rmask, Gmask, Bmask, Amask;
113 (
texture->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) {
References SDL_CreateRGBSurface, SDL_PixelFormatEnumToMasks, SDL_SetError, SDL_SetSurfaceAlphaMod, SDL_SetSurfaceBlendMode, SDL_SetSurfaceColorMod, SDL_SetSurfaceRLE, and SDL_TEXTUREACCESS_STATIC.
Referenced by SW_CreateRendererForSurface().
◆ SW_DestroyRenderer()
◆ SW_DestroyTexture()
◆ SW_GetOutputSize()
static int SW_GetOutputSize |
( |
SDL_Renderer * |
renderer, |
|
|
int * |
w, |
|
|
int * |
h |
|
) |
| |
|
static |
◆ SW_LockTexture()
◆ SW_QueueCopy()
Definition at line 265 of file SDL_render_sw.c.
283 verts->
x = (int)dstrect->
x;
284 verts->
y = (
int)dstrect->
y;
286 verts->
w = (int)dstrect->
w;
287 verts->
h = (
int)dstrect->
h;
References SDL_RenderCommand::data, SDL_RenderCommand::draw, SDL_Rect::h, SDL_FRect::h, renderer, SDL_AllocateRenderVertices(), SDL_memcpy, SDL_Renderer::viewport, SDL_Rect::w, SDL_FRect::w, SDL_Rect::x, SDL_FRect::x, SDL_Rect::y, and SDL_FRect::y.
Referenced by SW_CreateRendererForSurface().
◆ SW_QueueCopyEx()
Definition at line 302 of file SDL_render_sw.c.
References CopyExData::angle, CopyExData::center, SDL_RenderCommand::data, SDL_RenderCommand::draw, CopyExData::dstrect, CopyExData::flip, SDL_Rect::h, SDL_FRect::h, renderer, SDL_AllocateRenderVertices(), SDL_memcpy, CopyExData::srcrect, SDL_Renderer::viewport, SDL_Rect::w, SDL_FRect::w, SDL_Rect::x, SDL_FRect::x, SDL_Rect::y, and SDL_FRect::y.
Referenced by SW_CreateRendererForSurface().
◆ SW_QueueDrawPoints()
◆ SW_QueueFillRects()
◆ SW_QueueSetViewport()
◆ SW_RenderCopyEx()
Definition at line 333 of file SDL_render_sw.c.
341 int retval = 0, dstwidth, dstheight, abscenterx, abscentery;
342 double cangle, sangle, px, py, p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y;
344 Uint8 alphaMod, rMod, gMod, bMod;
355 tmp_rect.w = final_rect->
w;
356 tmp_rect.h = final_rect->
h;
369 src->format->Rmask,
src->format->Gmask,
370 src->format->Bmask,
src->format->Amask);
371 if (src_clone ==
NULL) {
388 if (!(srcrect->
w == final_rect->
w && srcrect->
h == final_rect->
h && srcrect->
x == 0 && srcrect->
y == 0)) {
393 if (!(srcrect->
w ==
src->w && srcrect->
h ==
src->h && srcrect->
x == 0 && srcrect->
y == 0)) {
414 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
425 if (!
retval && (blitRequired || applyModulation)) {
428 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
429 if (src_scaled ==
NULL) {
435 src_clone = src_scaled;
445 src_rotated =
SDLgfx_rotateSurface(src_clone,
angle, dstwidth/2, dstheight/2, (
texture->scaleMode ==
SDL_ScaleModeNearest) ? 0 : 1, flip &
SDL_FLIP_HORIZONTAL, flip &
SDL_FLIP_VERTICAL, dstwidth, dstheight, cangle, sangle);
446 if (src_rotated ==
NULL) {
451 mask_rotated =
SDLgfx_rotateSurface(
mask,
angle, dstwidth/2, dstheight/2,
SDL_FALSE, 0, 0, dstwidth, dstheight, cangle, sangle);
452 if (mask_rotated ==
NULL) {
458 abscenterx = final_rect->
x + (int)center->
x;
459 abscentery = final_rect->
y + (
int)center->
y;
464 px = final_rect->
x - abscenterx;
465 py = final_rect->
y - abscentery;
466 p1x = px * cangle - py * sangle + abscenterx;
467 p1y = px * sangle + py * cangle + abscentery;
470 px = final_rect->
x + final_rect->
w - abscenterx;
471 py = final_rect->
y - abscentery;
472 p2x = px * cangle - py * sangle + abscenterx;
473 p2y = px * sangle + py * cangle + abscentery;
476 px = final_rect->
x - abscenterx;
477 py = final_rect->
y + final_rect->
h - abscentery;
478 p3x = px * cangle - py * sangle + abscenterx;
479 p3y = px * sangle + py * cangle + abscentery;
482 px = final_rect->
x + final_rect->
w - abscenterx;
483 py = final_rect->
y + final_rect->
h - abscentery;
484 p4x = px * cangle - py * sangle + abscenterx;
485 p4y = px * sangle + py * cangle + abscentery;
487 tmp_rect.x = (int)
MIN(
MIN(p1x, p2x),
MIN(p3x, p4x));
488 tmp_rect.y = (int)
MIN(
MIN(p1y, p2y),
MIN(p3y, p4y));
489 tmp_rect.w = dstwidth;
490 tmp_rect.h = dstheight;
517 mask_rect = tmp_rect;
527 src_rotated->format->BitsPerPixel, src_rotated->pitch,
528 src_rotated->format->Rmask, src_rotated->format->Gmask,
529 src_rotated->format->Bmask, 0);
530 if (src_rotated_rgb ==
NULL) {
541 if (src_rotated !=
NULL) {
553 if (src_clone !=
NULL) {
References SDL_Rect::h, MIN, NULL, retval, SDL_BLENDMODE_ADD, SDL_BLENDMODE_MOD, SDL_BLENDMODE_NONE, SDL_BlitScaled, SDL_BlitSurface, SDL_CreateRGBSurface, SDL_CreateRGBSurfaceFrom, SDL_FALSE, SDL_FLIP_HORIZONTAL, SDL_FLIP_VERTICAL, SDL_FreeSurface, SDL_GetSurfaceAlphaMod, SDL_GetSurfaceBlendMode, SDL_GetSurfaceColorMod, SDL_LockSurface, SDL_MUSTLOCK, SDL_PACKEDLAYOUT_8888, SDL_PIXELLAYOUT, SDL_ScaleModeNearest, SDL_SetSurfaceAlphaMod, SDL_SetSurfaceBlendMode, SDL_SetSurfaceColorMod, SDL_TRUE, SDL_UnlockSurface, SDLgfx_rotateSurface(), SDLgfx_rotozoomSurfaceSizeTrig(), SDL_Rect::w, SDL_FPoint::x, SDL_Rect::x, SDL_FPoint::y, and SDL_Rect::y.
Referenced by SW_RunCommandQueue().
◆ SW_RenderPresent()
◆ SW_RenderReadPixels()
Definition at line 744 of file SDL_render_sw.c.
761 return SDL_SetError(
"Tried to read outside of surface bounds");
764 src_format =
surface->format->format;
770 src_format, src_pixels,
surface->pitch,
References SDL_Rect::h, rect, renderer, SDL_ConvertPixels, SDL_SetError, SW_ActivateRenderer(), SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by SW_CreateRendererForSurface().
◆ SW_RunCommandQueue()
Definition at line 607 of file SDL_render_sw.c.
712 if ( srcrect->
w == dstrect->
w && srcrect->
h == dstrect->
h ) {
References CopyExData::angle, CopyExData::center, SW_DrawStateCache::cliprect, SDL_RenderCommand::cliprect, SDL_RenderCommand::color, SDL_RenderCommand::command, SDL_RenderCommand::data, SDL_RenderCommand::draw, CopyExData::dstrect, CopyExData::flip, SDL_Rect::h, SDL_RenderCommand::next, NULL, PrepTextureForCopy(), renderer, SDL_BlendFillRects(), SDL_BlendLines(), SDL_BLENDMODE_NONE, SDL_BlendPoints(), SDL_BlitScaled, SDL_BlitSurface, SDL_DrawLines(), SDL_DrawPoints(), SDL_FillRect, SDL_FillRects, SDL_MapRGBA, SDL_RENDERCMD_CLEAR, SDL_RENDERCMD_COPY, SDL_RENDERCMD_COPY_EX, SDL_RENDERCMD_DRAW_LINES, SDL_RENDERCMD_DRAW_POINTS, SDL_RENDERCMD_FILL_RECTS, SDL_RENDERCMD_NO_OP, SDL_RENDERCMD_SETCLIPRECT, SDL_RENDERCMD_SETDRAWCOLOR, SDL_RENDERCMD_SETVIEWPORT, SDL_SetClipRect, SDL_SetSurfaceRLE, SDL_TRUE, SetDrawState(), CopyExData::srcrect, SW_DrawStateCache::surface_cliprect_dirty, SW_ActivateRenderer(), SW_RenderCopyEx(), SW_DrawStateCache::viewport, SDL_RenderCommand::viewport, and SDL_Rect::w.
Referenced by SW_CreateRendererForSurface().
◆ SW_SetRenderTarget()
◆ SW_UnlockTexture()
◆ SW_UpdateTexture()
◆ SW_WindowEvent()
◆ SW_RenderDriver
#define SDL_UnlockSurface
SDL_Renderer * SW_CreateRendererForSurface(SDL_Surface *surface)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
static void SW_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture)
GLfixed GLfixed GLint GLint GLfixed points
static int SW_RenderCopyEx(SDL_Renderer *renderer, SDL_Surface *surface, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_Rect *final_rect, const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip)
A collection of pixels used in software blitting.
struct SDL_RenderCommand::@30::@34 color
static void PrepTextureForCopy(const SDL_RenderCommand *cmd)
int(* QueueCopyEx)(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, const SDL_Rect *srcquad, const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip)
int SDL_BlendFillRects(SDL_Surface *dst, const SDL_Rect *rects, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
static SDL_Renderer * SW_CreateRenderer(SDL_Window *window, Uint32 flags)
void * SDL_AllocateRenderVertices(SDL_Renderer *renderer, const size_t numbytes, const size_t alignment, size_t *offset)
int(* RunCommandQueue)(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize)
GLboolean GLboolean GLboolean b
int(* SetRenderTarget)(SDL_Renderer *renderer, SDL_Texture *texture)
#define SDL_PIXELLAYOUT(X)
static int SW_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count)
GLuint GLuint GLsizei count
struct SDL_RenderCommand * next
const SDL_Rect * cliprect
GLdouble GLdouble GLdouble r
SDL_RenderDriver SW_RenderDriver
static int SW_QueueCopy(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect)
#define SDL_IntersectRect
union SDL_RenderCommand::@30 data
void(* WindowEvent)(SDL_Renderer *renderer, const SDL_WindowEvent *event)
GLboolean GLboolean GLboolean GLboolean a
int SDL_BlendLines(SDL_Surface *dst, const SDL_Point *points, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
GLfloat GLfloat GLfloat GLfloat h
GLuint GLsizei GLsizei * length
#define SDL_GetSurfaceBlendMode
static int SW_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, Uint32 format, void *pixels, int pitch)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
The type used to identify a window.
#define SDL_UpdateWindowSurface
int SDL_BlendPoints(SDL_Surface *dst, const SDL_Point *points, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
#define SDL_GetWindowSize
#define SDL_CreateRGBSurfaceFrom
static int SW_QueueFillRects(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FRect *rects, int count)
int(* QueueSetDrawColor)(SDL_Renderer *renderer, SDL_RenderCommand *cmd)
The structure that defines a point (floating point)
int SDL_DrawPoints(SDL_Surface *dst, const SDL_Point *points, int count, Uint32 color)
GLint GLint GLint GLint GLint x
EGLSurface EGLNativeWindowType * window
struct SDL_RenderCommand::@30::@31 viewport
#define SDL_SetSurfaceColorMod
const SDL_Rect * viewport
static int SW_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)
int(* QueueDrawLines)(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count)
SDL_bool surface_cliprect_dirty
struct SDL_RenderCommand::@30::@33 draw
static int SW_GetOutputSize(SDL_Renderer *renderer, int *w, int *h)
#define SDL_PixelFormatEnumToMasks
static void SetDrawState(SDL_Surface *surface, SW_DrawStateCache *drawstate)
#define SDL_SetSurfaceRLE
SDL_RenderCommandType command
int(* QueueSetViewport)(SDL_Renderer *renderer, SDL_RenderCommand *cmd)
#define SDL_assert(condition)
int SDL_DrawLines(SDL_Surface *dst, const SDL_Point *points, int count, Uint32 color)
static int SW_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
SDL_BlendMode
The blend mode used in SDL_RenderCopy() and drawing operations.
#define SDL_GetWindowSurface
int(* GetOutputSize)(SDL_Renderer *renderer, int *w, int *h)
#define SDL_OutOfMemory()
int(* CreateTexture)(SDL_Renderer *renderer, SDL_Texture *texture)
GLint GLint GLint GLint GLint GLint y
#define SDL_CreateRGBSurface
void(* DestroyRenderer)(SDL_Renderer *renderer)
int(* LockTexture)(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch)
static int SW_QueueCopyEx(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip)
#define SDL_GetSurfaceAlphaMod
static void SW_DestroyRenderer(SDL_Renderer *renderer)
int(* RenderReadPixels)(SDL_Renderer *renderer, const SDL_Rect *rect, Uint32 format, void *pixels, int pitch)
static SDL_Renderer * renderer
The structure that defines a point (integer)
void(* RenderPresent)(SDL_Renderer *renderer)
static SDL_Surface * SW_ActivateRenderer(SDL_Renderer *renderer)
A rectangle, with the origin at the upper left (integer).
int(* QueueFillRects)(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FRect *rects, int count)
int(* UpdateTexture)(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch)
struct SDL_RenderCommand::@30::@32 cliprect
static int SW_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize)
static int SW_QueueSetViewport(SDL_Renderer *renderer, SDL_RenderCommand *cmd)
#define SDL_SetSurfaceBlendMode
#define SDL_GetSurfaceColorMod
#define SDL_ConvertPixels
static int SW_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch)
void SDLgfx_rotozoomSurfaceSizeTrig(int width, int height, double angle, int *dstwidth, int *dstheight, double *cangle, double *sangle)
SDL_Surface * SDLgfx_rotateSurface(SDL_Surface *src, double angle, int centerx, int centery, int smooth, int flipx, int flipy, int dstwidth, int dstheight, double cangle, double sangle)
int(* QueueDrawPoints)(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count)
static void SW_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event)
int(* QueueCopy)(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect)
static int SW_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture)
GLenum GLenum GLuint texture
static void SW_RenderPresent(SDL_Renderer *renderer)
EGLSurface EGLint * rects
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
static void SW_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture)
void(* UnlockTexture)(SDL_Renderer *renderer, SDL_Texture *texture)
#define SDL_SetSurfaceAlphaMod
void(* DestroyTexture)(SDL_Renderer *renderer, SDL_Texture *texture)
GLubyte GLubyte GLubyte GLubyte w