Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 12 Apr 2010
Offline Last Active Today, 04:18 PM

Posts I've Made

In Topic: Debug graphics with VS2013. Error on launch.

Today, 02:52 PM

Hello Jason,


I'm happy that you replied. I'm your fun, your book is amazing smile.png.


I found a workaround, but still have questions. Hope that experienced guys help me.


On Win8 everything works without problems. So I'll talk about Win7 only. On Win7 I have lastest updates. Previously I used this code to get a factory:

ComPtr<IDXGIFactory2> factory2;
HRESULT hr = CreateDXGIFactory1(__uuidof(IDXGIFactory1), (void**)(&factory2));

This code was called after device and context creation. Now I can see that I'm creating IDXGIFactory2 with  CreateDXGIFactory1 method. That's weird, but this works!! How!!??


Now I use this this code for factory obtain:

ComPtr<IDXGIDevice> dxgiDevice;
device->QueryInterface(__uuidof(IDXGIDevice), reinterpret_cast<void**>(dxgiDevice.GetAddressOf()));

ComPtr<IDXGIAdapter> adapter;

ComPtr<IDXGIFactory1> factory1;
adapter->GetParent(__uuidof(IDXGIFactory1), reinterpret_cast<void**>(factory1.GetAddressOf()));

ComPtr<IDXGIFactory2> factory2;
factory1.Get()->QueryInterface(__uuidof(IDXGIFactory2), reinterpret_cast<void**>(factory2.GetAddressOf()));

This code also works. And in addition debugger works too.


So my question - what is a correct way to get a factory? Is it absolutelly wrong to get it using CreateDXGIFactory1? Or should I obtain it throug existing device? Sorry if unclear, please feel free to correct/ask.


@SeanMiddleditch Thank you for reply. You're right - CreateSwapChainForHwnd needs IDXGIFactory2 interface. I tried win32 sample on Win7 - https://code.msdn.microsoft.com/windowsdesktop/Direct3D-Tutorial-Win32-829979ef - this sample uses lastest factory and it works.

In Topic: Creating a game launcher.

25 November 2014 - 04:22 AM

Thank you guys. That helped a lot.


Agent is primarily responsible for launching and updating the games, so a broken agent leads to a couple of problems.



So agent is also installing a game, right? How can it do so? For example, for initial installation we use third-party installer. But since game should be installed from some executable and should have some feedback from installation process how to do this? For example, Battle.net allows to start a game before full download/update.


You could also download the new version into a temporary location, launch that, then if that succeeds, have it delete the old version and move itself into that location. This has the advantage that the old launcher.exe won't be replaced if the update is botched and gets a new but broken .exe for some reason.



Thanks a lot, that's very clever.


then you have a secondary program, signed with a certificate and flagged to require administrative rights



Does that means that I can run this program without user permission? Or every time user starts such program he will need to approve?

In Topic: OMSetRenderTargets is very slow on my machine.

21 November 2014 - 11:45 AM

Oh. Thank you. Also I noticed that DXGI_SWAP_CHAIN_DESC::SwapEffect also have an effect on fps. But DXGI_SWAP_CHAIN_DESC::BufferDesc::RefreshRate have no effect at all. Can someone please explain how this works in simple words. I've read msdn but it so dry and it's hard to understand for not experienced guy like me.

In Topic: OMSetRenderTargets is very slow on my machine.

21 November 2014 - 10:54 AM

Disable v-sync. 


L. Spiro, how? As far as I know in windowed mode vsync is off by default and there's no way to enable it. And I have the same problems in windowed mode.

In Topic: Get error description from HRESULT

14 November 2014 - 03:16 PM

Sorry for unclear question. Let's make it step by step.


I'm building in debug mode. I provided a debug flag. I can see refcount with debug layer.


Most of the direct3d calls return HRESULT. I tested with D3D11CreateDeviceAndSwapChain - I provided feature that my gpu doesn't support and also tried tosupplywrong BufferCount. In both cases I receive failed HRESULT and can see correct message in VS output console. I would like to have same description in the code.


I'm not linking any libraries since it don't necessary. I'm using source files from here http://blogs.msdn.com/b/chuckw/archive/2012/04/24/where-s-dxerr-lib.aspx. And DXGetErrorDescription returns wrong description - something with audio.


I know that directx stuff changes often and dramatically with every new release of visual studio or with new windows update. And what worked yesterday doesn't work now. But I think there's a new way to obtain errors I just can't find.