Win32 programming...not as fun.

The Partridge Family were neither partridges nor a family. Discuss.
albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Win32 programming...not as fun.

Post by albinopapa » March 11th, 2017, 8:01 am

Wow, I think you all missed what I meant. I understand how animation works, but if you only get control during an action like OnClick, how do you update the position?

So you click on the deal button, so there is an OnClick event, but since you don't click on anything to keep the animation going ( updating position ) then how does it work?

In C++, you have access to the main message loop, cause you create it. Which means you can update the objects before or after the actually message processing...like how the chili framework has the game.Go() function.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Win32 programming...not as fun.

Post by albinopapa » March 11th, 2017, 8:02 am

Yeah I know how to create the visual forms in VS and adjust the position, labels, font sizes and all that, that was never my concern.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Win32 programming...not as fun.

Post by albinopapa » March 11th, 2017, 8:04 am

I guess what I don't understand in C# is, if you don't have access to the message loop, where do you do X ever Y.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Win32 programming...not as fun.

Post by chili » March 11th, 2017, 1:47 pm

albinopapa wrote:Wow, I think you all missed what I meant. I understand how animation works, but if you only get control during an action like OnClick, how do you update the position?

So you click on the deal button, so there is an OnClick event, but since you don't click on anything to keep the animation going ( updating position ) then how does it work?

In C++, you have access to the main message loop, cause you create it. Which means you can update the objects before or after the actually message processing...like how the chili framework has the game.Go() function.
Like I said, use a timer brah.
Chili

JDB
Posts: 41
Joined: August 5th, 2015, 9:50 am
Location: Australia

Re: Win32 programming...not as fun.

Post by JDB » March 12th, 2017, 12:10 am

I believe what you're looking for is the tick event of the timer. Each time it ticks you can update the position of the cards, then stop the timer after a certain number of ticks or after all cards have reached their final position.

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Win32 programming...not as fun.

Post by albinopapa » March 12th, 2017, 1:27 am

Thanks chili and JDB, I wasn't comprehending that the timer you were referring to was part of the framework with events. I will look further.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Win32 programming...not as fun.

Post by chili » March 12th, 2017, 3:44 am

When I did it, i think i just dragged a 'Timer' control from the toolbox onto the forms designer.

Double click it and it will create a tick event handler function for you.
Chili

Post Reply