Thursday, December 24, 2009

ViruZ update 2

Okay, so now I finally fixed that window-closing. There was some weird stuff going on, because the event actually got rised and handled, but PostQuitMessage didn't seem to do its job.
So I am perkily pooping on this, which tells you to "not post the WM_QUIT message using PostMessage; [but to] use the PostQuitMessage function.". And then it works.

Yay :3

I also implemented double-buffering, using the cairo_push_group and cairo_pop_group_to_surface-functions. Well, it's not really double-buffering, since I'm not buffering the image and swap the fore- and back-buffer, but it gets rid of the flickering so it's good enough for me.
I stumbled upon them while looking for a way to copy surfaces.
I hope they cooperate with threads :S

I also started laying out a design for my virus-baseclass. I'm hoping to somehow cache the drawn circle, maybe even share that cache among equal looking viruses, and thus only having to copy the already drawn circle on the surface.

So my next step lies in putting some flesh (code) on the bones (class layout), making my draw-function loop through an array of viruses (later with threads) and use their draw-function.
After that, I will implement moving-logic to the viruses. Then the Anti-V. Then cleaning up a little and maybe I'm gonna upload a public executable.

Once I am taking care of installing GRUB to boot Ubuntu again, I'll also take care of the Linux-port. It'll be available for all Linux, which are running the X Window System and are compatible with cario. I guess.

No comments: