Sign in to follow this  

glut Query

This topic is 3631 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi.. I have doubt in glut usage... When I create window and proceed to run the glutMainloop() everything runs fine... When I dont want to create any window, I comment the line glutCreateWindow() but my program does not enter the GlutMainloop() So, What should I do when I dont need any window, but to run GlutMainLOop

Share this post


Link to post
Share on other sites
Exactly.
Rationale: the message pump in native win32 goes thuru a WindowProc which takes a window handle as an parameter. Similarly, in X11 there's a unique identifier.
Since win32/X11 build message queues per-window, there's nothing to get without a window.

If memory serves win32 does have a limited sort of message loop for consoles catching CTRL+C and stuff like that: it's old, ankward, ugly... and not really so useful.

What's the point of this question? What do you really want to obtain?

Share this post


Link to post
Share on other sites
I'm guessing that the OP wants to catch mouse and keyboard input without an OpenGL window having been created (which is the only possible reason i can think of). If that's the case, the only real choice you have is to use DirectInput and/or XInput maybe?

Share this post


Link to post
Share on other sites
When I do follow the client server kind of architecture...

I dont want my server to draw a window....

So only I asked that question.....

But I need glutTimerFunc to periodically call a function,So I wanted glutMainloop for that.

And another one doubt....


When I want to do some memory clean up...

after the glutmainloop is over

Where should I do....


Share this post


Link to post
Share on other sites
Quote:
Original post by tinu
When I do follow the client server kind of architecture...


while(server_is_running)
{
// do stuff
Sleep( for_some_time_value );
}

Quote:

But I need glutTimerFunc to periodically call a function,So I wanted glutMainloop for that.


Then just use another timer....

Quote:
When I want to do some memory clean up... after the glutmainloop is over


void my_exit_func()
{
}

atexit(my_exit_func)

or just ignore it since your programs about to terminate anyway.


Share this post


Link to post
Share on other sites

This topic is 3631 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this