paragui-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paragui-users] Yet an other drawing question.


From: Guillaume Schmid
Subject: [paragui-users] Yet an other drawing question.
Date: 05 Aug 2002 20:51:46 +0200

Well, I looked at the mailing list and saw that there was previously
some questions about it but could not really anderstand the answers :)

I am doing a simple game, the playfield uses a big part of the screen
and inherit from a PG_ThemeWidget.
I have a small sprite to animate at regular period of time (for this, i
plan to use a timer).
I would like to fully anderstand what is involved in such a blitting
operation. I think that this knowledge could benefit to other game
writers.

1 - If the playfield inherit from a widget with a surface.

An eventDraw will allow me to draw my tiles on the internal surface I
draw my sprite as well.
after the EventDrawMethod is called, the eventBlit is called which call
the Redraw method that does the blitting of the surface on the parent
widget. At this stage I dont know if the parent widget (in my case, the
main screen) needs to be redrawn itself to be visible).
So it is 1 drawing on a surface + 1 copy of the surface to the screen
surface (and one more for the screen surface to be visible ?).

If I want just to draw a few pixels, The whole surface is being copied
at least one time (or 2?). So, I anderstand that is might not be the
most efficient way of doing it.

2 - With a surface less widget.

The eventBlit method is called (not eventDraw). I noticed that the
SDL_Surface parameter of eventBlit was null. So I use GetScreenSurface
to draw. So, my tiles are being blitted dirrectly on the screen's
surface and Redraw id called for it to updated and visible.
If I draw a few pixels, I noticed that I have to manually call Redraw.
This is where I am looking for explanations or advices.
I would like manipulate dirrecly the visible screen surface. I would
like the blittings to happen without the whole surface redraw overload.

First of all, does all my blablabla makes sense ?
It it possible to achieve this with paragui elegantly ?

Thank you for your attention.
a++
Guillaume.
PS: This will be a nice (i hope) GPL'ed 'connect 4' (or '4 in a row')
game with theme and a strong AI opponent.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]