Skip to content

Commit

Permalink
Merge pull request #44 from AlwinEsch/add-angle
Browse files Browse the repository at this point in the history
[Matrix] Add full shadertoy support to Windows (over Angle), add screenshots and cleanup
  • Loading branch information
AlwinEsch authored Aug 30, 2019
2 parents e6fe746 + 800be0f commit 3eae7bd
Show file tree
Hide file tree
Showing 40 changed files with 742 additions and 3,586 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ matrix:
sudo: required
compiler: clang
- os: osx
osx_image: xcode9
- os: osx
osx_image: xcode9.4
osx_image: xcode10.2

before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq; fi
Expand All @@ -36,7 +34,7 @@ before_install:
#
before_script:
- cd $TRAVIS_BUILD_DIR/..
- git clone --branch Leia --depth=1 https://github.com/xbmc/xbmc.git
- git clone --branch master --depth=1 https://github.com/xbmc/xbmc.git
- cd ${app_id} && mkdir build && cd build
- mkdir -p definition/${app_id}
- echo ${app_id} $TRAVIS_BUILD_DIR $TRAVIS_COMMIT > definition/${app_id}/${app_id}.txt
Expand Down
66 changes: 26 additions & 40 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,37 @@ project(visualization.shadertoy)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR})

find_package(Kodi REQUIRED)
find_package(p8-platform REQUIRED)

add_subdirectory(lib/kissfft)

if(NOT WIN32)
if(APP_RENDER_SYSTEM STREQUAL "gl" OR NOT APP_RENDER_SYSTEM)
find_package(OpenGl REQUIRED)
set(DEPLIBS ${OPENGL_LIBRARIES})
set(includes ${OPENGL_INCLUDE_DIR})
add_definitions(${OPENGL_DEFINITIONS})
else()
find_package(OpenGLES REQUIRED)
set(DEPLIBS ${OPENGLES_LIBRARIES})
set(includes ${OPENGLES_INCLUDE_DIR})
add_definitions(${OPENGLES_DEFINITIONS})
endif()

include_directories(${GLM_INCLUDE_DIR}
${KODI_INCLUDE_DIR}/.. # Hack way with "/..", need bigger Kodi cmake rework to match right include ways
${PROJECT_SOURCE_DIR}/lib)

if(${CORE_SYSTEM_NAME} STREQUAL "osx" OR
${CORE_SYSTEM_NAME} STREQUAL "ios" OR
${CORE_SYSTEM_NAME} STREQUAL "darwin_embedded")
list(APPEND DEPLIBS "-framework CoreVideo")
endif()

set(SHADERTOY_SOURCES src/lodepng.cpp
src/main.cpp)

