Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Events & Animations  (Read 2098 times)

0 Members and 1 Guest are viewing this topic.

zoran404

  • Newbie
  • *
  • Posts: 41
    • View Profile
Events & Animations
« on: May 01, 2013, 12:08:28 am »
So I made a little library which beside other functions has setInterval and setTimeout functions.
They are part of my class which I call zSFMLe and it has a class Loops of which I made a vector.
Those 2 functions takes a function pointer, which takes a void pointer, and a void pointer to be passed to that function and time in milliseconds.
How I made it is that you make a zSFMLe object and use its functions setInterval and setTimeout to add things to the vector. It also has a timing function which I call every time before drawing, it checks should any of the functions be called.

Now the problem is that I have to make a new class that will contain all the data that I have to pass to that function, I have to use void pointer to pass that object to the function and then make variables in which I will store the values which I stored in the object.
Is there an easier, simpler way to pass data to a function?


That library also has onclick and addEventListener functions, although they aren't finished, so they do only the most basic things.
I also have a animation library that animates chenge of Position, Rotation, Scale and Origin, but only linearly, I'm planing to add nonlinear (how ever that is called) animation soon.

I putted a test exe file in attachments (dosen't include the 3 dll files needed to run it, so you will have to add that).
It has 1 second timeout till begining and I seted an interval to repear the animation every 9 seconds, because that is how long it lasts.



[attachment deleted by admin]

 

anything