Thread overview | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
October 03, 2013 directx bindings problem | ||||
---|---|---|---|---|
| ||||
i'm trying directx bindings from dsource (http://dsource.org/projects/bindings/wiki/DirectX) and encountered problem, when calling swap chain getbuffer it suddenly crashes. does anyone using it? any help please :( // Create a render target view ID3D11Texture2D* pBackBuffer; // C++ version //hr = g_pSwapChain->GetBuffer( 0, __uuidof( ID3D11Texture2D ),(LPVOID*)&pBackBuffer ); // D version(crashes) hr = g_pSwapChain.GetBuffer( 0, &IID_ID3D11Texture2D, cast(LPVOID*)pBackBuffer ); |
October 03, 2013 Re: directx bindings problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to evilrat | Am 03.10.2013 08:19, schrieb evilrat:
> i'm trying directx bindings from dsource
> (http://dsource.org/projects/bindings/wiki/DirectX)
> and encountered problem, when calling swap chain getbuffer it suddenly
> crashes. does anyone using it? any help please :(
>
> // Create a render target view
> ID3D11Texture2D* pBackBuffer;
>
> // C++ version
> //hr = g_pSwapChain->GetBuffer( 0, __uuidof( ID3D11Texture2D
> ),(LPVOID*)&pBackBuffer );
>
> // D version(crashes)
> hr = g_pSwapChain.GetBuffer( 0, &IID_ID3D11Texture2D,
> cast(LPVOID*)pBackBuffer );
What directX .lib file are you linking against?
Whats the exact error that is given to you?
When you run this from within visual studio you might get additional information about the problem.
Kind Regards
Bejamin Thaut
|
October 03, 2013 Re: directx bindings problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to Benjamin Thaut | On Thursday, 3 October 2013 at 09:35:46 UTC, Benjamin Thaut wrote:
> Am 03.10.2013 08:19, schrieb evilrat:
>> i'm trying directx bindings from dsource
>> (http://dsource.org/projects/bindings/wiki/DirectX)
>> and encountered problem, when calling swap chain getbuffer it suddenly
>> crashes. does anyone using it? any help please :(
>>
>> // Create a render target view
>> ID3D11Texture2D* pBackBuffer;
>>
>> // C++ version
>> //hr = g_pSwapChain->GetBuffer( 0, __uuidof( ID3D11Texture2D
>> ),(LPVOID*)&pBackBuffer );
>>
>> // D version(crashes)
>> hr = g_pSwapChain.GetBuffer( 0, &IID_ID3D11Texture2D,
>> cast(LPVOID*)pBackBuffer );
>
> What directX .lib file are you linking against?
> Whats the exact error that is given to you?
> When you run this from within visual studio you might get additional information about the problem.
>
> Kind Regards
> Bejamin Thaut
d3dcompiler.lib, d3d11.lib, dxgi.lib
i can't get any details on it, as it seems to be somewhere inside DirectX C++ part. i was thinking this is GUID problem, so i'd tried using IIDFromString on D3D11Texture2d GUID to get actual value with no luck(it always report invalid args).
|
October 03, 2013 Re: directx bindings problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to evilrat | Am 03.10.2013 11:57, schrieb evilrat: > On Thursday, 3 October 2013 at 09:35:46 UTC, Benjamin Thaut wrote: >> Am 03.10.2013 08:19, schrieb evilrat: >>> i'm trying directx bindings from dsource >>> (http://dsource.org/projects/bindings/wiki/DirectX) >>> and encountered problem, when calling swap chain getbuffer it suddenly >>> crashes. does anyone using it? any help please :( >>> >>> // Create a render target view >>> ID3D11Texture2D* pBackBuffer; >>> >>> // C++ version >>> //hr = g_pSwapChain->GetBuffer( 0, __uuidof( ID3D11Texture2D >>> ),(LPVOID*)&pBackBuffer ); >>> >>> // D version(crashes) >>> hr = g_pSwapChain.GetBuffer( 0, &IID_ID3D11Texture2D, >>> cast(LPVOID*)pBackBuffer ); >> >> What directX .lib file are you linking against? >> Whats the exact error that is given to you? >> When you run this from within visual studio you might get additional >> information about the problem. >> >> Kind Regards >> Bejamin Thaut > > > d3dcompiler.lib, d3d11.lib, dxgi.lib > > i can't get any details on it, as it seems to be somewhere inside > DirectX C++ part. i was thinking this is GUID problem, so i'd tried > using IIDFromString on D3D11Texture2d GUID to get actual value with no > luck(it always report invalid args). NO I mean are you sure the library paths are correctly set to the "June 2010 DirectX SDK/lib" path? Do you use 32 or 64 bit? You can get details on crashes inside DirectX by using the microsoft symbol server: http://support.microsoft.com/kb/311503 (assuming you use the microsoft debugger of course) Kind Regards Benjamin Thaut |
October 03, 2013 Re: directx bindings problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to Benjamin Thaut | On Thursday, 3 October 2013 at 10:08:42 UTC, Benjamin Thaut wrote: > > NO I mean are you sure the library paths are correctly set to the "June 2010 DirectX SDK/lib" path? all paths are set correctly. > Do you use 32 or 64 bit? 32 bit. > You can get details on crashes inside DirectX by using the microsoft symbol server: http://support.microsoft.com/kb/311503 (assuming you use the microsoft debugger of course) i'm using visual studio debugger, maybe i should try this. but as i said it looks like guid problem. |
October 03, 2013 Re: directx bindings problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to evilrat | Am 03.10.2013 12:47, schrieb evilrat:
> On Thursday, 3 October 2013 at 10:08:42 UTC, Benjamin Thaut wrote:
>>
>> NO I mean are you sure the library paths are correctly set to the
>> "June 2010 DirectX SDK/lib" path?
>
> all paths are set correctly.
>
>> Do you use 32 or 64 bit?
>
> 32 bit.
>
>> You can get details on crashes inside DirectX by using the microsoft
>> symbol server: http://support.microsoft.com/kb/311503 (assuming you
>> use the microsoft debugger of course)
>
> i'm using visual studio debugger, maybe i should try this. but as i said
> it looks like guid problem.
If you think it is a guid problem you could just open the c++ header lookup the GUID and compare it to the one in derlict
|
October 03, 2013 Re: directx bindings problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to Benjamin Thaut | On Thursday, 3 October 2013 at 11:21:14 UTC, Benjamin Thaut wrote:
> Am 03.10.2013 12:47, schrieb evilrat:
>> On Thursday, 3 October 2013 at 10:08:42 UTC, Benjamin Thaut wrote:
>>>
>>> NO I mean are you sure the library paths are correctly set to the
>>> "June 2010 DirectX SDK/lib" path?
>>
>> all paths are set correctly.
>>
>>> Do you use 32 or 64 bit?
>>
>> 32 bit.
>>
>>> You can get details on crashes inside DirectX by using the microsoft
>>> symbol server: http://support.microsoft.com/kb/311503 (assuming you
>>> use the microsoft debugger of course)
>>
>> i'm using visual studio debugger, maybe i should try this. but as i said
>> it looks like guid problem.
>
> If you think it is a guid problem you could just open the c++ header lookup the GUID and compare it to the one in derlict
this is not derelict, it's old directx bindings that was part of winapi bindings i think.
|
October 03, 2013 Re: directx bindings problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to evilrat | On 10/3/13, evilrat <evilrat666@gmail.com> wrote:
> // Create a render target view
> ID3D11Texture2D* pBackBuffer;
>
> // C++ version
> //hr = g_pSwapChain->GetBuffer( 0, __uuidof( ID3D11Texture2D
> ),(LPVOID*)&pBackBuffer );
>
> // D version(crashes)
> hr = g_pSwapChain.GetBuffer( 0, &IID_ID3D11Texture2D,
> cast(LPVOID*)pBackBuffer );
>
You're passing a null pointer (pBackBuffer). You should try this:
ID3D11Texture2D backBuffer;
hr = g_pSwapChain.GetBuffer( 0, &IID_ID3D11Texture2D,
cast(LPVOID*)&backBuffer );
|
October 03, 2013 Re: directx bindings problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | On Thursday, 3 October 2013 at 11:30:58 UTC, Andrej Mitrovic wrote:
> On 10/3/13, evilrat <evilrat666@gmail.com> wrote:
>> // Create a render target view
>> ID3D11Texture2D* pBackBuffer;
>>
>> // C++ version
>> //hr = g_pSwapChain->GetBuffer( 0, __uuidof( ID3D11Texture2D
>> ),(LPVOID*)&pBackBuffer );
>>
>> // D version(crashes)
>> hr = g_pSwapChain.GetBuffer( 0, &IID_ID3D11Texture2D,
>> cast(LPVOID*)pBackBuffer );
>>
>
> You're passing a null pointer (pBackBuffer). You should try this:
>
> ID3D11Texture2D backBuffer;
> hr = g_pSwapChain.GetBuffer( 0, &IID_ID3D11Texture2D,
> cast(LPVOID*)&backBuffer );
this not works too(actually it would never be, because this is just interface).
what i'm trying to do is what works on c++ just fine, so that texture should be null.
actually now i'm think this bindings too outdated, or there is some ABI mismatch which i can't find out now... either way, i think creating a custom binding would be the best way.
thanks for help anyway.
|
October 06, 2013 Re: directx bindings problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to evilrat | On Thursday, 3 October 2013 at 06:19:27 UTC, evilrat wrote:
> i'm trying directx bindings from dsource (http://dsource.org/projects/bindings/wiki/DirectX)
> and encountered problem, when calling swap chain getbuffer it suddenly crashes. does anyone using it? any help please :(
>
> // Create a render target view
> ID3D11Texture2D* pBackBuffer;
>
> // C++ version
> //hr = g_pSwapChain->GetBuffer( 0, __uuidof( ID3D11Texture2D ),(LPVOID*)&pBackBuffer );
>
> // D version(crashes)
> hr = g_pSwapChain.GetBuffer( 0, &IID_ID3D11Texture2D, cast(LPVOID*)pBackBuffer );
well, after some research i can state that those bindings sucks. (is this actually bidings and not simply find & replace on C++ header?)
1) they declare C++ double ptr (i.e. void**) as plain D "out"!!!
2) this bindings handles C++ const &struct just declaring it as pointer!!!11!1 (or maybe i'm so noob?)
and finally,
3) i hate how author handled enums...(just personal opinion)
omg i need to fully rewrite this and add wrapper for C++ const ref before it would be even usable...
i'll post again when i do something. thanks for attention everyone.
|
Copyright © 1999-2021 by the D Language Foundation