Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » question to allegro developpers

This thread is locked; no one can reply to it. rss feed Print
question to allegro developpers
karistouf
Member #5,126
October 2004
avatar

Hello, I m using allegro as graphical library for a theatre applications, remoting lights on stage.
( adress in signature)

I m working under windows and using mingw32 and dev-cpp.
I notice that going to another application was freezing timers and action of my program. I need to point and click on it to unfreeze it....

So i have 2 questions:
First, is there a way to unavoid this fact ?
Second, I want to use now the OSC protocol wich using UPD and permits to interact in real time with other programms ( on same computer or other computers):
http://www.audiomulch.com/~rossb/code/oscpack/

I want my program to be a server, waiting from orders in this protocol. As my program is controlling lights, it needs to be activ everytime. THATS THE MAIN POINT.
I want to be sure before working on this part that allergo structure do not make inherent troubles.

So, this is a real question.

I m very happy to use allegro. It permits me to design and create an application wich is beautifull by aspect and by use. That must be said to community of developpers from time to time ( ;D )

sincerely yours, christoph

Marco Radaelli
Member #3,028
December 2002
avatar

Take a look at set_display_switch_mode()
[edit]
And for the second question, maybe you want to looks for threads if your server is going to answer separately different requests

Elias
Member #358
May 2000

See here in the documentation: http://alleg.sourceforge.net/onlinedocs/en/alleg008.html#set_display_switch_mode

What you want is something like:

if (set_display_switch_mode(SWITCH_BACKGROUND))
    set_display_switch_mode(SWITCH_BACKAMNESIA));

--
"Either help out or stop whining" - Evert

karistouf
Member #5,126
October 2004
avatar

thanks !!!

it s good to know this answer.

definitively allegro is surprising ....
;D

A J
Member #3,025
December 2002
avatar

excuse my frenglish ;)

use set_display_mode() for constant running application, but be aware that allegro is a single threaded application, and not good for data processing of UDP and OSC when doing graphics at the same time.

This type of application would be better suited to multi-threaded, so that allegro will not effect your data processing, allegro would be useful as a graphical interface only.

___________________________
The more you talk, the more AJ is right. - ML

karistouf
Member #5,126
October 2004
avatar

excuse also my enfrench ;D
sometimes I m not exactly understanding everything...

Quote:

be aware that allegro is a single threaded application, and not good for data processing of UDP and OSC when doing graphics at the same time.

In fact, It will run as server, receive orders.
Real Time here with this protocol takes the time of:
- emitting an ascii bundle order, from the client
- receiving the bundle and slaching it in key words from server
- interpreting the key word and doing them after the time_wait specified in the bundle ( time_wait for letting the server its time to read the string)

my program will be server and is already refreshing at 50/sec minimum. All graphics are informations, not complex treatment. Yes, i m using allegro as graphical GUI ( and its very confortable and easy) and I m using its function of timer. Only one in use.

So, after all my bla bla ;D I would like to understand why you are talking about multithreading ? A single explanation ( not technical) would very interresting.
I did nt put my eyes inside udp for the moment, and will use the osc as ressource.

I m very interrested by your advise.

waiting for news ;D

pleasure, christoph

A J
Member #3,025
December 2002
avatar

are you sending data from the timer handler ?

how can you have accurate times for OSC packets if your busy drawing allegro graphics.

How time critical is sending the data ?

___________________________
The more you talk, the more AJ is right. - ML

Go to: