Coder Social home page Coder Social logo

Comments (10)

leadedge avatar leadedge commented on June 8, 2024

I assume that this works for DirectX 11 because CreateDX11device does not need a window handle.

For DirectX 9, hwnd is used for "CreateDeviceEx. The specification says that "For windowed mode, this parameter (hFocusWindow) may be NULL only if the hDeviceWindow member of pPresentationParameters is set to a valid, non-NULL value.", so that means one way or another hwnd is needed, so I included it twice.

CreateDeviceEx probably needs a check for NULL hwnd.

I am surprised that the interop still works. After wglGetCurrentContext(), does wglGetCurrentDC() return NULL?

from spout2.

Qlex42 avatar Qlex42 commented on June 8, 2024

Indeed wglGetCurrentDC return a non NULL value. So an offscreen OpenGL context have a Device Context but no windows attached on it.

It seems normal because I create offscreen openGL context with this command list:

HDC hDC = getDC(commonMainHWND); // new DC handle
HGLRC hRC = wglCreateContext(hDC);
wglShareLists(commonRC, hRC);
...

Indeed, this seems to work with DirectX11 only. If I remove the hWnd Null check from SpoutSDK.cpp , DirectX9 implementation do not seems to be happy. So if(g_hWnd == NULL && interop.m_bUseDX9) seems to be the best option.
If I understand the specification, maybe DirectX9 in full screen mode can probably benefit from this too. But I have no code available to made this kind of tests.

By the way, thanks a lot for your reactivity.

from spout2.

leadedge avatar leadedge commented on June 8, 2024

In practice I find that hwnd can be NULL for CreateDeviceEx, probably because the device is never used for rendering and is is only used to create a shared texture. But the function is never intended to work in this way, so hwnd should be included I think.

You will notice a comment in "OpenSpout" (which gets g_hWnd), so the test for hwnd could be included in "OpenSpout" and would then be redundant in "OpenReceiver".

I will give this more thought before making any changes. Meanwhile it solves the problem for your project.

from spout2.

leadedge avatar leadedge commented on June 8, 2024

Latest commit changed OpenSpout to fail for DX9 if no hwnd.

OpenSpout precedes the tests in OpenReceiver so they are no longer needed. Please let me know if this modification works or does not work.

from spout2.

Qlex42 avatar Qlex42 commented on June 8, 2024

Hi Lynn,

Indeed your change seems to fix my issue perfectly.
Thanks a lot for this.
Tested with AMD FirePro w2100, w9100 and NVidia 780GTX

Regards.

from spout2.

leadedge avatar leadedge commented on June 8, 2024

OK thanks for the quick response.

It's interesting that your FirePro W2100 works OK. There has been some trouble with FirePro W7100. That seemed to require DirectX 11. It caused some corruption problem and the cause is unknown.

from spout2.

Qlex42 avatar Qlex42 commented on June 8, 2024

I only test Spout Receiver with W2100 W9100 and 780GTX with DirectX 11 and Memory Share successfully. Because my receiver use offscreen rendering context, I cannot test DirectX9 for now.

For spout Sender, Its working with W2100, W9100, 780GTX, DirectX 9, DirectX 11 and Memory Share perfectly.

(All in Windows 7 SP1 64)
(for AMD my driver version is 15.301.2601)
Hope this can help.

from spout2.

leadedge avatar leadedge commented on June 8, 2024

Yes this information does help and adds to the knowledgebase. Windows 7 might be the key, but who knows. I will close this one for now. Good luck with your project.

from spout2.

Qlex42 avatar Qlex42 commented on June 8, 2024

Thanks you for all of this,
Our project with Spout support public release will be ready soon.
I hope to made its logo and appears on the spout.zeal.co web site if possible.

Best regards.

from spout2.

leadedge avatar leadedge commented on June 8, 2024

OK sounds good. Email direct to [email protected] with the logo image - png if it has transparency. Feel free to make a post on the Announcements forum.

Edit : or Showcase as you wish.

from spout2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.