Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved How do I add the Raylib library to a Qt application

    General and Desktop
    2
    6
    875
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Sigma7zero last edited by

      Hi,

      I'm trying to add the Raylib library (https://www.raylib.com/) to my Qt application (C++, not Qml) - as an easier alternative to the OpenGL widget.

      How do I wrap the library into a Qwidget, such that I can have a raylib scene rendering from within a form and send messages from QWidgets to change the attributes of a 3d model, e.g. use a slider to rotate the model , use a slider to change the scale etc ...

      There doesn't appear to be any tutorials on this.

      Thanks in advance,

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        Hi
        Are you sure it's supported ?
        It seems to contains its own window system and input system so
        might not play nice with Qt.

        I would ask on their forums/discord if it's even possible.

        It seems to use GLFW which i seen post about using with QWindow but
        i can not find out if it worked.

        1 Reply Last reply Reply Quote 0
        • S
          Sigma7zero last edited by

          I was thinking in terms of creating a wrapper class inherting from QWidget that provides the necessary bindings to Raylibs window system.

          Also, there is already an OpenGL widget., why not have a Raylib widget?

          mrjj 1 Reply Last reply Reply Quote 0
          • mrjj
            mrjj Lifetime Qt Champion @Sigma7zero last edited by

            @Sigma7zero

            Well its not for sure raylib allows such integration.
            Its a c library and you cannot extend by subclassing.

            raylib cant just be made into a widget. its a full blow library and
            not just a canvas to paint on as the OpenGL widget is.

            sadly. as it does seem pretty nice. even for raw c. and not c++

            1 Reply Last reply Reply Quote 0
            • S
              Sigma7zero last edited by

              It is originally a c library, but there are now numerous bindings for it.
              See here:
              https://github.com/raysan5/raylib/blob/master/BINDINGS.md

              The second line down has a link to C++ bindings.

              mrjj 1 Reply Last reply Reply Quote 0
              • mrjj
                mrjj Lifetime Qt Champion @Sigma7zero last edited by

                @Sigma7zero

                ah. cool. Seems pretty high level.

                I found this
                https://github.com/glfw/glfw/issues/1070

                so it seems possible to use Qt and GLFW so that might extend to raylib

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post