SDL_render_sw_c.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Functions

SDL_Renderer * | SW_CreateRendererForSurface (SDL_Surface *surface)

## Function Documentation

## SW_CreateRendererForSurface()

SDL_Renderer* SW_CreateRendererForSurface | ( | SDL_Surface * | surface | ) |

Definition at line 126 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::RenderClear, SDL_Renderer::RenderCopy, SDL_Renderer::RenderCopyEx, SDL_Renderer::RenderDrawLines, SDL_Renderer::RenderDrawPoints, renderer, SDL_Renderer::RenderFillRects, SDL_Renderer::RenderPresent, SDL_Renderer::RenderReadPixels, SDL_calloc, SDL_OutOfMemory, SDL_SetError, SDL_Renderer::SetRenderTarget, SDL_Renderer::SetTextureAlphaMod, SDL_Renderer::SetTextureBlendMode, SDL_Renderer::SetTextureColorMod, SW_RenderData::surface, SW_ActivateRenderer(), SW_CreateTexture(), SW_DestroyRenderer(), SW_DestroyTexture(), SW_GetOutputSize(), SW_LockTexture(), SW_RenderClear(), SW_RenderCopy(), SW_RenderCopyEx(), SW_RenderDrawLines(), SW_RenderDrawPoints(), SW_RenderFillRects(), SW_RenderPresent(), SW_RenderReadPixels(), SW_SetRenderTarget(), SW_SetTextureAlphaMod(), SW_SetTextureBlendMode(), SW_SetTextureColorMod(), SW_UnlockTexture(), SW_UpdateClipRect(), SW_UpdateTexture(), SW_UpdateViewport(), SW_WindowEvent(), SDL_Renderer::UnlockTexture, SDL_Renderer::UpdateClipRect, SDL_Renderer::UpdateTexture, SDL_Renderer::UpdateViewport, SW_RenderData::window, and SDL_Renderer::WindowEvent.

Referenced by SDL_CreateSoftwareRenderer(), and SW_CreateRenderer().

