Advertisement

message processing

Started by April 06, 2004 03:45 PM
3 comments, last by quasar3d 20 years, 5 months ago
I am doing my first opengl program in linux, and I can succesfully create a window, and initialize opengl, and so I can enter the main game loop. The thing I am wondering though is, should I handle messages at all? I know console programs don''t, and I assume windows programs have to do some kind of message processing. So for a game, with opengl, do I have to handle messages, or can I just ignore them? and if not, how should I handle them? My Site
What messages? X events, SDL events, GLUT callbacks, GTK+ signals, Qt signals, or whatever was involved in setting up the OpenGL context? The only event you really should handle is some type of "quit" event and some of those libraries handle that for you. For a game, you''re likely going to need to handle input events also. So, I suppose you will to need to handle "messages" if I understood what you meant.

Advertisement
another non-existant carry-over from the windows world.

The above poster covered it well. You get input from whatever you''re using as, well, input. SDL, X, or console file streams
Yes, events are probably what I mean. They are called messages on windows. I''m using X to create my window, so I will look into that. Does anybody have a good link or something to a site that explains how to do that?

My Site
quote: Original post by quasar3d
I''m using X to create my window, so I will look into that. Does anybody have a good link or something to a site that explains how to do that?

Look at the manual pages for "XPending" "XNextEvent" (they''ll include a lot more related stuff). For documentation of what events exist and what related information they have, see this. If you need a good example, take a look at SDL''s X event handling; SDL''s events actually work much the same way as X''s events. If that''s not enough, I''m sure one of us can answer further questions that arise.

This topic is closed to new replies.

Advertisement