Skip to content

Commit

Permalink
Export GLLoadGen symbols so they can be used in shared libraries.
Browse files Browse the repository at this point in the history
Caused linker problems mainly on Windows, where every symbol would need
to be exported manually, on Linux this was done implicitly (or with
`-fvisibility=default`). I now maintain glLoadGen fork at
https://github.com/mosra/glloadgen.git containing changes needed for
Magnum.

The `ogl_*()` functions are used only internally, various global
variables for extension queries are not used at all and thus they don't
need to be exported. I thus enabled `-fvisibility=hidden`.

Fixes #16.
  • Loading branch information
mosra committed Sep 16, 2013
1 parent 100990c commit 655c9ea
Show file tree
Hide file tree
Showing 6 changed files with 1,664 additions and 1,675 deletions.
2 changes: 1 addition & 1 deletion external/OpenGL/GL/CMakeLists.txt
Expand Up @@ -23,6 +23,6 @@
#

add_library(MagnumGLLoadGenObjects OBJECT gl_magnum.c)
set_target_properties(MagnumGLLoadGenObjects PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}")
set_target_properties(MagnumGLLoadGenObjects PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -fvisibility=hidden -DGLLoadGen_EXPORTS")

install(FILES gl_magnum.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/OpenGL/GL)
10 changes: 3 additions & 7 deletions external/OpenGL/GL/README.md
@@ -1,10 +1,6 @@
OpenGL header and extension loader is generated using [glLoadGen](https://bitbucket.org/alfonse/glloadgen),
preferrably from tip of the development branch, currently `2.0`. For it to work
flawlessly on OpenGL 2.1 and simultaenously not containing all that pre-core
stuff, you need to patch it with included `glloadgen.patch`, which will then
force it to use pre-3.0 `glGetString(GL_EXTENSIONS)` even if we request OpenGL
4.4. Otherwise it would use `glGetStringi(GL_EXTENSIONS, i)`, which is not
available on OpenGL 2.1 and extension loading will fail on these systems.
OpenGL header and extension loader is generated using glLoadGen, originally
from [BitBucket](https://bitbucket.org/alfonse/glloadgen), with Magnum-related
changes at [](https://github.com/mosra/glloadgen.git).

See `extensions.txt` for a list of requested non-core extensions. Copy the file
into glLoadGen directory and generate the files using Lua:
Expand Down

0 comments on commit 655c9ea

Please sign in to comment.