No description
Find a file
Sam Lantinga ce7104f384 Fixed bug 2625 - Direct3D9 with SDL_TEXTUREACCESS_TARGET textures causes an application crash
Roberto

I have debugged the code checking the function calls when Direct3D is the renderer, remember that with software and OpenGL renderers, this issue is not happening.

- Create the texture:
SDL_Texture *pTex = SDL_CreateTexture(pRenderer, iFormat, SDL_TEXTUREACCESS_TARGET, pSurf->w, pSurf->h);

- Update the texture:
SDL_UpdateTexture(pTex, NULL, pSurf->pixels, pSurf->pitch);
  SDL_render.c, SDL_UpdateTexture(): return renderer->UpdateTexture(renderer, texture, rect, pixels, pitch);
    SDL_render_d3d.c, D3D_UpdateTexture(): if (D3D_UpdateTextureRep(data->device, &texturedata->texture, texture->format, rect->x, rect->y, rect->w, rect->h, pixels, pitch) < 0) {
      SDL_render_d3d.c, D3D_UpdateTextureRep(): if (D3D_CreateStagingTexture(device, texture) < 0) {
        SDL_render_d3d.c, D3D_CreateStagingTexture(): result = IDirect3DDevice9_CreateTexture(..., D3DPOOL_SYSTEMMEM, ...) --> FAIL! with INVALIDCALL code

After checking a bit the Microsoft documentation, I found this:

D3DUSAGE_RENDERTARGET can only be used with D3DPOOL_DEFAULT. (bb172625%28v=vs.85%29.aspx)

The call that fails, is using D3DUSAGE_RENDERTARGET with D3DPOOL_SYSTEMMEM which is unsupported, hence the INVALIDCALL return code.
2015-06-04 00:56:11 -07:00
acinclude Fix a libtool issue with some mingw-w64 cross compilers (thanks, Ozkan!). 2015-05-26 19:54:06 -04:00
android-project Android: Added missing space in three log messages. 2015-05-31 19:23:16 +02:00
build-scripts Script from Sylvain to automate updating the copyright year 2015-05-26 06:27:12 -07:00
cmake CMake: fix CHECK_OBJC_SOURCE_COMPILES to work with GCC (thanks, Ivan!). 2015-04-07 20:01:43 -04:00
debian Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
docs Fixed typo in gesture README. 2015-04-07 23:00:56 +02:00
include Fixed SDL_ISPIXELFORMAT_ALPHA to check pixel orders that match pixel type. 2015-05-31 01:45:20 -04:00
premake X11: Add Xdbe support to message boxes (thanks, Melker!). 2015-05-28 00:30:21 -04:00
src Fixed bug 2625 - Direct3D9 with SDL_TEXTUREACCESS_TARGET textures causes an application crash 2015-06-04 00:56:11 -07:00
test testmessage: Try Unicode chars in the title, too. 2015-05-31 23:53:10 -04:00
VisualC Turned on OmitDefaultLibName for SDL, SDLmain and SDLtest 2014-07-27 19:56:53 -07:00
VisualC-WinRT WinRT: enabled OpenGL ES 2 support on Windows Phone 2014-11-02 10:32:25 -05:00
visualtest Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Xcode Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Xcode-iOS Fixed building test programs on the iOS simulator 2015-05-28 18:57:57 -07:00
.hgignore Ignore some more test binaries. 2015-04-10 22:31:52 -05:00
.hgtags
Android.mk Android: Replaced spaces with tab in Android.mk file. 2015-05-06 21:11:06 +02:00
autogen.sh
BUGS.txt
cmake_uninstall.cmake.in Add suport for "make uninstall" to cmake. 2014-06-16 10:58:09 -03:00
CMakeLists.txt CMake: Slightly better fix for installation target (thanks, Anthony!). 2015-04-22 20:25:19 -04:00
configure X11: Add Xdbe support to message boxes (thanks, Melker!). 2015-05-28 00:30:21 -04:00
configure.in X11: Add Xdbe support to message boxes (thanks, Melker!). 2015-05-28 00:30:21 -04:00
COPYING.txt Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
CREDITS.txt
INSTALL.txt Moved documentation to docs, recreated a simple README.txt, fixed build 2014-07-29 08:04:15 -07:00
Makefile.in Make autoconf-based build quiet by default. 2014-06-19 00:40:09 -04:00
Makefile.minimal
Makefile.pandora
Makefile.psp
Makefile.wiz
README-SDL.txt Moved documentation to docs, recreated a simple README.txt, fixed build 2014-07-29 08:04:15 -07:00
README.txt Moved documentation to docs, recreated a simple README.txt, fixed build 2014-07-29 08:04:15 -07:00
sdl2-config.in
sdl2.m4
sdl2.pc.in
SDL2.spec.in Some corrections to the SDL2.spec.in (thanks, Simone!). 2015-02-19 13:42:56 -05:00
TODO.txt
VisualC.html Fixed nesting of HTML elements in documentation. 2014-06-09 17:37:59 +02:00
WhatsNew.txt Chrome's Native Client backend implementation 2014-06-06 15:45:59 -03:00

                         Simple DirectMedia Layer

                                  (SDL)

                                Version 2.0

---
http://www.libsdl.org/

Simple DirectMedia Layer is a cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics
hardware via OpenGL and Direct3D. It is used by video playback software,
emulators, and popular games including Valve's award winning catalog
and many Humble Bundle games.

More extensive documentation is available in the docs directory, starting
with README.md

Enjoy!
	Sam Lantinga				(slouken@libsdl.org)