Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/692b5dfe-c870-8001-8b1b-e406111f0f53
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Think of a window as the piece of glass your GPU will eventually paint onto. === In Windows, a window is actually created by the OS API (Win32 API). In Linux, windows come from systems like X11 or Wayland. In macOS, they come from Cocoa (Objective-C). The BIG problem: ===== So Vulkan cannot assume one method. ===== That’s why we use GLFW (or SDL). GLFW hides OS differences and gives you a simple API: <syntaxhighlight lang="cpp">glfwInit(); glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); // important for Vulkan GLFWwindow* window = glfwCreateWindow(800, 600, "My Window", nullptr, nullptr); </syntaxhighlight> ===== If you forget: ===== <syntaxhighlight lang="cpp">glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); </syntaxhighlight> GLFW will try to create an OpenGL context. This breaks Vulkan. ===== Do you understand why Vulkan doesn’t create windows itself? ===== (Just answer yes or no. If no, I’ll re-explain simpler.)
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)