Files
NazaraEngine/include/Nazara/Renderer/Shader.hpp
Lynix b243d15c74 Added formats conversion
Functor, NonCopyable, Tuple are now parts of NazaraCore (NazaraCore no
longer needs NazaraUtility)
Added loadFormat image parameter (ask loader to load image in specific
format)
Fixed utility project building
It is now possible to convert, get validity or get name of pixel formats
Changed endianness macros' name
Removed useless NazaraEndianness macro
Removed unused files
2012-05-24 18:55:48 +02:00

80 lines
1.8 KiB
C++

// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_SHADER_HPP
#define NAZARA_SHADER_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Core/NonCopyable.hpp>
#include <Nazara/Core/String.hpp>
#include <Nazara/Math/Matrix4.hpp>
#include <Nazara/Utility/Resource.hpp>
enum nzShaderLanguage
{
nzShaderLanguage_Unknown,
nzShaderLanguage_Cg,
nzShaderLanguage_GLSL
};
enum nzShaderType
{
nzShaderType_Fragment,
nzShaderType_Geometry,
nzShaderType_Vertex,
nzShaderType_Count
};
class NzRenderer;
class NzShaderImpl;
class NAZARA_API NzShader : public NzResource, NzNonCopyable
{
friend class NzRenderer;
public:
NzShader();
NzShader(nzShaderLanguage language);
~NzShader();
bool Create(nzShaderLanguage language);
bool Compile();
void Destroy();
NzString GetLog() const;
nzShaderLanguage GetLanguage() const;
NzString GetSourceCode(nzShaderType type) const;
bool IsCompiled() const;
bool IsLoaded(nzShaderType type) const;
bool Load(nzShaderType type, const NzString& source);
bool LoadFromFile(nzShaderType type, const NzString& source);
bool Lock();
bool SendBoolean(const NzString& name, bool value);
bool SendDouble(const NzString& name, double value);
bool SendFloat(const NzString& name, float value);
bool SendInteger(const NzString& name, int value);
bool SendMatrix(const NzString& name, const NzMatrix4d& matrix);
bool SendMatrix(const NzString& name, const NzMatrix4f& matrix);
void Unlock();
static bool IsLanguageSupported(nzShaderLanguage language);
static bool IsTypeSupported(nzShaderType type);
private:
NzShaderImpl* m_impl;
bool m_compiled;
};
#endif // NAZARA_SHADER_HPP