1:opengl 多线程共享纹理纹理:
//解码时候使用opengl进行绘制,需要构建队列和两个线程,分别用于解码数据并且填充纹理和渲染。
主线程常见两个共享上下文:
main()
{
⋯⋯⋯⋯
gHdc = wglGetCurrentDC();
gHRC1 = wglCreateContext(gHdc);
gHRC2 = wglCreateContext(gHdc);;
wglShareLists(gHRC1,gHRC2);
⋯⋯⋯⋯
exit:
wglMakeCurrent(NULL,NULL);
}

Thread1()
{
⋯⋯⋯⋯
wglMakeCurrent(gHdc,gHRC1);
⋯⋯⋯⋯
wglDeleteContext(gHRC1);
}

Thread2()
{
⋯⋯⋯⋯
wglMakeCurrent(gHdc,gHRC2);
⋯⋯⋯⋯
wglDeleteContext(gHRC2);
}

相关文章:

  • 2021-10-06
  • 2022-12-23
  • 2021-12-08
  • 2022-02-12
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-20
相关资源
相似解决方案