[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[glob2-devel] why libgag
From: |
fede |
Subject: |
[glob2-devel] why libgag |
Date: |
Sun, 18 Oct 2009 01:55:21 +0200 |
User-agent: |
KMail/1.11.2 (Linux/2.6.28-15-generic; KDE/4.2.2; i686; ; ) |
Hello list,
i have a question. Sometimes i get to existence questions and i can't sleep
until i get rid of it. Sorry if this looks boring, but that's just me.
I started write some c++ code into glob2, just a few because i'm not a
programmer. I just bought a c++ for beginners guide many years ago, and after
a month or so i closed it, upped head/eyes to invisible spectators, and said:
"i know c++" (cit. Matrix).
After some days i forgot almost everything :D
Well back in topic.
If i try to figure out how to structure a game (thinking on graphics), with my
lacking knowledge, i think just a big graphic class/subclassess accepting
inputs and drawing when it's time to draw. A list of maps objects (or
mapheaders if maps comes to be too many), when it's time to draw list of your
local maps just listOfMaps->draw(&graphiCclass, param, param). Coding into
ListOfMaps shouldn't force you to bind to a particular kind of list (example
libgag::guiList). GraphicClass will also receive other inputs to combine
everything, it has to be called just at 4' stage of main loop which would be
like "control stage" -- "get inputs" -- "apply" -- "draw" or so.
It also opens settings files (like where to locate a button in
absolute/relative coordinates).
It's not hard to imagine this way a game which let you move, resize, hide
menus when gui is in unlocked mode. I feel this design like flexible.
I think it's also easier to manage.
At the moment, it's strictly suggested to play glob2 online at 800x600 because
of lag, even with powerful computer we got today. I know that glob2 is cpu
hungry because of all those units pathfinding, assignments to works etc, but
this doesn't have to do with my screen surface.
The only reason i can guess to this behaviour is a non effective draw sequence
(things get overdrawn in same cycle maybe).
I never seen toolkit source. Neither i know any toolkit. All my little past
programs has been written with SDL only. I guess that with a learning overwork
at start, then a toolkit is powerful, but i rather write a bit now when got
free time, than learn again and not get concrete satisfactions.
I tried to change a bit a graphic menu behaviours, did some local test changes
to libgag.
Now i come to the existence question: having a lib (any lib - libgag lib),
instead of a class like i described, is less flexible just by design? Or it's
just a first impression?
I'm new to this design topic, i'm happy for any answer.
Thanks in advance,
Federico
____________________________________________________________
GET FREE 5GB EMAIL - Check out spam free email with many cool features!
Visit http://www.inbox.com/email to find out more!
- [glob2-devel] why libgag,
fede <=