IÂ´ll make this real simple. I have an application that is NOT usually accessing any photon resources. However for some time I have had to access the PgDraw method to draw a image in a Photon Panel. The reference for this panel has been supplied from the GUI Tilcon Kernal.
I am now able to draw my images 25 frames a second.
Today, trying to add some new objects (not having anything to do with either graphics nor Tilcon) the new linked code crashes heavely when it tries to PgDraw. After some reading I discivered that I must use PtEnter and PtLeave when trying to access things like PgDraw . . .
This I did not do, so I guess I have been lucky so far but not anymore.
Trying to set my PtEnter in my Thread copying image data and drawing it I stumbled on a CONDVAR at my thread state blocking it !?!?
Ok, so I have to make a PtInit I guess, so thats what I do, however the PtInit exit with error and the documentation has no further expanation to why this would happen. I do not know if I must use PtInit since other process (Tilcon Kernal) most probably does this already, however it says so in the doc that I have to make a PtInit before using the PtEnter and PtLeave, so I guess thats what I must do. So my thread begins doing PtInit that exits with error, so down to the questions:
DO I need to make a PtInit in my thread/process ALWAYS?
Why does the PtEnter leave my hanging with a CONDVAR that I did not create or do? How do I get around it so that my thread runs with no blockings?
(I do not need it to block)
Does every process/thread need to do the PtInit?
The original reason as mentioned above that I started to use the Pt methods is that because enhancments to the objects in my code suddenly made the PgDraw stop working anymore, without no obvius reason or logic. I guess I have been having timing on my side before . .
I would be very appriciated for any info on this topic as this is alarmingly important to me in my work as a deadline is up for less than 10 days from now and I have not started my actual work.