# Path: p5/sketch/util.py
# def read_shader(filename):
#     """Reads a shader in string mode and returns the content
#     """
#     renderer_name = ""
#     if builtins.current_renderer == "vispy":
#         if p5.mode == 'P2D':
#             renderer_name = "Vispy2DRenderer"
#         elif p5.mode == 'P3D':
#             renderer_name = "Vispy3DRenderer"
# 
#     # This check could be skipped, it is only present to debug tests
#     if renderer_name == "":
#         raise ValueError("Renderer Name is not defined. \nValues : p5.mode = {} builtins.renderer = {}"
#                          .format(p5.mode, builtins.current_renderer))
# 
#     return pkgutil.get_data('p5', os.path.join(
#         'sketch/' + renderer_name + '/shaders/', filename)).decode()


from collections import namedtuple
from ..util import read_shader
#
# Part of p5: A Python package based on Processing
# Copyright (C) 2017-2019 Abhik Pal
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
"""Shaders used by the main program"""


ShaderSource = namedtuple('ShaderSource', 'vert frag')

src_default = ShaderSource(
    read_shader('2d/default2d.vert'),
    read_shader('common/default.frag'))
src_texture = ShaderSource(
    read_shader('2d/texture.vert'),
    read_shader('2d/texture.frag'))
# Shader sources to draw framebuffers textues.
src_fbuffer = ShaderSource(

# Path: p5/sketch/util.py
# def read_shader(filename):
#     """Reads a shader in string mode and returns the content
#     """
#     renderer_name = ""
#     if builtins.current_renderer == "vispy":
#         if p5.mode == 'P2D':
#             renderer_name = "Vispy2DRenderer"
#         elif p5.mode == 'P3D':
#             renderer_name = "Vispy3DRenderer"
# 
#     # This check could be skipped, it is only present to debug tests
#     if renderer_name == "":
#         raise ValueError("Renderer Name is not defined. \nValues : p5.mode = {} builtins.renderer = {}"
#                          .format(p5.mode, builtins.current_renderer))
# 
#     return pkgutil.get_data('p5', os.path.join(
#         'sketch/' + renderer_name + '/shaders/', filename)).decode()


# Path: p5/sketch/Vispy2DRenderer/shaders2d.py
from collections import namedtuple
from ..util import read_shader

#
# Part of p5: A Python package based on Processing
# Copyright (C) 2017-2019 Abhik Pal
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
"""Shaders used by the main program"""


ShaderSource = namedtuple('ShaderSource', 'vert frag')

src_default = ShaderSource(
    read_shader('2d/default2d.vert'),
    read_shader('common/default.frag'))
src_texture = ShaderSource(
    read_shader('2d/texture.vert'),
    read_shader('2d/texture.frag'))
# Shader sources to draw framebuffers textues.
src_fbuffer = ShaderSource(

    read_shader('common/fbuffer.vert'),