set(SHADERTOY_HEADERS src/lodepng.h
src/main.h)
elseif(WIN32)
include_directories(${KODI_INCLUDE_DIR}/.. # Hack way with "/..", need bigger Kodi cmake rework to match right include ways (becomes done in future)
${p8-platform_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/lib/kissfft
${CMAKE_INCLUDE_PATH})

set(SHADERTOY_SOURCES src/WICTextureLoader.cpp
src/maindx.cpp)

set(SHADERTOY_HEADERS src/lodepng.h
src/WICTextureLoader.h)
if(NOT WIN32 AND (APP_RENDER_SYSTEM STREQUAL "gl" OR NOT APP_RENDER_SYSTEM))
find_package(OpenGl REQUIRED)
set(DEPLIBS ${OPENGL_LIBRARIES})
set(includes ${OPENGL_INCLUDE_DIR})
add_definitions(${OPENGL_DEFINITIONS})
else()
find_package(OpenGLES REQUIRED)
set(DEPLIBS ${OPENGLES_LIBRARIES})
set(includes ${OPENGLES_INCLUDE_DIR})
add_definitions(${OPENGLES_DEFINITIONS})
endif()

include_directories(${GLM_INCLUDE_DIR}
${KODI_INCLUDE_DIR}/.. # Hack way with "/..", need bigger Kodi cmake rework to match right include ways
${PROJECT_SOURCE_DIR}/lib)

if(${CORE_SYSTEM_NAME} STREQUAL "osx" OR
${CORE_SYSTEM_NAME} STREQUAL "ios" OR
${CORE_SYSTEM_NAME} STREQUAL "darwin_embedded")
list(APPEND DEPLIBS "-framework CoreVideo")
endif()

set(SHADERTOY_SOURCES src/lodepng.cpp
src/main.cpp)

set(SHADERTOY_HEADERS src/lodepng.h
src/main.h)

list(APPEND DEPLIBS kissfft)
list(APPEND DEPENDS glm)

Expand Down
83 changes: 48 additions & 35 deletions FindOpenGLES.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,60 @@
# OPENGLES_LIBRARIES - the OpenGLES libraries
# OPENGLES_DEFINITIONS - the OpenGLES definitions
#
# Note:
# On Windows with angle the *_INCLUDE_DIRS and
# *_DEFINITIONS are undefined, but are set
# global by the kodi-angle package.

if(CORE_PLATFORM_NAME_LC STREQUAL rbpi)
set(_brcmprefix brcm)
endif()
if(WIN32)
# defined here and not on addon to have it free of OS related 'if'
# and this file as standard for addons where need it
find_package(kodi-angle REQUIRED)
set(OPENGLES_LIBRARIES kodi::angle::libGLESv2 kodi::angle::libEGL)
set(OPENGLES_FOUND ${kodi-angle_FOUND})
set(OPENGLES_DEFINITIONS -DHAS_GLES=3)
else()
if(CORE_PLATFORM_NAME_LC STREQUAL rbpi)
set(_brcmprefix brcm)
endif()

if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_OPENGLES ${_brcmprefix}glesv2 QUIET)
endif()
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_OPENGLES ${_brcmprefix}glesv2 QUIET)
endif()

if(NOT CORE_SYSTEM_NAME STREQUAL ios AND
NOT CORE_SYSTEM_NAME STREQUAL darwin_embedded)
find_path(OPENGLES_INCLUDE_DIR GLES2/gl2.h
PATHS ${PC_OPENGLES_INCLUDEDIR})
find_library(OPENGLES_gl_LIBRARY NAMES ${_brcmprefix}GLESv2
PATHS ${PC_OPENGLES_LIBDIR})
else()
find_library(OPENGLES_gl_LIBRARY NAMES OpenGLES
PATHS ${CMAKE_OSX_SYSROOT}/System/Library
PATH_SUFFIXES Frameworks
NO_DEFAULT_PATH)
set(OPENGLES_INCLUDE_DIR ${OPENGLES_gl_LIBRARY}/Headers)
endif()
if(NOT CORE_SYSTEM_NAME STREQUAL ios AND
NOT CORE_SYSTEM_NAME STREQUAL darwin_embedded)
find_path(OPENGLES_INCLUDE_DIR GLES2/gl2.h
PATHS ${PC_OPENGLES_INCLUDEDIR})
find_library(OPENGLES_gl_LIBRARY NAMES ${_brcmprefix}GLESv2
PATHS ${PC_OPENGLES_LIBDIR})
else()
find_library(OPENGLES_gl_LIBRARY NAMES OpenGLES
PATHS ${CMAKE_OSX_SYSROOT}/System/Library
PATH_SUFFIXES Frameworks
NO_DEFAULT_PATH)
set(OPENGLES_INCLUDE_DIR ${OPENGLES_gl_LIBRARY}/Headers)
endif()

find_path(OPENGLES3_INCLUDE_DIR GLES3/gl3.h)
find_path(OPENGLES3_INCLUDE_DIR GLES3/gl3.h)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenGLES
REQUIRED_VARS OPENGLES_gl_LIBRARY OPENGLES_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenGLES
REQUIRED_VARS OPENGLES_gl_LIBRARY OPENGLES_INCLUDE_DIR)

find_path(OPENGLES3_INCLUDE_DIR GLES3/gl3.h
PATHS ${PC_OPENGLES_INCLUDEDIR})
find_path(OPENGLES3_INCLUDE_DIR GLES3/gl3.h
PATHS ${PC_OPENGLES_INCLUDEDIR})

