C++ (Borland builder 4) question

  • Context: C/C++ 
  • Thread starter Thread starter Techcom_dude
  • Start date Start date
  • Tags Tags
    C++
Click For Summary
SUMMARY

The discussion focuses on using timers in Borland C++ Builder 4 for a 2D orbit simulation project. The user aims to animate a blue circle moving around a yellow circle by calculating new positions and redrawing the circles. Key recommendations include utilizing the Timer API from the Windows programming library and referencing resources such as the MSDN documentation and theForger's Win32 tutorials for animation techniques. The use of ANSI functions like difftime and time for tracking time intervals is also suggested.

PREREQUISITES
  • Familiarity with Borland C++ Builder 4
  • Understanding of Windows programming concepts
  • Basic knowledge of 2D graphics rendering
  • Experience with ANSI C functions like time() and difftime()
NEXT STEPS
  • Explore the Windows Timer API for event-driven programming
  • Study the MSDN documentation on Timer functions
  • Review theForger's Win32 tutorials on animation techniques
  • Learn about implementing double buffering for smoother animations
USEFUL FOR

Developers working with Borland C++ Builder, particularly those interested in graphics programming and animation in Windows applications.

Techcom_dude
Messages
1
Reaction score
0
Hello

I just read a thread in the physics forums (it might be out of date) but it is about a 2d orbit simulation and I am trying to do the same thing my question is not about the physics or the math but instead how do I use the timer in Borland Buidler 4 C++?

my plan is this I start with a big yellow circle in the middle and a little blue circle next to it and I want the blue one to move around the yellow one. I am doing this is a cheap way first the blue circle has it's initial position and then I am going to calculate it's new position and move it by first drawing another circle at that position that is the same color as that back ground and then redraw the blue one at the new positions and do it over and over.

I just don't know how to use the timer

thanks
 
Technology news on Phys.org
I use Borland C/C++ but not the builder. I expect the libraries to be reasonably close.
Try difftime(t1,t2) which returns the difference in time as a double.
t1 and t2 can be registered at different times using time().
difftime and time are both ANSI functions, so should present no problem.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 17 ·
Replies
17
Views
4K
  • · Replies 29 ·
Replies
29
Views
8K
Replies
89
Views
7K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
1
Views
954
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 18 ·
Replies
18
Views
4K