MCPcopy
hub / github.com/ebitengine/oto / loop

Method loop

driver_wasapi_windows.go:317–335  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

315}
316
317func (c *wasapiContext) loop() error {
318 runtime.LockOSThread()
319 defer runtime.UnlockOSThread()
320
321 // S_FALSE is returned when CoInitializeEx is nested. This is a successful case.
322 if err := windows.CoInitializeEx(0, windows.COINIT_MULTITHREADED); err != nil && !errors.Is(err, syscall.Errno(windows.S_FALSE)) {
323 _, _ = c.client.Stop()
324 return err
325 }
326 // CoUninitialize should be called even when CoInitializeEx returns S_FALSE.
327 defer windows.CoUninitialize()
328
329 if err := c.loopOnRenderThread(); err != nil {
330 _, _ = c.client.Stop()
331 return err
332 }
333
334 return nil
335}
336
337func (c *wasapiContext) loopOnRenderThread() error {
338 last := time.Now()

Callers 1

startMethod · 0.95

Calls 2

loopOnRenderThreadMethod · 0.95
StopMethod · 0.80

Tested by

no test coverage detected