View previous topic :: View next topic |
Author |
Message |
lena
Joined: 19 Dec 2004 Posts: 11
|
Posted: Sun Dec 19, 2004 10:51 am Post subject: openGL |
|
|
How to use openGL with DFL ?
lena |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
|
Back to top |
|
|
lena
Joined: 19 Dec 2004 Posts: 11
|
Posted: Sun Dec 19, 2004 4:16 pm Post subject: |
|
|
Could you create onIdle handler for form ( or control ), which
get called from message loop, when there are no messages ? |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Sun Dec 19, 2004 4:29 pm Post subject: |
|
|
There is one, Application.idle ~= &myIdle; |
|
Back to top |
|
|
lena
Joined: 19 Dec 2004 Posts: 11
|
Posted: Sun Dec 19, 2004 5:14 pm Post subject: |
|
|
I did that in first place, but my simulation runs only if I
press key or move mouse over form. It looks like Application.idle
gets triggered only by not being idle. |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Mon Dec 20, 2004 4:37 am Post subject: |
|
|
Application.idle is fired when all the messages in the queue have been processed and it's about to wait for more. What you want is something that will loop while it's idle? Maybe a timer will work. The timers have lowest priority and only get called when there are no other messages in the queue. |
|
Back to top |
|
|
lena
Joined: 19 Dec 2004 Posts: 11
|
Posted: Mon Dec 20, 2004 7:47 am Post subject: |
|
|
What I want is something that will loop while it's idle.
So, what can you do about it ? (Timer works, of course, but it is slow! ) |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Mon Dec 20, 2004 10:28 am Post subject: |
|
|
lena wrote: | What I want is something that will loop while it's idle. |
I've added an extra optional parameter to Application.run() in today's snapshot ( http://www.dprogramming.com/dfl/snapshots/ ), it's a delegate that gets called while there are no messages in the queue.
Code: |
void whileIdle()
{
// Idle stuff...
}
Application.run(new MainForm, &whileIdle);
|
- Chris |
|
Back to top |
|
|
lena
Joined: 19 Dec 2004 Posts: 11
|
Posted: Mon Dec 20, 2004 3:25 pm Post subject: |
|
|
Excellent ! Thank you.
What about some more documentation and examples ? |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Mon Dec 20, 2004 7:20 pm Post subject: |
|
|
lena wrote: | What about some more documentation and examples ? |
I have yet to get my documentation generator to output better HTML files with some of my comments.
What kind of examples do you want? I don't know a thing about OpenGL... |
|
Back to top |
|
|
lena
Joined: 19 Dec 2004 Posts: 11
|
Posted: Tue Dec 21, 2004 1:35 am Post subject: |
|
|
I didn't mean OpenGL exampels. Just some general exampels ( tutorials )
for newbies to get the feel for the framework. |
|
Back to top |
|
|
|