"""
import sys

ptvsdPath = "C:/Users/jegx/AppData/Local/Programs/Python/Python37/site-packages"

if not any(ptvsdPath in p for p in sys.path):
  sys.path.append(ptvsdPath)


import ptvsd
#ptvsd.enable_attach("my_secret", address = ('127.0.0.1', 3000))

# 5678 is the default attach port in the VS Code debug configurations
#ptvsd.enable_attach(address=('127.0.0.1', 3000), redirect_output=True)
ptvsd.enable_attach(address=('127.0.0.1', 3000))
gh_utils.trace("Waiting for debugger attach")
#print("Waiting for debugger attach")
#Enable the below line of code only if you want the application to wait untill the debugger has attached to it


ptvsd.wait_for_attach()
breakpoint()

#print("Hello from GeeXLab")
gh_utils.trace("Hello from GeeXLab")
#print("Hello from GeeXLab 2")
"""





#----------------------------------------------------
# All GeeXLab modules
#
'''
import gh_asus_aura
import gh_audio
import gh_av
import gh_bullet3
import gh_camera
import gh_font
import gh_gml
import gh_gpu_buffer
import gh_gpu_program
import gh_gpumon
import gh_imagemagick
import gh_imgui
import gh_input
import gh_leap
import gh_light
import gh_logiled
import gh_material
import gh_mesh
import gh_model
import gh_nvg
import gh_node
import gh_object
import gh_opencl
import gh_vr
import gh_ps
import gh_physx3
import gh_physx4
import gh_polyline
import gh_render_target
import gh_renderer  
import gh_rpi
import gh_sqlite3
import gh_texture
import gh_utils
import gh_vb
import gh_vertex_pool
import gh_window
'''
#----------------------------------------------------


import sys

sys.dont_write_bytecode = True


gh_utils.trace("- Python version: " + sys.version)



demo_dir = gh_utils.get_demo_dir() 		
sys.path.append(demo_dir)

lib_dir = gh_utils.get_lib_dir() 		
sys.path.append(lib_dir + "/python/")
sys.path.append(lib_dir + "/python/libfont/")

from imgui import *
from gxl_utils import *
from gxcamera_v1 import *
#from libfont1 import *






"""
import multiprocessing as mp
process_name = mp.Process.name
gh_utils.trace("process_name: " + str(process_name))

gh_utils.trace("mp.Manager START")
mp_mgr = mp.Manager()
gh_utils.trace("mp.Manager END")
"""



#-------------------------------------------------------------------
# NumPy
#-------------------------------------------------------------------
import numpy as np 


gh_utils.trace("Numpy test")
gh_utils.trace("- Numpy version: " + np. __version__)


list1 = [0,1,2,3,4]
arr1d = np.array(list1)
gh_utils.trace("- array type: " + str(type(arr1d)))
gh_utils.trace("- array: " + str(arr1d))




A = np.array([[1, 2],
              [3, 4]])
B = np.array([10, 20])
AB = np.matmul(A, B)
#-------------------------------------------------------------------


# https://numpy.org/devdocs/user/basics.types.html

#verts = np.array([[1.1, 2.1, 3.1],  [10.1, 20.1, 30.1], [40.1, 50.1, 60.1], [70.1, 80.1, 90.1]], dtype=np.single)
verts = np.array([[1.1, 2.1, 3.1],  [10.1, 20.1, 30.1], [40.1, 50.1, 60.1], [70.1, 80.1, 90.1]], dtype=np.float32)


#verts = np.random.rand(3,2)
# array([[ 0.14022471,  0.96360618],  #random
#        [ 0.37601032,  0.25528411],  #random
#        [ 0.49313049,  0.94909878]]) #random

#https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.random.rand.html#numpy.random.rand
verts = np.random.rand(3,4)



#https://numpy.org/doc/stable/reference/generated/numpy.ndarray.astype.html
#verts_f32 = verts.astype(float)

list2 = np.array([1.0,2.1,3.2,4.3,5.4], dtype=np.single)




#-------------------------------------------------------------------
gxl = gxl_utils()



#-------------------------------------------------------------------
winW, winH = gh_window.getsize(0)




#-------------------------------------------------------------------


# vertical synchronization
gh_renderer.vsync(1)


gl_renderer = gh_renderer.get_renderer_model()
gl_version = gh_renderer.get_api_version()

frames = 0
fps_time = 0
fps = 0

win_hovered = 0