From a4e5c0afd28f468b833a6db26fa7e30ef2023f3c Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Tue, 19 Mar 2019 23:34:24 +0100 Subject: [PATCH 1/3] update/fix shaders (OSX need version defined) --- .../resources/shaders/GL/frag.glsl | 10 ++++++++++ .../resources/shaders/GL/vert.glsl | 14 ++++++++++++++ .../resources/shaders/{ => GLES}/frag.glsl | 4 +--- .../resources/shaders/{ => GLES}/vert.glsl | 2 ++ src/GreyNetic.cpp | 4 ++-- 5 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 screensaver.greynetic/resources/shaders/GL/frag.glsl create mode 100644 screensaver.greynetic/resources/shaders/GL/vert.glsl rename screensaver.greynetic/resources/shaders/{ => GLES}/frag.glsl (67%) rename screensaver.greynetic/resources/shaders/{ => GLES}/vert.glsl (93%) diff --git a/screensaver.greynetic/resources/shaders/GL/frag.glsl b/screensaver.greynetic/resources/shaders/GL/frag.glsl new file mode 100644 index 0000000..db67776 --- /dev/null +++ b/screensaver.greynetic/resources/shaders/GL/frag.glsl @@ -0,0 +1,10 @@ +#version 150 + +in vec4 v_color; + +out vec4 fragColor; + +void main() +{ + fragColor = v_color; +} diff --git a/screensaver.greynetic/resources/shaders/GL/vert.glsl b/screensaver.greynetic/resources/shaders/GL/vert.glsl new file mode 100644 index 0000000..6b97681 --- /dev/null +++ b/screensaver.greynetic/resources/shaders/GL/vert.glsl @@ -0,0 +1,14 @@ +#version 150 + +uniform mat4 u_projModelMat; + +in vec4 a_position; +in vec4 a_color; + +out vec4 v_color; + +void main () +{ + gl_Position = u_projModelMat * a_position; + v_color = a_color; +} diff --git a/screensaver.greynetic/resources/shaders/frag.glsl b/screensaver.greynetic/resources/shaders/GLES/frag.glsl similarity index 67% rename from screensaver.greynetic/resources/shaders/frag.glsl rename to screensaver.greynetic/resources/shaders/GLES/frag.glsl index 1ee4d13..f4019fa 100644 --- a/screensaver.greynetic/resources/shaders/frag.glsl +++ b/screensaver.greynetic/resources/shaders/GLES/frag.glsl @@ -1,6 +1,4 @@ -#ifndef GL_ES -#define lowp -#endif +#version 100 varying lowp vec4 v_color; diff --git a/screensaver.greynetic/resources/shaders/vert.glsl b/screensaver.greynetic/resources/shaders/GLES/vert.glsl similarity index 93% rename from screensaver.greynetic/resources/shaders/vert.glsl rename to screensaver.greynetic/resources/shaders/GLES/vert.glsl index ea69435..8f434c4 100644 --- a/screensaver.greynetic/resources/shaders/vert.glsl +++ b/screensaver.greynetic/resources/shaders/GLES/vert.glsl @@ -1,3 +1,5 @@ +#version 100 + uniform mat4 u_projModelMat; attribute vec4 a_position; diff --git a/src/GreyNetic.cpp b/src/GreyNetic.cpp index d7c7758..22ce38b 100644 --- a/src/GreyNetic.cpp +++ b/src/GreyNetic.cpp @@ -263,8 +263,8 @@ CScreensaverGreyNetic::~CScreensaverGreyNetic() bool CScreensaverGreyNetic::Start() { #ifndef WIN32 - if (!LoadShaderFiles(kodi::GetAddonPath("resources/shaders/vert.glsl"), - kodi::GetAddonPath("resources/shaders/frag.glsl"))) + if (!LoadShaderFiles(kodi::GetAddonPath("resources/shaders/" GL_TYPE_STRING "/vert.glsl"), + kodi::GetAddonPath("resources/shaders/" GL_TYPE_STRING "/frag.glsl"))) { kodi::Log(ADDON_LOG_ERROR, "Failed to load GL shaders"); return false; From 07d6f57872ea4e0b25eea18495c01a67466fc54e Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Tue, 19 Mar 2019 23:32:08 +0100 Subject: [PATCH 2/3] cleanup CMakeLists.txt --- CMakeLists.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 81d54ca..d36cc2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,8 @@ +cmake_minimum_required(VERSION 3.5) project(screensaver.greynetic) -cmake_minimum_required(VERSION 3.3) - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}) -enable_language(CXX) - find_package(Kodi REQUIRED) if(NOT WIN32) From c15b70ad706a8e68e2598f5b0e09e55030ba37e5 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Tue, 19 Mar 2019 23:24:59 +0100 Subject: [PATCH 3/3] Increase Version to 2.2.1 --- screensaver.greynetic/addon.xml.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/screensaver.greynetic/addon.xml.in b/screensaver.greynetic/addon.xml.in index be85412..322c32a 100644 --- a/screensaver.greynetic/addon.xml.in +++ b/screensaver.greynetic/addon.xml.in @@ -1,7 +1,7 @@  @ADDON_DEPENDS@