diff options
author | Phil Jones <philj56@gmail.com> | 2021-11-01 18:01:34 +0000 |
---|---|---|
committer | Phil Jones <philj56@gmail.com> | 2021-11-01 18:01:34 +0000 |
commit | 3ddbca74567ecab28b2b1624e6e9b026f9705f3c (patch) | |
tree | e5419f2e40b2bdc9dcc6f5ef378ec92967365015 | |
parent | 94fa998b7e3524ce101a977ed3516fac13461287 (diff) |
Switch from OpenGL ES 3 to 2.
-rw-r--r-- | shaders/frag.frag | 10 | ||||
-rw-r--r-- | shaders/vert.vert | 8 | ||||
-rw-r--r-- | src/egl.c | 4 |
3 files changed, 10 insertions, 12 deletions
diff --git a/shaders/frag.frag b/shaders/frag.frag index c6bdbde..3528c6c 100644 --- a/shaders/frag.frag +++ b/shaders/frag.frag @@ -1,4 +1,4 @@ -#version 300 es +#version 100 /* * Copyright (C) 2021 Philip Jones @@ -11,15 +11,13 @@ * I don't think you can really copyright this shader though :) */ -precision highp float; +precision mediump float; -in vec2 Texcoord; - -out vec4 FragColor; +varying vec2 Texcoord; uniform sampler2D tex; void main() { - FragColor = texture(tex, Texcoord); + gl_FragColor = texture2D(tex, Texcoord); } diff --git a/shaders/vert.vert b/shaders/vert.vert index 9d62b85..9d3a0eb 100644 --- a/shaders/vert.vert +++ b/shaders/vert.vert @@ -1,4 +1,4 @@ -#version 300 es +#version 100 /* * Copyright (C) 2017-2020 Philip Jones @@ -10,10 +10,10 @@ * */ -in vec2 position; -in vec2 texcoord; +attribute vec2 position; +attribute vec2 texcoord; -out vec2 Texcoord; +varying vec2 Texcoord; void main() { @@ -37,7 +37,7 @@ void egl_create_context(struct egl *egl, struct wl_display *wl_display) EGLint num_configs; static const EGLint config_attribs[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES3_BIT, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8, @@ -72,7 +72,7 @@ void egl_create_context(struct egl *egl, struct wl_display *wl_display) } static const EGLint context_attribs[] = { - EGL_CONTEXT_MAJOR_VERSION, 3, + EGL_CONTEXT_MAJOR_VERSION, 2, EGL_NONE }; |