Menu

OGLplus with GLFW

Help
Rui Coelho
2013-01-19
2013-03-04
  • Rui Coelho

    Rui Coelho - 2013-01-19

    Hi everyone,

    Newbie, here…

    Is is it possible to use OGLplus with GLFW, instead of GLUT?

    I tried using it on a simple example, and I got this:

    /home/rvc/dev/oglplus/main.cpp:10: error: oglplus/all.hpp: No such file or directory
    

    I then tried to run ./configure.sh, and I got this:

    GLUT is required for this build configuration
    -- Configuring incomplete, errors occurred!
    # Configuration failed with error code 1
    

    If it's possible any tips to help getting it working would be appreciated.

    Thanks.

     
  • Matus Chochlik

    Matus Chochlik - 2013-01-21

    Hi,

    yes it is possible to use OGLplus with GLFW, but the current build system does not support it yet (it's sitting on the TODO list), which is why the configuration script fails.

    Right now to use GLFW you have to compile the examples manually or write (and compile) your own apps.

    As to the " error: oglplus/all.hpp:  No such file or directory" error. Did you use -I<path/to/oglplus-root-dir> (or some equivalent)?

     
  • Matus Chochlik

    Matus Chochlik - 2013-01-21

    (sorry to reply to myself but,)
    to clarify the above, the examples would need some additional tweaking too if they were to be used with GLFW, but generally it is possible to write your own apps that use OGLplus and GLFW.

     
  • Rui Coelho

    Rui Coelho - 2013-01-21

    I see.. Thanks for the input.

    Then then problem is that I don't know how to set up CMakeLists.txt properly. This is what I have:

    project(oglplus)
    cmake_minimum_required(VERSION 2.8)
    aux_source_directory(. SRC_LIST)
    aux_source_directory(../OGLplus-git OGLPLUS_SRC_LIST)
    add_executable(${PROJECT_NAME} ${SRC_LIST} ${OGLPLUS_SRC_LIST})
    target_link_libraries(${PROJECT_NAME} OGLplus)
    

    Also tried with

    aux_source_directory(../OGLplus-git/include OGLPLUS_SRC_LIST)
    

    And if I removed the #include <oglplus/all.hpp>, I get:

    cannot find -lOGLplus
    

    I suppose that's because OGLplus is not installed on the system.
    So I need a way to specify the path to where to look for the OGLplus.so file?

     
  • Rui Coelho

    Rui Coelho - 2013-01-21

    Oops, sorry…

    …there should be no .so file, right?.. if it's a header only library

    So adding OGLplus to the target_link_libraries doesn't make any sense.

     
  • Rui Coelho

    Rui Coelho - 2013-01-21

    Sorry for the triple post.. would just edit the first I could.. :\

    Anyway.. got it working with:

    project(oglplus)
    cmake_minimum_required(VERSION 2.8)
    aux_source_directory(. SRC_LIST)
    add_definitions(-std=c++11)
    include_directories(../OGLplus-git/_build/include)
    include_directories(../OGLplus-git/include)
    add_executable(${PROJECT_NAME} ${SRC_LIST})
    target_link_libraries(${PROJECT_NAME} GLEW glfw)
    

    Thanks. ^^

     
  • Matus Chochlik

    Matus Chochlik - 2013-01-22

    Yes, the CMakefile.txt should look something along those lines,
    OGLplus is header-only so there is no compiled library now.
    In the future it will probably be possible to optionally compile
    some parts into a library to improve build times.

    We'll also bump the priority for support of GLFW.

     

Log in to post a comment.

MongoDB Logo MongoDB