freeglut-3.2.1-gcc10_fix-1.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. Submitted By: Pierre Labastie <pierre dot labastie at neuf dot fr>
  2. Date: 2020-05-19
  3. Initial Package Version: 3.2.1
  4. Upstream Status: Committed
  5. Origin: Upstream https://sourceforge.net/p/freeglut/code/1863/
  6. Description: Fixes "multiple defition" issues
  7. --- a/src/fg_gl2.c
  8. +++ b/src/fg_gl2.c
  9. @@ -26,6 +26,20 @@
  10. #include <GL/freeglut.h>
  11. #include "fg_internal.h"
  12. #include "fg_gl2.h"
  13. +
  14. +#ifndef GL_ES_VERSION_2_0
  15. +/* GLES2 has the corresponding entry points built-in, and these fgh-prefixed
  16. + * names are defined in fg_gl2.h header to reference them, for any other case,
  17. + * define them as function pointers here.
  18. + */
  19. +FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
  20. +FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
  21. +FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
  22. +FGH_PFNGLBUFFERDATAPROC fghBufferData;
  23. +FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
  24. +FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
  25. +FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
  26. +#endif
  27. void FGAPIENTRY glutSetVertexAttribCoord3(GLint attrib) {
  28. if (fgStructure.CurrentWindow != NULL)
  29. --- a/src/fg_gl2.h
  30. +++ b/src/fg_gl2.h
  31. @@ -67,13 +67,13 @@
  32. typedef void (APIENTRY *FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint);
  33. typedef void (APIENTRY *FGH_PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
  34. -FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
  35. -FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
  36. -FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
  37. -FGH_PFNGLBUFFERDATAPROC fghBufferData;
  38. -FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
  39. -FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
  40. -FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
  41. +extern FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
  42. +extern FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
  43. +extern FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
  44. +extern FGH_PFNGLBUFFERDATAPROC fghBufferData;
  45. +extern FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
  46. +extern FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
  47. +extern FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
  48. # endif