Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow GLFW applications to to run on headless machines #482

Closed
jmuncaster opened this issue Mar 26, 2015 · 4 comments
Closed

Allow GLFW applications to to run on headless machines #482

jmuncaster opened this issue Mar 26, 2015 · 4 comments
Assignees
Labels
bug Bug reports and bugfix pull requests verified Reproduced or otherwise verified bugs
Milestone

Comments

@jmuncaster
Copy link

glfwInit() fails on a headless Win7 machine because it requires for there to be > 0 monitors. This issue is a request to remove that check.

@elmindreda elmindreda added this to the 4.0 milestone Mar 26, 2015
@shakesoda
Copy link

GLFW doesn't provide much useful for a headless machine, does it? The only thing I can think of is timers, which could alternatively be provided by something like https://github.com/ThomasHabets/monotonic_clock

@dmitshur
Copy link
Collaborator

GLFW doesn't provide much useful for a headless machine, does it?

It doesn't. But it's useful to be able to run apps that include GLFW in headless modes for reasons other than ability to use GLFW functionality.

Consider the following practical situation. You have a multiplayer game. The server and client share a lot of common gameplay code. It's convenient to be able to produce a binary that can, depending on the parameters specified, act as a client, or a dedicated server, or a server with a display, or as both server and client in one (to allow offline play).

It's useful to be able to simply avoid creating a window, but run the rest of the core gameplay/networking code as is, and have the application run correctly instead of crashing. It should return error if you try to create a window on a headless system and it fails, of course.

@jmuncaster
Copy link
Author

Our application does all rendering off screen and serves the resultant images as streaming video. No user ever interacts with our application, which runs on a server that is headless. GLFW is useful because it provides a abstraction that hides cross platform differences in creating the OpenGL context for offscreen rendering.

@elmindreda elmindreda added the enhancement Feature suggestions and PRs label Mar 29, 2015
@elmindreda
Copy link
Member

I was sure I'd written somewhere in the documentation that glfwGetPrimaryMonitor must succeed if initialization did, but apparently I hadn't.

@elmindreda elmindreda modified the milestones: 3.2, 4.0 Mar 29, 2015
@elmindreda elmindreda self-assigned this Mar 29, 2015
@elmindreda elmindreda added bug Bug reports and bugfix pull requests verified Reproduced or otherwise verified bugs and removed enhancement Feature suggestions and PRs labels Mar 29, 2015
@elmindreda elmindreda modified the milestones: 3.2, 3.1.2 Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports and bugfix pull requests verified Reproduced or otherwise verified bugs
Projects
None yet
Development

No branches or pull requests

4 participants