Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide missing GL_DEBUG definitions (fix compile on Mac) #2

Open
wants to merge 7 commits into
base: gui-gl-context
Choose a base branch
from

Conversation

Birch-san
Copy link

@Birch-san Birch-san commented Apr 8, 2017

Apparently we don't require the glext.h header on Mac, but if that's the case, I am not sure why I get compile error:

/Users/birch/git/openage/libopenage/gui/guisys/private/opengl_debug_logger.cpp:15:18: error: use of undeclared identifier
      'GL_DEBUG_CALLBACK_FUNCTION'
                        glGetPointerv(GL_DEBUG_CALLBACK_FUNCTION, &params.callback);
                                      ^
/Users/birch/git/openage/libopenage/gui/guisys/private/opengl_debug_logger.cpp:16:37: error: use of undeclared identifier
      'GL_DEBUG_OUTPUT_SYNCHRONOUS'
                        params.synchronous = glIsEnabled(GL_DEBUG_OUTPUT_SYNCHRONOUS);
                                                         ^
/Users/birch/git/openage/libopenage/gui/guisys/private/opengl_debug_logger.cpp:29:51: error: use of undeclared identifier
      'GL_DEBUG_TYPE_ERROR'
                        functions->glDebugMessageControl(GL_DONT_CARE, GL_DEBUG_TYPE_ERROR, GL_DONT_CARE, 0, nullptr, GL_TRUE);
                                                                       ^
/Users/birch/git/openage/libopenage/gui/guisys/private/opengl_debug_logger.cpp:30:51: error: use of undeclared identifier
      'GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR'
                        functions->glDebugMessageControl(GL_DONT_CARE, GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR, GL_DONT_CARE, 0, nullptr, GL_TRUE);
                                                                       ^
/Users/birch/git/openage/libopenage/gui/guisys/private/opengl_debug_logger.cpp:35:14: error: use of undeclared identifier
      'GL_DEBUG_OUTPUT_SYNCHRONOUS'
                                glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);

Maybe we get everything except debug stuff?

I'm not sure that there is KHR_debug support in Mac. Apparently you'd need OpenGL 4.3.
Mac only has OpenGL 4.1.

I decided to throw in the missing #defines, to ensure that the code at least compiled.
The license for glext.h seems pretty permissive, so hopefully this is fine.

@Birch-san
Copy link
Author

Birch-san commented Apr 8, 2017

I am running on macOS Sierra 10.12.5 Beta (16F43c). Here's the compiler configuration I used when I encountered the error.

➜  openage git:(gui-gl-context) ./configure                       
./configure is a convenience script:
it creates the build directory,  symlinks it,
and invokes cmake for an out-of-source build.

Nobody is stopping you from skipping ./configure and our Makefile,
and using CMake directly (e.g. when packaging, or using an IDE).
For your convenience, ./configure even prints the direct CMake invocation!

         build_type | Debug
       cxx_compiler | clang++
          cxx_flags | 
   exe_linker_flags | 
     install_prefix | /usr/local
module_linker_flags | 
shared_linker_flags | 

config options:

          backtrace | if_available
gperftools-profiler | if_available
gperftools-tcmalloc | False
            inotify | if_available

bindir:
/Users/anon/git/openage/.bin/clang++-debug-Oauto-sanitize-none/

invocation:
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS='' -DCMAKE_EXE_LINKER_FLAGS='' -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_MODULE_LINKER_FLAGS='' -DCMAKE_SHARED_LINKER_FLAGS='' -DCXX_OPTIMIZATION_LEVEL=auto -DCXX_SANITIZE_FATAL=False -DCXX_SANITIZE_MODE=none -DWANT_BACKTRACE=if_available -DWANT_GPERFTOOLS_PROFILER=if_available -DWANT_GPERFTOOLS_TCMALLOC=False -DWANT_INOTIFY=if_available -- /Users/anon/git/openage

(running cmake...)

 ___  ______ _______ _______ ___
|  _)/ _____|_______|_______|_  |
| | ( (____  _____      _     | |    ___  ____  _____ ____  _____  ____ _____
| |  \____ \|  ___)    | |    | |   / _ \|  _ \| ___ |  _ \(____ |/ _  | ___ |
| |_ _____) ) |        | |   _| |  | |_| | |_| | ____| | | / ___ ( (_| | ____|
|___|______/|_|        |_|  (___|   \___/|  __/|_____)_| |_\_____|\___ |_____)
                                         |_|                     (_____|

Welcome to the SFT technologies computer-aided openage build system!

You have chosen, or been chosen, to attempt the daring task of building openage.
If you have installed all the dependencies that are conveniently listed in
[doc/building.md], this _might_ just work!

If it doesn't, consider reporting the issue/asking for help in #sfttech on freenode.net.

-- Using python interpreter: /usr/local/opt/python3/bin/python3.6
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
CMake Warning at buildsystem/doxygen.cmake:50 (message):
  doxygen couldn't be found, you won't be able to generate docs
Call Stack (most recent call first):
  CMakeLists.txt:97 (doxygen_configure)



cpp library
	libopenage                                          [237 sources] [14 generated]
-- Could NOT find GCCBacktrace (missing:  GCCBacktrace_LIBRARIES GCCBacktrace_INCLUDE_DIRS) 
unavailable: backtrace
-- Could NOT find Gperftools (missing:  GPERFTOOLS_LIBRARIES GPERFTOOLS_INCLUDE_DIR) 
unavailable: gperftools-profiler
-- Could NOT find INOTIFY (missing:  INOTIFY_INCLUDE_DIR) 
unavailable: inotify

cython module
	run                                                 [embedded interpreter] [noinstall]
	openage.cabextract.lzxd
	openage.cabextract.cabchecksum                      [standalone]
	openage.convert.slp
	openage.convert.interface.visgrep
	openage.cppinterface.exctranslate
	openage.cppinterface.exctranslate_tests
	openage.cppinterface.pyobject
	openage.cppinterface.setup_checker
	openage.cvar.cvar
	openage.game.main_cpp
	openage.log.log_cpp
	openage.util.filelike.cpp
	openage.util.fslike.cpp
	openage.testing.cpp_testing
	openage.testing.misc_cpp

enabled options:
	<none>

disabled options:
	backtrace
	gperftools-profiler
	gperftools-tcmalloc
	inotify

openage v0.3.0-861-g85e62658

         compiler | AppleClang 8.0.0.8000042
       build type | Debug
         cxxflags |  -Wall -Wextra -pedantic -Wno-mismatched-tags -stdlib=libc++ -std=c++14
 build type flags | -g -O0
        build dir | /Users/anon/git/openage/.bin/clang++-debug-Oauto-sanitize-none
   install prefix | /usr/local
py install prefix | /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages

-- Configuring done
-- Generating done
-- Build files have been written to: /Users/anon/git/openage/.bin/clang++-debug-Oauto-sanitize-none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants