Passing a GLFW window (created outside of raylib) to RayLib #3897
Replies: 2 comments
-
Depending on how you build your application and the essential raylib modules, the footprint of raylib will be mostly what you use not much that your code doesn't depend on. The technical difficulty you will face is that raylib operates around a single, static data structure, Also, you need to operate within the raylib display loop, which causes drawing to be committed to the display in conjunction with consecutive display frames. Look at some of the examples to get a sense of that. And take a look at the |
Beta Was this translation helpful? Give feedback.
-
@alejandro-machina Actually that option is out-of-scope for raylib for now but you can check |
Beta Was this translation helpful? Give feedback.
-
Does raylib support the idea of creating a window (in this case I am using GLFW) and then just pass that pointer to raylib rather than initialize the window with raylib's API InitWindow()? (I was looking in the code for something like InitWindowFromPointer() but seems that does not exist)
The use case I see is raylib does a lot of heavy lifting for resources (have functions to load Images, Textures, Audio, Shaders, etc.) and I might want to still use some of those (or a good portion) resources but decide on my own how to handle the windowing and inputs (keyboard, controllers, etc.)
For example, InitAudioDevice() can be used without any windowing context (which is great) but what if I want to use something like DrawLine() in my rendering loop but the platform has been initialized by my own code and not InitWindow() (of course, I assume that before DrawLine() I should setup maybe some transformation/shaders for the rendering to catch the intention of DrawLine)
Thanks for the answer and all the effort put in this library.
Beta Was this translation helpful? Give feedback.
All reactions