Secret Squirrel was once rumoured to have said:

> Thanks for that very comprehensive introduction Crossfire, I noticed
> that you mentioned "event system", I wasn't really expecting to
> "interact" with the window through mouse clicks, movements etc. is
> this what you're referring to ? I haven't really considered using
> the mouse but it would be a nice thing if it's so accessable.

Events are any form of input from the windowing system + some.

Resize, Expose (redraw), Mousedown, Keydown, etc events feed into your
application via a queue.  In Xlib programming you *MUST* service the
event queue, since it tells you when you are able to render your view,
and when you need to redraw parts of it.

> So let's say that I use XLIB - what will actually happen ? 
> ./myprogram will open a black X by Y window somewhere on the screen
> (not in the xterm) and draw a line in that box as I want it ? I
> really don't know what's "normal" in Linux. For example I was
> suprised when I found out I could run Quake 3 AND run it in full
> screen mode - I just didn't ever see it before so I didn't expect
> that it could do it, strange I know.

your program will connect to the X server, get the default screen, and
create a parent window.  You then map/show the parent window, and it
the Window Manager then displays it somewhere.  Your window then
recieves an expose event, and the rest is up to you.

> So is this what happens Crossfire ? Or will it open
> in a "generic" application window with a border,
> close window button etc ?

There is no "generic" application window stuff in XLib - XLib is VERY
low level, and can be extremely fast.  Its also the best place to
write simple graphics code. with the exception of OpenGL.  And even
with OpenGL, you still need to write some XLib calls to initialise
your window.

> I'm in a pretty bad position here since I don't think I know what I
> really want (from the Operating System) need and what to expect. I
> do know i'd like to program in C and keep it entertaining for myself
> by "having a play" and experimenting with it by drawing graphics and
> creating simple games, Pong ! Asteroids !
>
> Following these guidelines perhaps you could suggest something ?

Use X + OpenGL, since the buffering extensions will help you out here
for simple games, as well as the translation and other nifty-keen
OpenGL features.  Just be warned that the OpenGL Reference is a fairly
daunting document - just for 2d work, you only use a TINY fraction of
it.

C.
-- 
--==============================================--
  Crossfire      | This email was brought to you
  [EMAIL PROTECTED] | on 100% Recycled Electrons
--==============================================--

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug

Reply via email to