ewlc
ewlc copied to clipboard
glfw window not showing when not creating OpenGL context
Issue by karroffel
Tuesday Apr 18, 2017 at 23:45 GMT
Originally opened as https://github.com/Cloudef/wlc/issues/260
When trying to create a glfw windows without using a client API (aka not creating an OpenGL context) then the window doesn't display.
#include <stdio.h>
#include <GLFW/glfw3.h>
int main()
{
if (glfwInit() != GLFW_TRUE) {
fprintf(stderr, "Couldn't initialize glfw\n");
return 1;
}
glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE);
// if you comment out this line then it works just fine.
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
GLFWwindow *window = glfwCreateWindow(1280, 720, "sway test", NULL, NULL);
while (!glfwWindowShouldClose(window)) {
glfwPollEvents();
}
glfwTerminate();
return 0;
}
(compile with clang/gcc filename.c -lglfw)
Neither the wayland or the x11 build of glfw work.
Works on:
- weston
- plasma wayland
- GNOME wayland
Doesn't work on:
- sway
- orbment
Both sway and orbment use wlc, so the problem might lie here somewhere.
@karroffel doesn't work on weston for me though
@Enerccio the glfw-x11 or glfw-wayland doesn't work on weston?
I tried with glfw-wayland
What exactly doesn't work though? Can't initialize? Does the window just not show? It shows but shows crap?
Because if you use glfw without an OpenGL context it doesn't have a proper framebuffer assigned, so it's expected to show random stuff from VRAM.
Does it work with the x11 version though? I don't really care which one works as long as I can develop applications using Vulkan 😄
window does not show, cpu spins like crazy
x11 version opens window (not in xwayland, outside in normal x windows), which is same behavior as in wlc
Do you have the line commented out? Because if you have it commented out then it creates an OpenGL context.
If you don't have it commented out then I'm clueless and it's probably something with my machine or so
I do not have it commented out. FWIW when I do comment it out, no window gets created (tested with wayland version) and it fails on assert