Lines Matching refs:texture
49 SDL_Texture *texture; member
91 IDirect3DTexture9 *texture; member
97 D3D_TextureRep texture; member
401 D3D_CreateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, DWORD usage, Uint32 format,… in D3D_CreateTextureRep() argument
405 texture->dirty = SDL_FALSE; in D3D_CreateTextureRep()
406 texture->w = w; in D3D_CreateTextureRep()
407 texture->h = h; in D3D_CreateTextureRep()
408 texture->usage = usage; in D3D_CreateTextureRep()
409 texture->format = format; in D3D_CreateTextureRep()
410 texture->d3dfmt = d3dfmt; in D3D_CreateTextureRep()
414 D3DPOOL_DEFAULT, &texture->texture, NULL); in D3D_CreateTextureRep()
423 D3D_CreateStagingTexture(IDirect3DDevice9 *device, D3D_TextureRep *texture) in D3D_CreateStagingTexture() argument
427 if (texture->staging == NULL) { in D3D_CreateStagingTexture()
428 result = IDirect3DDevice9_CreateTexture(device, texture->w, texture->h, 1, 0, in D3D_CreateStagingTexture()
429 texture->d3dfmt, D3DPOOL_SYSTEMMEM, &texture->staging, NULL); in D3D_CreateStagingTexture()
438 D3D_RecreateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture) in D3D_RecreateTextureRep() argument
440 if (texture->texture) { in D3D_RecreateTextureRep()
441 IDirect3DTexture9_Release(texture->texture); in D3D_RecreateTextureRep()
442 texture->texture = NULL; in D3D_RecreateTextureRep()
444 if (texture->staging) { in D3D_RecreateTextureRep()
445 IDirect3DTexture9_AddDirtyRect(texture->staging, NULL); in D3D_RecreateTextureRep()
446 texture->dirty = SDL_TRUE; in D3D_RecreateTextureRep()
452 D3D_UpdateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, int x, int y, int w, int h,… in D3D_UpdateTextureRep() argument
461 if (D3D_CreateStagingTexture(device, texture) < 0) { in D3D_UpdateTextureRep()
470 result = IDirect3DTexture9_LockRect(texture->staging, 0, &locked, &d3drect, 0); in D3D_UpdateTextureRep()
477 length = w * SDL_BYTESPERPIXEL(texture->format); in D3D_UpdateTextureRep()
493 result = IDirect3DTexture9_UnlockRect(texture->staging, 0); in D3D_UpdateTextureRep()
497 texture->dirty = SDL_TRUE; in D3D_UpdateTextureRep()
503 D3D_DestroyTextureRep(D3D_TextureRep *texture) in D3D_DestroyTextureRep() argument
505 if (texture->texture) { in D3D_DestroyTextureRep()
506 IDirect3DTexture9_Release(texture->texture); in D3D_DestroyTextureRep()
507 texture->texture = NULL; in D3D_DestroyTextureRep()
509 if (texture->staging) { in D3D_DestroyTextureRep()
510 IDirect3DTexture9_Release(texture->staging); in D3D_DestroyTextureRep()
511 texture->staging = NULL; in D3D_DestroyTextureRep()
516 D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) in D3D_CreateTexture() argument
526 …texturedata->scaleMode = (texture->scaleMode == SDL_ScaleModeNearest) ? D3DTEXF_POINT : D3DTEXF_LI… in D3D_CreateTexture()
528 texture->driverdata = texturedata; in D3D_CreateTexture()
530 if (texture->access == SDL_TEXTUREACCESS_TARGET) { in D3D_CreateTexture()
536 …ep(data->device, &texturedata->texture, usage, texture->format, PixelFormatToD3DFMT(texture->forma… in D3D_CreateTexture()
540 if (texture->format == SDL_PIXELFORMAT_YV12 || in D3D_CreateTexture()
541 texture->format == SDL_PIXELFORMAT_IYUV) { in D3D_CreateTexture()
544 …e, &texturedata->utexture, usage, texture->format, PixelFormatToD3DFMT(texture->format), (texture-… in D3D_CreateTexture()
548 …e, &texturedata->vtexture, usage, texture->format, PixelFormatToD3DFMT(texture->format), (texture-… in D3D_CreateTexture()
556 D3D_RecreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) in D3D_RecreateTexture() argument
559 D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; in D3D_RecreateTexture()
565 if (D3D_RecreateTextureRep(data->device, &texturedata->texture) < 0) { in D3D_RecreateTexture()
582 D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, in D3D_UpdateTexture() argument
586 D3D_TextureData *texturedata = (D3D_TextureData *) texture->driverdata; in D3D_UpdateTexture()
593 …if (D3D_UpdateTextureRep(data->device, &texturedata->texture, rect->x, rect->y, rect->w, rect->h, … in D3D_UpdateTexture()
601 …if (D3D_UpdateTextureRep(data->device, texture->format == SDL_PIXELFORMAT_YV12 ? &texturedata->vte… in D3D_UpdateTexture()
607 …if (D3D_UpdateTextureRep(data->device, texture->format == SDL_PIXELFORMAT_YV12 ? &texturedata->ute… in D3D_UpdateTexture()
615 D3D_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, in D3D_UpdateTextureYUV() argument
622 D3D_TextureData *texturedata = (D3D_TextureData *) texture->driverdata; in D3D_UpdateTextureYUV()
629 …if (D3D_UpdateTextureRep(data->device, &texturedata->texture, rect->x, rect->y, rect->w, rect->h, … in D3D_UpdateTextureYUV()
642 D3D_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, in D3D_LockTexture() argument
646 D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; in D3D_LockTexture()
659 texturedata->pitch = texture->w; in D3D_LockTexture()
660 texturedata->pixels = (Uint8 *)SDL_malloc((texture->h * texturedata->pitch * 3) / 2); in D3D_LockTexture()
667 rect->x * SDL_BYTESPERPIXEL(texture->format)); in D3D_LockTexture()
674 if (D3D_CreateStagingTexture(device, &texturedata->texture) < 0) { in D3D_LockTexture()
683 result = IDirect3DTexture9_LockRect(texturedata->texture.staging, 0, &locked, &d3drect, 0); in D3D_LockTexture()
694 D3D_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) in D3D_UnlockTexture() argument
697 D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; in D3D_UnlockTexture()
707 rect->x * SDL_BYTESPERPIXEL(texture->format)); in D3D_UnlockTexture()
708 D3D_UpdateTexture(renderer, texture, rect, pixels, texturedata->pitch); in D3D_UnlockTexture()
710 IDirect3DTexture9_UnlockRect(texturedata->texture.staging, 0); in D3D_UnlockTexture()
711 texturedata->texture.dirty = SDL_TRUE; in D3D_UnlockTexture()
712 if (data->drawstate.texture == texture) { in D3D_UnlockTexture()
713 data->drawstate.texture = NULL; in D3D_UnlockTexture()
726 D3D_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_ScaleMode scaleMode) in D3D_SetTextureScaleMode() argument
728 D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; in D3D_SetTextureScaleMode()
738 D3D_SetRenderTargetInternal(SDL_Renderer * renderer, SDL_Texture * texture) in D3D_SetRenderTargetInternal() argument
752 if (texture == NULL) { in D3D_SetRenderTargetInternal()
757 texturedata = (D3D_TextureData *)texture->driverdata; in D3D_SetRenderTargetInternal()
764 texturerep = &texturedata->texture; in D3D_SetRenderTargetInternal()
766 if (!texturerep->texture) { in D3D_SetRenderTargetInternal()
768 … PixelFormatToD3DFMT(texturerep->format), D3DPOOL_DEFAULT, &texturerep->texture, NULL); in D3D_SetRenderTargetInternal()
774 …evice, (IDirect3DBaseTexture9 *)texturerep->staging, (IDirect3DBaseTexture9 *)texturerep->texture); in D3D_SetRenderTargetInternal()
781 …result = IDirect3DTexture9_GetSurfaceLevel(texturedata->texture.texture, 0, &data->currentRenderTa… in D3D_SetRenderTargetInternal()
794 D3D_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) in D3D_SetRenderTarget() argument
800 return D3D_SetRenderTargetInternal(renderer, texture); in D3D_SetRenderTarget()
881 D3D_QueueCopy(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * texture, in D3D_QueueCopy() argument
901 minu = (float) srcrect->x / texture->w; in D3D_QueueCopy()
902 maxu = (float) (srcrect->x + srcrect->w) / texture->w; in D3D_QueueCopy()
903 minv = (float) srcrect->y / texture->h; in D3D_QueueCopy()
904 maxv = (float) (srcrect->y + srcrect->h) / texture->h; in D3D_QueueCopy()
942 D3D_QueueCopyEx(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * texture, in D3D_QueueCopyEx() argument
964 minu = (float) (srcquad->x + srcquad->w) / texture->w; in D3D_QueueCopyEx()
965 maxu = (float) srcquad->x / texture->w; in D3D_QueueCopyEx()
967 minu = (float) srcquad->x / texture->w; in D3D_QueueCopyEx()
968 maxu = (float) (srcquad->x + srcquad->w) / texture->w; in D3D_QueueCopyEx()
972 minv = (float) (srcquad->y + srcquad->h) / texture->h; in D3D_QueueCopyEx()
973 maxv = (float) srcquad->y / texture->h; in D3D_QueueCopyEx()
975 minv = (float) srcquad->y / texture->h; in D3D_QueueCopyEx()
976 maxv = (float) (srcquad->y + srcquad->h) / texture->h; in D3D_QueueCopyEx()
1023 UpdateDirtyTexture(IDirect3DDevice9 *device, D3D_TextureRep *texture) in UpdateDirtyTexture() argument
1025 if (texture->dirty && texture->staging) { in UpdateDirtyTexture()
1027 if (!texture->texture) { in UpdateDirtyTexture()
1028 … result = IDirect3DDevice9_CreateTexture(device, texture->w, texture->h, 1, texture->usage, in UpdateDirtyTexture()
1029 PixelFormatToD3DFMT(texture->format), D3DPOOL_DEFAULT, &texture->texture, NULL); in UpdateDirtyTexture()
1035 …UpdateTexture(device, (IDirect3DBaseTexture9 *)texture->staging, (IDirect3DBaseTexture9 *)texture-… in UpdateDirtyTexture()
1039 texture->dirty = SDL_FALSE; in UpdateDirtyTexture()
1045 BindTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, DWORD sampler) in BindTextureRep() argument
1048 UpdateDirtyTexture(device, texture); in BindTextureRep()
1049 … result = IDirect3DDevice9_SetTexture(device, sampler, (IDirect3DBaseTexture9 *)texture->texture); in BindTextureRep()
1073 SetupTextureState(D3D_RenderData *data, SDL_Texture * texture, LPDIRECT3DPIXELSHADER9 *shader) in SetupTextureState() argument
1075 D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; in SetupTextureState()
1086 if (BindTextureRep(data->device, &texturedata->texture, 0) < 0) { in SetupTextureState()
1091 switch (SDL_GetYUVConversionModeForResolution(texture->w, texture->h)) { in SetupTextureState()
1123 SDL_Texture *texture = cmd->data.draw.texture; in SetDrawState() local
1126 if (texture != data->drawstate.texture) { in SetDrawState()
1127 …D3D_TextureData *oldtexturedata = data->drawstate.texture ? (D3D_TextureData *) data->drawstate.te… in SetDrawState()
1128 D3D_TextureData *newtexturedata = texture ? (D3D_TextureData *) texture->driverdata : NULL; in SetDrawState()
1132 if (texture == NULL) { in SetDrawState()
1139 if (texture && SetupTextureState(data, texture, &shader) < 0) { in SetDrawState()
1151 data->drawstate.texture = texture; in SetDrawState()
1152 } else if (texture) { in SetDrawState()
1153 D3D_TextureData *texturedata = (D3D_TextureData *) texture->driverdata; in SetDrawState()
1154 UpdateDirtyTexture(data->device, &texturedata->texture); in SetDrawState()
1527 D3D_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) in D3D_DestroyTexture() argument
1530 D3D_TextureData *data = (D3D_TextureData *) texture->driverdata; in D3D_DestroyTexture()
1532 if (renderdata->drawstate.texture == texture) { in D3D_DestroyTexture()
1533 renderdata->drawstate.texture = NULL; in D3D_DestroyTexture()
1547 D3D_DestroyTextureRep(&data->texture); in D3D_DestroyTexture()
1552 texture->driverdata = NULL; in D3D_DestroyTexture()
1604 SDL_Texture *texture; in D3D_Reset() local
1618 for (texture = renderer->textures; texture; texture = texture->next) { in D3D_Reset()
1619 if (texture->access == SDL_TEXTUREACCESS_TARGET) { in D3D_Reset()
1620 D3D_DestroyTexture(renderer, texture); in D3D_Reset()
1622 D3D_RecreateTexture(renderer, texture); in D3D_Reset()
1646 for (texture = renderer->textures; texture; texture = texture->next) { in D3D_Reset()
1647 if (texture->access == SDL_TEXTUREACCESS_TARGET) { in D3D_Reset()
1648 D3D_CreateTexture(renderer, texture); in D3D_Reset()
1658 data->drawstate.texture = NULL; in D3D_Reset()