I have a Scala / Java OpenGL application in which I use the Akka framework. At the moment, my OpenGL thread is independent of the current system, so I can guarantee that calls to OpenGL functions always come from the same thread. This is important, otherwise OpenGL will complain.
So far, I have had to send messages from the OpenGL stream to actors on the system, and this works very well. Now I am faced with the need to send messages in a different way, but, of course, I can’t just put OpenGL in the actor, as this will violate the requirement that it be executed from one thread.
An alternative would be to use a queue and manual blocking for communication between participants and an OpenGL thread, but I would like to know if there is a way to place OpenGL calls in a special Actor, who will be given a guarantee from Akka to run in a single thread.
Hi
source
share