
    ^h              	       F   S r SSKrSSKrSSKrSSKJr  SSKJr  SSK	J
r  Sr\R                  \R                  -  \R                  -  rSr\R                  S:X  a#   \R$                  " S\R
                  S/ SSS	9r\rO&\R.                  (       a  \R"                  rO\" S
5      eS rS rS rS r\R8                  " \R:                  5        \R<                  " \5        \" \R@                  5      (       a'  \R@                  " \RB                  \RD                  5        \RF                  " S5        \RH                  " SS5        \RJ                  " 5         \RL                  " \5        \RN                  " \5        \RP                  " \5        S r)g! \ a  r\" S
5      \eSrCff = f)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                      g Nr   r       ]/home/james-whalen/.local/lib/python3.13/site-packages/IPython/terminal/pt_inputhooks/glut.pyglut_displayr   <       r   c                      g r   r   r   r   r   	glut_idler   @   r   r   c                  B    [         R                  " 5         [        5         g r   )glutglutHideWindowglutMainLoopEventr   r   r   
glut_closer   D   s    r   c                     [         R                   " [         R                  [         R                  5        [        S5        g )Nz
KeyboardInterrupt)signalSIGINTdefault_int_handlerprint)signumframes     r   glut_int_handlerr!   I   s#    
MM&--!;!;<	
 r   s   ipython   c                 (   [         R                   " [         R                  [        5         [        5       n[        R
                  " 5       S:X  a!  [        R                  " S5        [        5         gU R                  5       (       d  [        5         [        5       U-
  nUS:  a  [        R                  " S5        O3US:  a  [        R                  " S5        O[        R                  " S5        U R                  5       (       d  M~  gg! [         a     gf = f)	a1  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D /BD 
DD)*__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4+	 &	..
	,- -
		
! sxx    + -88==@   z #   1        j "   l $   9 ._  80167	88s   F F 	FF 