Repository: vispy/vispy

Issue:
Some visuals doesn't show in notebooks
Hello @djhoese , following the discussion on gitter, here's a small example illustrating an image that is properly plotted and markers that doesn't show. Same behavior inside jupyter notebook and jupyter lab. Can you please telle me how to get the log? Because in the terminal I've no errors.

# Displaying the image
```python
import numpy as np

from vispy import scene
from vispy import app
from vispy.scene.cameras import PanZoomCamera

# camera and scene canvas
cam = PanZoomCamera(rect=(-1, -1, 7, 7))
sc = scene.SceneCanvas(bgcolor='black', show=True)
wc = sc.central_widget.add_view(camera=cam)
# image
scene.visuals.Image(np.arange(25).reshape(5, 5), parent=wc.scene)

sc.show()
```
![Screenshot_20191116_094906](https://user-images.githubusercontent.com/15892073/68990696-600e9700-0856-11ea-9860-b7b37d88af12.png)

# Markers are not plotted

```python
# camera and scene canvas
cam_2 = PanZoomCamera(rect=(-1, -1, 7, 7))
sc_2 = scene.SceneCanvas(bgcolor='black', show=True)
wc_2 = sc_2.central_widget.add_view(camera=cam_2)
# markers
pos = np.random.uniform(0, 5, (1000, 2))
scene.visuals.Markers(pos=pos, parent=wc_2.scene, face_color='red')

sc_2.show()
```
![Screenshot_20191116_095115](https://user-images.githubusercontent.com/15892073/68990712-a5cb5f80-0856-11ea-9965-eb4256ae4313.png)



Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -209,7 +209,7 @@ def run(self):
         'jsdeps': NPM,
     },
     python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*',
-    install_requires=['numpy', 'freetype-py'],
+    install_requires=['numpy', 'freetype-py', 'setuptools'],
     setup_requires=['numpy', 'cython', 'setuptools_scm', 'setuptools_scm_git_archive'],
     extras_require={
         'ipython-static': ['ipython'],
diff --git a/vispy/gloo/glir.py b/vispy/gloo/glir.py
--- a/vispy/gloo/glir.py
+++ b/vispy/gloo/glir.py
@@ -582,7 +582,7 @@ def _convert_es2_shader(shader):
     for line in shader.lstrip().splitlines():
         line_strip = line.lstrip()
         if line_strip.startswith('#version'):
-            has_version = True
+            # has_version = True
             continue
         if line_strip.startswith('#extension'):
             extensions.append(line_strip)


Test patch:
diff --git a/vispy/gloo/tests/test_glir.py b/vispy/gloo/tests/test_glir.py
--- a/vispy/gloo/tests/test_glir.py
+++ b/vispy/gloo/tests/test_glir.py
@@ -46,7 +46,21 @@ def test_queue():
     
     # Convert for es2
     shader3 = glir.convert_shader('es2', shader2)
+    # make sure precision float is still in the shader
+    # it may not be the first (precision int might be there)
     assert 'precision highp float;' in shader3
+    # precisions must come before code
+    assert shader3.startswith('precision')
+
+    # Define shader with version number
+    shader4 = """
+        #version 100; precision highp float;uniform mediump vec4 u_foo;uniform vec4 u_bar;
+        """.strip().replace(';', ';\n')
+    shader5 = glir.convert_shader('es2', shader4)
+    assert 'precision highp float;' in shader5
+    # make sure that precision is first (version is removed)
+    # precisions must come before code
+    assert shader3.startswith('precision')
 
 
 @requires_application()