{
SDL_Renderer *renderer;
SW_RenderData *data;
if (!surface) {
SDL_SetError("Can't create renderer for NULL surface");
return NULL;
}
renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
if (!renderer) {
SDL_OutOfMemory();
return NULL;
}
data = (SW_RenderData *) SDL_calloc(1, sizeof(*data));
if (!data) {
SW_DestroyRenderer(renderer);
SDL_OutOfMemory();
return NULL;
}
data->surface = surface;
data->window = surface;
renderer->WindowEvent = SW_WindowEvent;
renderer->GetOutputSize = SW_GetOutputSize;
renderer->CreateTexture = SW_CreateTexture;
renderer->SetTextureColorMod = SW_SetTextureColorMod;
renderer->SetTextureAlphaMod = SW_SetTextureAlphaMod;
renderer->SetTextureBlendMode = SW_SetTextureBlendMode;
renderer->UpdateTexture = SW_UpdateTexture;
renderer->LockTexture = SW_LockTexture;
renderer->UnlockTexture = SW_UnlockTexture;
renderer->SetRenderTarget = SW_SetRenderTarget;
renderer->UpdateViewport = SW_UpdateViewport;
renderer->UpdateClipRect = SW_UpdateClipRect;
renderer->RenderClear = SW_RenderClear;
renderer->RenderDrawPoints = SW_RenderDrawPoints;
renderer->RenderDrawLines = SW_RenderDrawLines;
renderer->RenderFillRects = SW_RenderFillRects;
renderer->RenderCopy = SW_RenderCopy;
renderer->RenderCopyEx = SW_RenderCopyEx;
renderer->RenderReadPixels = SW_RenderReadPixels;
renderer->RenderPresent = SW_RenderPresent;
renderer->DestroyTexture = SW_DestroyTexture;
renderer->DestroyRenderer = SW_DestroyRenderer;
renderer->info = SW_RenderDriver.info;
renderer->driverdata = data;
SW_ActivateRenderer(renderer);
return renderer;
}
SW_SetTextureAlphaMod
static int SW_SetTextureAlphaMod(SDL_Renderer *renderer, SDL_Texture *texture)
Definition: SDL_render_sw.c:270
SDL_Renderer::RenderDrawLines
int(* RenderDrawLines)(SDL_Renderer *renderer, const SDL_FPoint *points, int count)
Definition: SDL_sysrender.h:107
SDL_Renderer::RenderDrawPoints
int(* RenderDrawPoints)(SDL_Renderer *renderer, const SDL_FPoint *points, int count)
Definition: SDL_sysrender.h:105
SDL_Renderer::LockTexture
int(* LockTexture)(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch)
Definition: SDL_sysrender.h:98
SW_RenderReadPixels
static int SW_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, Uint32 format, void *pixels, int pitch)
Definition: SDL_render_sw.c:835
SDL_Renderer::RenderReadPixels
int(* RenderReadPixels)(SDL_Renderer *renderer, const SDL_Rect *rect, Uint32 format, void *pixels, int pitch)
Definition: SDL_sysrender.h:116
SW_RenderDrawPoints
static int SW_RenderDrawPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count)
Definition: SDL_render_sw.c:410
SDL_Renderer::info
SDL_RendererInfo info
Definition: SDL_sysrender.h:130
SW_UpdateViewport
static int SW_UpdateViewport(SDL_Renderer *renderer)
Definition: SDL_render_sw.c:353
SDL_Renderer::driverdata
void * driverdata
Definition: SDL_sysrender.h:171
surface
EGLSurface surface
Definition: eglext.h:248
SW_SetTextureColorMod
static int SW_SetTextureColorMod(SDL_Renderer *renderer, SDL_Texture *texture)
Definition: SDL_render_sw.c:256
SW_RenderFillRects
static int SW_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count)
Definition: SDL_render_sw.c:508
SDL_Renderer
Definition: SDL_sysrender.h:76
SW_RenderDrawLines
static int SW_RenderDrawLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count)
Definition: SDL_render_sw.c:459
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
SDL_Renderer::RenderFillRects
int(* RenderFillRects)(SDL_Renderer *renderer, const SDL_FRect *rects, int count)
Definition: SDL_sysrender.h:109
SW_GetOutputSize
static int SW_GetOutputSize(SDL_Renderer *renderer, int *w, int *h)
Definition: SDL_render_sw.c:205
SW_RenderCopy
static int SW_RenderCopy(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect)
Definition: SDL_render_sw.c:558
SDL_RenderDriver::info
SDL_RendererInfo info
Definition: SDL_sysrender.h:180
SDL_Renderer::RenderClear
int(* RenderClear)(SDL_Renderer *renderer)
Definition: SDL_sysrender.h:104
SDL_Renderer::DestroyRenderer
void(* DestroyRenderer)(SDL_Renderer *renderer)
Definition: SDL_sysrender.h:121
SDL_Renderer::GetOutputSize
int(* GetOutputSize)(SDL_Renderer *renderer, int *w, int *h)
Definition: SDL_sysrender.h:81
SDL_Renderer::SetTextureBlendMode
int(* SetTextureBlendMode)(SDL_Renderer *renderer, SDL_Texture *texture)
Definition: SDL_sysrender.h:88
SW_RenderData
Definition: SDL_render_sw.c:98
SDL_Renderer::UpdateTexture
int(* UpdateTexture)(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch)
Definition: SDL_sysrender.h:90
SW_SetTextureBlendMode
static int SW_SetTextureBlendMode(SDL_Renderer *renderer, SDL_Texture *texture)
Definition: SDL_render_sw.c:283
SDL_Renderer::SetTextureColorMod
int(* SetTextureColorMod)(SDL_Renderer *renderer, SDL_Texture *texture)
Definition: SDL_sysrender.h:84
SW_RenderDriver
SDL_RenderDriver SW_RenderDriver
Definition: SDL_render_sw.c:78
SW_RenderData::surface
SDL_Surface * surface
Definition: SDL_render_sw.c:100
SW_RenderPresent
static void SW_RenderPresent(SDL_Renderer *renderer)
Definition: SDL_render_sw.c:866
SW_UnlockTexture
static void SW_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture)
Definition: SDL_render_sw.c:335
renderer
static SDL_Renderer * renderer
Definition: testaudiocapture.c:21
SW_ActivateRenderer
static SDL_Surface * SW_ActivateRenderer(SDL_Renderer *renderer)
Definition: SDL_render_sw.c:106
SW_RenderCopyEx
static int SW_RenderCopyEx(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip)
Definition: SDL_render_sw.c:603
SW_CreateTexture
static int SW_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture)
Definition: SDL_render_sw.c:224
SW_LockTexture
static int SW_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch)
Definition: SDL_render_sw.c:322
SW_DestroyRenderer
static void SW_DestroyRenderer(SDL_Renderer *renderer)
Definition: SDL_render_sw.c:884
SDL_Renderer::UnlockTexture
void(* UnlockTexture)(SDL_Renderer *renderer, SDL_Texture *texture)
Definition: SDL_sysrender.h:100
SDL_Renderer::SetRenderTarget
int(* SetRenderTarget)(SDL_Renderer *renderer, SDL_Texture *texture)
Definition: SDL_sysrender.h:101
SDL_Renderer::UpdateViewport
int(* UpdateViewport)(SDL_Renderer *renderer)
Definition: SDL_sysrender.h:102
SW_SetRenderTarget
static int SW_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)
Definition: SDL_render_sw.c:340
SW_UpdateTexture
static int SW_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch)
Definition: SDL_render_sw.c:296
SDL_Renderer::RenderCopy
int(* RenderCopy)(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect)
Definition: SDL_sysrender.h:111
NULL
#define NULL
Definition: begin_code.h:164
SDL_OutOfMemory
#define SDL_OutOfMemory()
Definition: SDL_error.h:52
SW_RenderClear
static int SW_RenderClear(SDL_Renderer *renderer)
Definition: SDL_render_sw.c:388
SDL_SetError
#define SDL_SetError
Definition: SDL_dynapi_overrides.h:30
SW_RenderData::window
SDL_Surface * window
Definition: SDL_render_sw.c:101
SDL_Renderer::RenderCopyEx
int(* RenderCopyEx)(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcquad, const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip)
Definition: SDL_sysrender.h:113
SDL_calloc
#define SDL_calloc
Definition: SDL_dynapi_overrides.h:375
SDL_Renderer::SetTextureAlphaMod
int(* SetTextureAlphaMod)(SDL_Renderer *renderer, SDL_Texture *texture)
Definition: SDL_sysrender.h:86
SW_WindowEvent
static void SW_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event)
Definition: SDL_render_sw.c:194
SW_DestroyTexture
static void SW_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture)
Definition: SDL_render_sw.c:876
SDL_Renderer::WindowEvent
void(* WindowEvent)(SDL_Renderer *renderer, const SDL_WindowEvent *event)
Definition: SDL_sysrender.h:80
SW_UpdateClipRect
static int SW_UpdateClipRect(SDL_Renderer *renderer)
Definition: SDL_render_sw.c:368
SDL_Renderer::DestroyTexture
void(* DestroyTexture)(SDL_Renderer *renderer, SDL_Texture *texture)
Definition: SDL_sysrender.h:119
SDL_Renderer::CreateTexture
int(* CreateTexture)(SDL_Renderer *renderer, SDL_Texture *texture)
Definition: SDL_sysrender.h:83
SDL_Renderer::RenderPresent
void(* RenderPresent)(SDL_Renderer *renderer)
Definition: SDL_sysrender.h:118
SDL_Renderer::UpdateClipRect
int(* UpdateClipRect)(SDL_Renderer *renderer)
Definition: SDL_sysrender.h:103