DirectX - Failed loading D3DX9_*.dll

[email protected] (kmx) Tue, 05 Mar 2013 11:09:05 +0100
Newsgroups perl.sdl.devel
Message-ID <[email protected]>
--------------070408020908040205080501
Content-Type: multipart/alternative;
 boundary="------------000102090902070302010408"


--------------000102090902070302010408
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Kartik and Tobias,

ad our last discussion on IRC.

I have investigated the warning "Failed loading D3DX9_*.dll" and come up 
with the enclosed patch (please forward it to relevant SDL2 mailing 
list/bugtracker).

The warning has gone and DirectX seems to be loaded but I was not able to 
test it more.

New binaries:
http://strawberryperl.com/package/kmx/sdl/32bit_SDL2_20130305.zip
http://strawberryperl.com/package/kmx/sdl/64bit_SDL2_20130305.zip

Alien-SDL2 on github was also updated

--
kmx

--------------000102090902070302010408
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <font face="Helvetica, Arial, sans-serif">Hi Kartik and Tobias,<br>
      <br>
      ad our last discussion on IRC.<br>
      <br>
      I have investigated the warning "Failed loading D3DX9_*.dll" and
      come up with the enclosed patch (please forward it to relevant
      SDL2 mailing list/bugtracker).<br>
      <br>
      The warning has gone and DirectX seems to be loaded but I was not
      able to test it more.<br>
      <br>
      New binaries:<br>
      <a class="moz-txt-link-freetext" href="http://strawberryperl.com/package/kmx/sdl/32bit_SDL2_20130305.zip">http://strawberryperl.com/package/kmx/sdl/32bit_SDL2_20130305.zip</a><br>
      <a class="moz-txt-link-freetext" href="http://strawberryperl.com/package/kmx/sdl/64bit_SDL2_20130305.zip">http://strawberryperl.com/package/kmx/sdl/64bit_SDL2_20130305.zip</a><br>
      <br>
      Alien-SDL2 on github was also updated<br>
      <br>
      --<br>
      kmx<br>
    </font>
  </body>
</html>

--------------000102090902070302010408--

--------------070408020908040205080501
Content-Type: text/plain; charset=windows-1250;
 name="SDL2-hg20130301.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="SDL2-hg20130301.diff"

--- /z/strawberry_libs/SDL2-hg20130301/src/render/direct3d/SDL_render_d3d.c	2013-02-28 17:11:04 +0000
+++ /z/strawberry_libs/SDL2-hg20130301_patched/src/render/direct3d/SDL_render_d3d.c	2013-03-05 09:38:04 +0000
@@ -477,7 +477,9 @@
 
         for (d3dxVersion=50;d3dxVersion>0;d3dxVersion--) {
             SDL_snprintf(d3dxDLLFile, 49, "D3DX9_%02d.dll", d3dxVersion);
-            data->d3dxDLL = SDL_LoadObject(d3dxDLLFile);
+            LPTSTR tmpstr = WIN_UTF8ToString(d3dxDLLFile);
+            data->d3dxDLL = (void *)LoadLibrary(tmpstr); /* not using SDL_LoadObject() as we want silently fail - no error message */
+            SDL_free(tmpstr);
             if (data->d3dxDLL) {
                 HRESULT (WINAPI *D3DXCreateMatrixStack) (DWORD Flags, LPD3DXMATRIXSTACK*  ppStack);
                 D3DXCreateMatrixStack = (HRESULT (WINAPI *) (DWORD, LPD3DXMATRIXSTACK*)) SDL_LoadFunction(data->d3dxDLL, "D3DXCreateMatrixStack");

--------------070408020908040205080501--