Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How do I add the Raylib library to a Qt application
Forum Updated to NodeBB v4.3 + New Features

How do I add the Raylib library to a Qt application

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 2.1k Views 1 Watching
  • 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 Offline
    S Offline
    Sigma7zero
    wrote on last edited by
    #1

    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
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      0
      • S Offline
        S Offline
        Sigma7zero
        wrote on last edited by
        #3

        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?

        mrjjM 1 Reply Last reply
        0
        • S Sigma7zero

          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?

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @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
          0
          • S Offline
            S Offline
            Sigma7zero
            wrote on last edited by
            #5

            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.

            mrjjM 1 Reply Last reply
            0
            • S Sigma7zero

              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.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @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
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved