0 votes

Can someone point me the source in GitHub of how Godot Engine handles multi-platform window abstraction or some other resource (Book, blog, GitHub, etc..) on how to do this?

I can't find a single resource (free or paid) on how to accomplish this without using something like GLFW3.

Thanks,
--Jeff

in Engine by (12 points)

2 Answers

0 votes

I'm not sure what you are looking for but the there is the platform directory

by (911 points)
0 votes

The abstraction is done directly into the core of the engine. In the class /core/os/os.h, there is a virtual function called "initialized". This class is actually extended by any os_*.cpp class (in each platform directory) and an OpenGL Context is created in this specific function. This is then into that function that you should look to know how the window is created as it is required in order to create an OpenGl Context (you will probably need to get your hand on the OpenGL documentation to be able to read those parts though).

For how Godot know which os class it has to use, it is actually injected, but I don't know when. Probably at compilation time, but it is also possible that it is at runtime, using a factory pattern (less likely as it would be less performant, and the game would be heavier, but I am not an engine dev).

by (16 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.