-// Copyright (C) 2014 Patryk Nadrowski\r
-// This file is part of the "Irrlicht Engine".\r
-// For conditions of distribution and use, see copyright notice in irrlicht.h\r
-\r
-#pragma once\r
-\r
-#include "EMaterialTypes.h"\r
-#include "IMaterialRenderer.h"\r
-#include "IMaterialRendererServices.h"\r
-#include "IGPUProgrammingServices.h"\r
-#include "irrArray.h"\r
-#include "irrString.h"\r
-\r
-#include "Common.h"\r
-\r
-namespace irr\r
-{\r
-namespace video\r
-{\r
-\r
-class COpenGL3DriverBase;\r
-\r
-class COpenGL3MaterialRenderer : public IMaterialRenderer, public IMaterialRendererServices\r
-{\r
-public:\r
-\r
- COpenGL3MaterialRenderer(\r
- COpenGL3DriverBase* driver,\r
- s32& outMaterialTypeNr,\r
- const c8* vertexShaderProgram = 0,\r
- const c8* pixelShaderProgram = 0,\r
- IShaderConstantSetCallBack* callback = 0,\r
- E_MATERIAL_TYPE baseMaterial = EMT_SOLID,\r
- s32 userData = 0);\r
-\r
- virtual ~COpenGL3MaterialRenderer();\r
-\r
- GLuint getProgram() const;\r
-\r
- virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial,\r
- bool resetAllRenderstates, IMaterialRendererServices* services);\r
-\r
- virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype);\r
-\r
- virtual void OnUnsetMaterial();\r
-\r
- virtual bool isTransparent() const;\r
-\r
- virtual s32 getRenderCapability() const;\r
-\r
- void setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates) override;\r
-\r
- s32 getVertexShaderConstantID(const c8* name) override;\r
- s32 getPixelShaderConstantID(const c8* name) override;\r
- void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) override;\r
- void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) override;\r
- bool setVertexShaderConstant(s32 index, const f32* floats, int count) override;\r
- bool setVertexShaderConstant(s32 index, const s32* ints, int count) override;\r
- bool setVertexShaderConstant(s32 index, const u32* ints, int count) override;\r
- bool setPixelShaderConstant(s32 index, const f32* floats, int count) override;\r
- bool setPixelShaderConstant(s32 index, const s32* ints, int count) override;\r
- bool setPixelShaderConstant(s32 index, const u32* ints, int count) override;\r
-\r
- IVideoDriver* getVideoDriver() override;\r
-\r
-protected:\r
-\r
- COpenGL3MaterialRenderer(COpenGL3DriverBase* driver,\r
- IShaderConstantSetCallBack* callback = 0,\r
- E_MATERIAL_TYPE baseMaterial = EMT_SOLID,\r
- s32 userData = 0);\r
-\r
- void init(s32& outMaterialTypeNr, const c8* vertexShaderProgram, const c8* pixelShaderProgram, bool addMaterial = true);\r
-\r
- bool createShader(GLenum shaderType, const char* shader);\r
- bool linkProgram();\r
-\r
- COpenGL3DriverBase* Driver;\r
- IShaderConstantSetCallBack* CallBack;\r
-\r
- bool Alpha;\r
- bool Blending;\r
- bool FixedBlending;\r
-\r
- struct SUniformInfo\r
- {\r
- core::stringc name;\r
- GLenum type;\r
- GLint location;\r
- };\r
-\r
- GLuint Program;\r
- core::array<SUniformInfo> UniformInfo;\r
- s32 UserData;\r
-};\r
-\r
-\r
-}\r
-}\r
+// Copyright (C) 2014 Patryk Nadrowski
+// This file is part of the "Irrlicht Engine".
+// For conditions of distribution and use, see copyright notice in irrlicht.h
+
+#pragma once
+
+#include "EMaterialTypes.h"
+#include "IMaterialRenderer.h"
+#include "IMaterialRendererServices.h"
+#include "IGPUProgrammingServices.h"
+#include "irrArray.h"
+#include "irrString.h"
+
+#include "Common.h"
+
+namespace irr
+{
+namespace video
+{
+
+class COpenGL3DriverBase;
+
+class COpenGL3MaterialRenderer : public IMaterialRenderer, public IMaterialRendererServices
+{
+public:
+
+ COpenGL3MaterialRenderer(
+ COpenGL3DriverBase* driver,
+ s32& outMaterialTypeNr,
+ const c8* vertexShaderProgram = 0,
+ const c8* pixelShaderProgram = 0,
+ IShaderConstantSetCallBack* callback = 0,
+ E_MATERIAL_TYPE baseMaterial = EMT_SOLID,
+ s32 userData = 0);
+
+ virtual ~COpenGL3MaterialRenderer();
+
+ GLuint getProgram() const;
+
+ virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial,
+ bool resetAllRenderstates, IMaterialRendererServices* services);
+
+ virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype);
+
+ virtual void OnUnsetMaterial();
+
+ virtual bool isTransparent() const;
+
+ virtual s32 getRenderCapability() const;
+
+ void setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates) override;
+
+ s32 getVertexShaderConstantID(const c8* name) override;
+ s32 getPixelShaderConstantID(const c8* name) override;
+ void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) override;
+ void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) override;
+ bool setVertexShaderConstant(s32 index, const f32* floats, int count) override;
+ bool setVertexShaderConstant(s32 index, const s32* ints, int count) override;
+ bool setVertexShaderConstant(s32 index, const u32* ints, int count) override;
+ bool setPixelShaderConstant(s32 index, const f32* floats, int count) override;
+ bool setPixelShaderConstant(s32 index, const s32* ints, int count) override;
+ bool setPixelShaderConstant(s32 index, const u32* ints, int count) override;
+
+ IVideoDriver* getVideoDriver() override;
+
+protected:
+
+ COpenGL3MaterialRenderer(COpenGL3DriverBase* driver,
+ IShaderConstantSetCallBack* callback = 0,
+ E_MATERIAL_TYPE baseMaterial = EMT_SOLID,
+ s32 userData = 0);
+
+ void init(s32& outMaterialTypeNr, const c8* vertexShaderProgram, const c8* pixelShaderProgram, bool addMaterial = true);
+
+ bool createShader(GLenum shaderType, const char* shader);
+ bool linkProgram();
+
+ COpenGL3DriverBase* Driver;
+ IShaderConstantSetCallBack* CallBack;
+
+ bool Alpha;
+ bool Blending;
+ bool FixedBlending;
+
+ struct SUniformInfo
+ {
+ core::stringc name;
+ GLenum type;
+ GLint location;
+ };
+
+ GLuint Program;
+ core::array<SUniformInfo> UniformInfo;
+ s32 UserData;
+};
+
+
+}
+}