Well, my code is written in SL's Linden Scripting Language (LSL). My OrbiterClock isn't written in C, it's basically a cheat I realized I could do with animations using Vinka's spacecraft3.dll, and the animation abilities. All I'm doing is an animation that takes 1 hour (3600 seconds), and 12 hours (43200 seconds) to rotate the hands. It's not coded, it's cheated...lol, head into the forum chat and I maybe I can push you in the right direction though.
-----Posted Added-----
hmm, where did the forum chat go?
-----Posted Added-----
Ok, I'm no C programmer, but I did a bit of research on C# (isn't that's what Orbiter is compiled in? Sorry, not too well versed on the various flavors of C).
Anyways.... to do this, you need to define and start a timer event...
[FONT=Verdana, Arial, Helvetica, sans-serif]timer1.Interval = 100;
timer1.Enabled = true[/FONT][FONT=Verdana, Arial, Helvetica, sans-serif];
timer1.Tick += new[/FONT][FONT=Verdana, Arial, Helvetica, sans-serif] System.EventHandler (OnTimerEvent);[/FONT]
This will create a timer event called OnTimerEvent () with an interval of 1 second and enable (start) the event (I think).
Then...
[FONT=Verdana, Arial, Helvetica, sans-serif]public static void OnTimerEvent(object[/FONT][FONT=Verdana, Arial, Helvetica, sans-serif] source, EventArgs e)
{
[/FONT] string date = DateTime.Now.Date;
date.time = date.ToString("HH:mm:ss")
// I'm guessing all along here, but to this point, that should read the current time into a string called date.time, from that point, you would need to parse out each character of the string, and display the appropriate texture, or, if possible, just output the text (not sure how that's done in Orbiter VC's and display it. If anyone who's a real C programmer wants to chime in, I could sure use the help, I don't really know C, but I'm searching around the web and trying to figure out how to put together a timer event and read the current time into a string, I
think this is about how it would be done.
[FONT=Verdana, Arial, Helvetica, sans-serif]}[/FONT]
-----Posted Added-----
Not simple at all.
I believe there are some very helpful discussions about this in the SSU development thread.
Not really too difficult TS, I just took a stab at part of it above, but I'm not really a C programmer...lol, maybe a bit of 'pseudo code' would help make it clearer...
I'm not sure how C works, but there must be some default state that is entered when a program runs, and a state entry event of some type must be raised...
State Entry....
setup and start timer event
Timer Event...
Read system time into a string
For loop start {
Parse character from string
perform texture look up
display texture in appropriate position
For loop end }
Timer Event end
The For loop will iterate 8 times for each character 'HH:mm:ss', at which point the event will end. After another second has passed, the timer event will again be raised, and it will happen all over again.
Hope this helps, programmers, please chime in and let me know how I did with my C code.