if(OPENGLES_FOUND)
set(OPENGLES_LIBRARIES ${OPENGLES_gl_LIBRARY})
if(OPENGLES3_INCLUDE_DIR)
set(OPENGLES_INCLUDE_DIRS ${OPENGLES_INCLUDE_DIR} ${OPENGLES3_INCLUDE_DIR})
set(OPENGLES_DEFINITIONS -DHAS_GLES=3)
mark_as_advanced(OPENGLES_INCLUDE_DIR OPENGLES3_INCLUDE_DIR OPENGLES_gl_LIBRARY)
else()
set(OPENGLES_INCLUDE_DIRS ${OPENGLES_INCLUDE_DIR})
set(OPENGLES_DEFINITIONS -DHAS_GLES=2)
mark_as_advanced(OPENGLES_INCLUDE_DIR OPENGLES_gl_LIBRARY)
if(OPENGLES_FOUND)
set(OPENGLES_LIBRARIES ${OPENGLES_gl_LIBRARY})
if(OPENGLES3_INCLUDE_DIR)
set(OPENGLES_INCLUDE_DIRS ${OPENGLES_INCLUDE_DIR} ${OPENGLES3_INCLUDE_DIR})
set(OPENGLES_DEFINITIONS -DHAS_GLES=3)
mark_as_advanced(OPENGLES_INCLUDE_DIR OPENGLES3_INCLUDE_DIR OPENGLES_gl_LIBRARY)
else()
set(OPENGLES_INCLUDE_DIRS ${OPENGLES_INCLUDE_DIR})
set(OPENGLES_DEFINITIONS -DHAS_GLES=2)
mark_as_advanced(OPENGLES_INCLUDE_DIR OPENGLES_gl_LIBRARY)
endif()
endif()
endif()
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
buildPlugin(version: "Leia", platforms: ['android-armv7', 'android-aarch64', 'windows-i686', 'windows-x86_64'])
buildPlugin(version: "Matrix")
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# visualization.shadertoy addon for Kodi

This is a [Kodi](http://kodi.tv) visualization addon.
This is a [Kodi](https://kodi.tv) visualization addon.

[![Build Status](https://travis-ci.org/xbmc/visualization.shadertoy.svg?branch=master)](https://travis-ci.org/xbmc/visualization.shadertoy)
[![Build Status](https://ci.appveyor.com/api/projects/status/github/xbmc/visualization.shadertoy?svg=true)](https://ci.appveyor.com/project/xbmc/visualization-shadertoy)
[![Build Status](https://travis-ci.org/xbmc/visualization.shadertoy.svg?branch=Matrix)](https://travis-ci.org/xbmc/visualization.shadertoy/branches)
[![Build Status](https://ci.appveyor.com/api/projects/status/github/xbmc/visualization.shadertoy?branch=Matrix&svg=true)](https://ci.appveyor.com/project/xbmc/visualization-shadertoy?branch=Matrix)

## Build instructions

Expand All @@ -16,7 +16,7 @@ Also make sure you follow this README from the branch in question.
The following instructions assume you will have built Kodi already in the `kodi-build` directory
suggested by the README.

1. `git clone --branch Leia https://github.com/xbmc/xbmc.git`
1. `git clone --branch master https://github.com/xbmc/xbmc.git`
2. `git clone https://github.com/xbmc/visualization.shadertoy.git`
3. `cd visualization.shadertoy && mkdir build && cd build`
4. `cmake -DADDONS_TO_BUILD=visualization.shadertoy -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../xbmc/kodi-build/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addons`
Expand Down
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ environment:
CONFIG: Release
- GENERATOR: "Visual Studio 15 Win64"
CONFIG: Release
WINSTORE: -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0.16299.0"
WINSTORE: -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0.17763.0"
- GENERATOR: "Visual Studio 15 ARM"
CONFIG: Release
WINSTORE: -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0.16299.0"
WINSTORE: -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0.17763.0"

build_script:
- cd ..
- git clone --branch Leia --depth=1 https://github.com/xbmc/xbmc.git
- git clone --branch master --depth=1 https://github.com/xbmc/xbmc.git
- cd %app_id%
- mkdir build
- cd build
Expand Down
Loading

0 comments on commit 3eae7bd

Please sign in to comment.