wine-ignore-gl-compat-profile.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --- wine-2.21/dlls/opengl32/wgl.c.org 2017-11-28 17:52:06.100882751 +0100
  2. +++ wine-2.21/dlls/opengl32/wgl.c 2017-11-28 17:52:51.621079107 +0100
  3. @@ -253,6 +253,31 @@
  4. return ret;
  5. }
  6. +static
  7. +const int* remove_profile_mask(const int *attribs)
  8. +{
  9. + int* ret = NULL;
  10. + int i = 0;
  11. + int j = 0;
  12. + int attr_num = 0;
  13. + int profile_mask = 0;
  14. + for (i = 0; attribs[i] != NULL; i += 2) {
  15. + if (attribs[i] == WGL_CONTEXT_PROFILE_MASK_ARB)
  16. + profile_mask = 1;
  17. + ++attr_num;
  18. + }
  19. + if (profile_mask == 0) return attribs;
  20. + ret = calloc(attr_num*2 - 1, sizeof(int));
  21. + for (i = 0; attribs[i] != NULL; i += 2) {
  22. + if (attribs[i] != WGL_CONTEXT_PROFILE_MASK_ARB) {
  23. + ret[j] = attribs[i];
  24. + ret[j+1] = attribs[i+1];
  25. + j += 2;
  26. + }
  27. + }
  28. + return ret;
  29. +}
  30. +
  31. /***********************************************************************
  32. * wglCreateContextAttribsARB
  33. *
  34. @@ -265,6 +290,7 @@
  35. struct wgl_handle *share_ptr = NULL;
  36. struct opengl_context *context;
  37. struct opengl_funcs *funcs = get_dc_funcs( hdc );
  38. + attribs = remove_profile_mask(attribs);
  39. if (!funcs)
  40. {