- In the extension bar, click the AdBlock Plus icon
- Click the large blue toggle for this website
- Click refresh
- In the extension bar, click the AdBlock icon
- Under "Pause on this site" click "Always"
- In the extension bar, click on the Adguard icon
- Click on the large green toggle for this website
- In the extension bar, click on the Ad Remover icon
- Click "Disable on This Website"
- In the extension bar, click on the orange lion icon
- Click the toggle on the top right, shifting from "Up" to "Down"
- In the extension bar, click on the Ghostery icon
- Click the "Anti-Tracking" shield so it says "Off"
- Click the "Ad-Blocking" stop sign so it says "Off"
- Refresh the page
- In the extension bar, click on the uBlock Origin icon
- Click on the big, blue power button
- Refresh the page
- In the extension bar, click on the uBlock icon
- Click on the big, blue power button
- Refresh the page
- In the extension bar, click on the UltraBlock icon
- Check the "Disable UltraBlock" checkbox
- Please disable your Ad Blocker
- Disable any DNS blocking tools such as AdGuardDNS or NextDNS
- Disable any privacy or tracking protection extensions such as Firefox Enhanced Tracking Protection or DuckDuckGo Privacy.
If the prompt is still appearing, please disable any tools or services you are using that block internet ads (e.g. DNS Servers, tracking protection or privacy extensions).
Question
Andre S. Veteran
I'm trying to make a video player in WPF, using libavcodec for decoding and OpenGL for rendering.
I host my own C++/CLI control derived from Windows.Forms.UserControl inside a WindowsFormsHost. I use its Handle to initialize an OpenGL context.
Here is the code for my override of OnPaint:
This works fine. When OnPaint is called, the control, which covers the whole window, is cleared to red.
Now, WPF controls when OnPaint is called, not me. When I'll be rendering video, I need to be able to draw to the screen when I decide to. So I've put the above code in an infinite loop and made it execute on a BackgroundWorker thread. Now, the problem is that wglMakeCurrent fails in this situation with"error 170: the requested resource is in use". Consequently, the call to glClear() (and any further rendering) does nothing.
I don't understand exactly which resource is in use and why, and I'd like to know what's wrong with my approach.
Thanks!
P.S. here is the initialization code in case this could be useful. It is hooked to the "Load" event of the control. And yes this is essentially copy-pasted from a tutorial on the net.
Link to comment
https://www.neowin.net/forum/topic/989712-wpf-rendering-with-opengl-in-another-thread/Share on other sites
1 answer to this question
Recommended Posts