
    f                     4   d Z ddlZddlZddlZddlmZ ddlmZ ddl	m
Z dZej                  ej                  z  ej                  z  ZdZej                  dk(  r&	  ej$                  dej
                  dg dd	      ZeZn!ej.                  rej"                  Zn ed
      d Zd Zd Zd Z ej8                  ej:                          ej<                  e        eej@                        r' ej@                  ejB                  ejD                          ejF                  d        ejH                  dd        ejJ                           ejL                  e        ejN                  e        ejP                  e       d Z)y# e$ rZ ed
      edZ[ww xY w)z8GLUT Input hook for interactive use with prompt_toolkit
    N)default_timer<   darwinglutCheckLoopzglutCheckLoop(  ) -> None )dll
resultTypeargTypesdocargNamesz[Your glut implementation does not allow interactive sessions. Consider installing freeglut.c                       y Nr   r       ^/var/www/cvtools/html/venv/lib/python3.12/site-packages/IPython/terminal/pt_inputhooks/glut.pyglut_displayr   <       r   c                       y r   r   r   r   r   	glut_idler   @   r   r   c                  @    t        j                          t                y r   )glutglutHideWindowglutMainLoopEventr   r   r   
glut_closer   D   s    r   c                 ~    t        j                   t         j                  t         j                         t        d       y )Nz
KeyboardInterrupt)signalSIGINTdefault_int_handlerprint)signumframes     r   glut_int_handlerr!   I   s#    
MM&--!;!;<	
 r   s   ipython   c                    t        j                   t         j                  t               	 t               }t	        j
                         dk(  r t	        j                  d       t                y| j                         stt                t               |z
  }|dkD  rt        j                  d       n0|dkD  rt        j                  d       nt        j                  d       | j                         ssyy# t        $ r Y yw xY w)	aE  Run the pyglet event loop by processing pending events only.

    This keeps processing pending events until stdin is ready.  After
    processing all pending events, a call to time.sleep is inserted.  This is
    needed, otherwise, CPU usage is at 100%.  This sleep time should be tuned
    though for best performance.
    r   r"   g      $@g      ?g?g?gMbP?N)r   r   r!   clockr   glutGetWindowglutSetWindowr   input_is_readytimesleepKeyboardInterrupt)contextt	used_times      r   	inputhookr.   ^   s     MM&--!12!G 1$#((* !I4

3S 

4  

5!- ((*.  s   A C0 +BC0 0	C<;C<)*__doc__sysr(   r   OpenGL.GLUTGLUTr   OpenGL.platformplatformtimeitr   r$   glut_fpsGLUT_DOUBLE	GLUT_RGBA
GLUT_DEPTHglut_display_moder   createBaseFunctionr   AttributeErroreRuntimeErrorHAVE_FREEGLUTr   r   r   r!   glutInitargvglutInitDisplayModeboolglutSetOptionGLUT_ACTION_ON_WINDOW_CLOSE GLUT_ACTION_GLUTMAINLOOP_RETURNSglutCreateWindowglutReshapeWindowr   glutWMCloseFuncglutDisplayFuncglutIdleFuncr.   r   r   r   <module>rL      s  (     " )  %%^^$__%   <<8
83334+	 &	..
	,- -
		
! sxx    + -D88==@   z #   1        j "   l $   9 ._  80167	88s   "F F		FF