How do I use OpenGL without a window?

Started by
12 comments, last by Apu 18 years, 8 months ago
That's not what I meant! Of course I know that running two programs on the same computer will decrease my frame rate. What I mean is: Does the fact that I use a hidden OpenGL window for the server impact the frame rate of the client, AS OPPOSED to the case where the server uses NO window at all. (I am NOT comparing it to the case where I run only 1 program)

About GLFW: Thank you for the hint. It's nice, but it seems to make my problem even harder to solve. With a library like this, it will be difficult to do things that are not expected by the library. Like hiding the window. Or setting up a minimalist window.
Advertisement
Quote:Original post by Apu
That's not what I meant! Of course I know that running two programs on the same computer will decrease my frame rate. What I mean is: Does the fact that I use a hidden OpenGL window for the server impact the frame rate of the client, AS OPPOSED to the case where the server uses NO window at all. (I am NOT comparing it to the case where I run only 1 program)


Ok, I see what you mean now. Hmmmm, that's a interesting question [smile]. I can't say that I know. Maybe someone more experienced with something of this nature has an answer. I don't know if it's even possible, but I'm sure you could make a quick test to try peerhaps? Be sure to let us know though if no one else does.

Quote:About GLFW: Thank you for the hint. It's nice, but it seems to make my problem even harder to solve. With a library like this, it will be difficult to do things that are not expected by the library. Like hiding the window. Or setting up a minimalist window.


Ok cool, yea I figured you might not need something like that due to not being able to fully customize the setup, but it was worth a shot [wink] Good luck!

[Edited by - phantom on September 13, 2005 6:26:08 AM]
Quote:Original post by Apu
That's not what I meant! Of course I know that running two programs on the same computer will decrease my frame rate. What I mean is: Does the fact that I use a hidden OpenGL window for the server impact the frame rate of the client, AS OPPOSED to the case where the server uses NO window at all. (I am NOT comparing it to the case where I run only 1 program)


Yes, it will.
For starters, you'll have two active GL contexts, both of which will be taking up VRAM, as such you've already got less memory on the gfx card to play with.
Also, when issuing your drawing/maths functions calls to OpenGL the driver has to internally switch things so that the data goes to the correct context,this is going to be a reasonably slow operation and is likely to hurt your frame rate.

Also, doing this makes a HUGE assumption that the target server even has a sane OpenGL driver installed. OK, so its your first game however if you want this or any other game to run on a stand alone server in the future you should be aware that many dont even have a gfx card installed, never mind OpenGL.

Ideally what you should do is perform the maths yourself, both in the client and server, and use the result (be it for drawing on the client or whatever on the server). This allows you to reuse the same maths routines in both places but not rely on OpenGL todo all the work for you.

However, that will probably require a huge rewrite of both your client and server, as such given this is only your first game I wouldnt worry about it, use the hidden OpenGL window and take the performance hit (its not like your going to need every bit of power anyways) and when you come to write your next game keep this advice in mind.
Thank you, phantom. A very good and comprehensive answer.
I agree with your conclusion. But I wonder about your "ideal approach". It just seemed very efficient to me, to use the modelview matrix for other purposes also, without re-calculating it.
What you suggest is doing all the transformations matrices myself, and then passing it to OpenGL. But I would expect this to be slower. For one thing, I couldn't use display lists (which might be hardware optimised?).

This topic is closed to new replies.

Advertisement