2 #ifndef __EFFEKSEERRENDERER_GL_BASE_PRE_H__
3 #define __EFFEKSEERRENDERER_GL_BASE_PRE_H__
12 #if defined(__EFFEKSEER_RENDERER_GLES2__)
14 #if defined(__APPLE__)
15 #include <OpenGLES/ES2/gl.h>
16 #include <OpenGLES/ES2/glext.h>
18 #include <GLES2/gl2.h>
19 #include <GLES2/gl2ext.h>
22 #elif defined(__EFFEKSEER_RENDERER_GLES3__)
24 #if defined(__APPLE__)
25 #include <OpenGLES/ES3/gl.h>
27 #define GL_GLEXT_PROTOTYPES
28 #include <GLES3/gl3.h>
31 #elif defined(__EFFEKSEER_RENDERER_GL2__)
35 #elif defined(__APPLE__)
36 #define GL_SILENCE_DEPRECATION
37 #include <OpenGL/gl.h>
46 #elif defined(__APPLE__)
47 #define GL_SILENCE_DEPRECATION
48 #include <OpenGL/gl3.h>
50 #define GL_GLEXT_PROTOTYPES
57 #pragma comment(lib, "opengl32.lib")
60 namespace EffekseerRendererGL
65 enum class OpenGLDeviceType
75 #endif // __EFFEKSEERRENDERER_GL_BASE_PRE_H__
77 #ifndef __EFFEKSEERRENDERER_RENDERER_H__
78 #define __EFFEKSEERRENDERER_RENDERER_H__
83 #include <Effekseer.h>
99 namespace EffekseerRenderer
103 using RendererRef = ::Effekseer::RefPtr<Renderer>;
110 struct ExternalShaderSettings
112 Effekseer::Backend::ShaderRef StandardShader;
113 Effekseer::Backend::ShaderRef ModelShader;
114 Effekseer::AlphaBlendType Blend;
123 class DistortingCallback
129 virtual ~DistortingCallback()
163 enum class ProxyTextureType
169 class CommandList :
public ::Effekseer::IReference
172 CommandList() =
default;
173 virtual ~CommandList() =
default;
176 class SingleFrameMemoryPool :
public ::Effekseer::IReference
179 SingleFrameMemoryPool() =
default;
180 virtual ~SingleFrameMemoryPool() =
default;
192 struct DepthReconstructionParameter
194 float DepthBufferScale = 1.0f;
195 float DepthBufferOffset = 0.0f;
196 float ProjectionMatrix33 = 0.0f;
197 float ProjectionMatrix34 = 0.0f;
198 float ProjectionMatrix43 = 0.0f;
199 float ProjectionMatrix44 = 0.0f;
202 ::Effekseer::ModelLoaderRef CreateModelLoader(::Effekseer::Backend::GraphicsDeviceRef gprahicsDevice, ::Effekseer::FileInterfaceRef fileInterface =
nullptr);
204 class Renderer :
public ::Effekseer::IReference
211 std::unique_ptr<Impl> impl;
325 virtual void SetCameraParameter(const ::Effekseer::Vector3D& front, const ::Effekseer::Vector3D& position);
355 virtual ::Effekseer::TextureLoaderRef
CreateTextureLoader(::Effekseer::FileInterfaceRef fileInterface =
nullptr) = 0;
360 virtual ::Effekseer::ModelLoaderRef
CreateModelLoader(::Effekseer::FileInterfaceRef fileInterface =
nullptr) = 0;
368 virtual ::Effekseer::MaterialLoaderRef
CreateMaterialLoader(::Effekseer::FileInterfaceRef fileInterface =
nullptr) = 0;
425 virtual void SetRenderMode(Effekseer::RenderMode renderMode);
467 virtual void SetTime(
float time);
485 virtual const ::Effekseer::Backend::TextureRef&
GetBackground();
492 virtual void SetBackground(::Effekseer::Backend::TextureRef texture);
559 #endif // __EFFEKSEERRENDERER_RENDERER_H__
560 #ifndef __EFFEKSEERRENDERER_TEXTURELOADER_H__
561 #define __EFFEKSEERRENDERER_TEXTURELOADER_H__
563 #include <Effekseer.h>
565 namespace EffekseerRenderer
568 ::Effekseer::TextureLoaderRef CreateTextureLoader(::Effekseer::Backend::GraphicsDeviceRef gprahicsDevice,
569 ::Effekseer::FileInterfaceRef fileInterface =
nullptr,
570 ::Effekseer::ColorSpaceType colorSpaceType = ::Effekseer::ColorSpaceType::Gamma);
574 #endif // __EFFEKSEERRENDERER_TEXTURELOADER_H__
576 #ifndef __EFFEKSEERRENDERER_GL_RENDERER_H__
577 #define __EFFEKSEERRENDERER_GL_RENDERER_H__
590 namespace EffekseerRendererGL
593 ::Effekseer::Backend::GraphicsDeviceRef CreateGraphicsDevice(OpenGLDeviceType deviceType,
bool isExtensionsEnabled =
true);
595 ::Effekseer::MaterialLoaderRef CreateMaterialLoader(Effekseer::Backend::GraphicsDeviceRef graphicsDevice,
596 ::Effekseer::FileInterfaceRef fileInterface =
nullptr);
598 Effekseer::Backend::TextureRef CreateTexture(Effekseer::Backend::GraphicsDeviceRef graphicsDevice, GLuint buffer,
bool hasMipmap,
const std::function<
void()>& onDisposed);
609 TextureProperty GetTextureProperty(::Effekseer::Backend::TextureRef texture);
612 using RendererRef = ::Effekseer::RefPtr<Renderer>;
642 static RendererRef
Create(int32_t squareMaxCount, OpenGLDeviceType deviceType = OpenGLDeviceType::OpenGL2,
bool isExtensionsEnabled =
true);
644 static RendererRef
Create(Effekseer::Backend::GraphicsDeviceRef graphicsDevice, int32_t squareMaxCount);
663 virtual void SetBackground(GLuint background,
bool hasMipmap =
false) = 0;
684 #endif // __EFFEKSEERRENDERER_GL_RENDERER_H__
virtual void GetDepth(::Effekseer::Backend::TextureRef &texture, DepthReconstructionParameter &reconstructionParam)
Get a depth texture and parameters to reconstruct from z to depth
virtual void SetExternalShaderSettings(const std::shared_ptr< ExternalShaderSettings > &settings)
Specify external shader settings.
virtual void SetCameraParameter(const ::Effekseer::Vector3D &front, const ::Effekseer::Vector3D &position)
Set a front direction and position of camera manually.
virtual Effekseer::RenderMode GetRenderMode() const
Get a render mode.
virtual void ResetDrawVertexCount()
Reset the number of vertex drawn.
virtual int32_t GetDrawVertexCount() const
Get the number of vertex drawn.
virtual void SetTime(float time)
Set a current time (s)
Definition: EffekseerRendererDX9.h:151
virtual ::Effekseer::Matrix44 GetCameraMatrix() const
Get a camera matrix.
virtual int32_t GetDrawCallCount() const
Get draw call count.
virtual std::shared_ptr< ExternalShaderSettings > GetExternalShaderSettings() const
Get external shader settings.
virtual ::Effekseer::TextureLoaderRef CreateTextureLoader(::Effekseer::FileInterfaceRef fileInterface=nullptr)=0
標準のテクスチャ読込クラスを生成する。
virtual void SetMaintainGammaColorInLinearColorSpace(bool value)
Specify whether maintain gamma color in a linear color space.
virtual UVStyle GetBackgroundTextureUVStyle() const
Get an UV Style of background when particles are rendered.
virtual void ResetDrawCallCount()
Reset draw call count.
virtual ::Effekseer::Vector3D GetCameraFrontDirection() const
Get a front direction of camera.
virtual ::Effekseer::Matrix44 GetCameraProjectionMatrix() const
Get a camera projection matrix.
virtual void SetLightColor(const ::Effekseer::Color &color)
Specify the color of light.
virtual void SetCommandList(Effekseer::RefPtr< CommandList > commandList)
specify a command list to render. This function is available except DirectX9, DirectX11 and OpenGL.
Definition: EffekseerRendererGL.h:474
virtual ::Effekseer::RibbonRendererRef CreateRibbonRenderer()=0
リボンレンダラーを生成する。
virtual void SetLightAmbientColor(const ::Effekseer::Color &color)
Specify the color of ambient.
Impl * GetImpl()
only for Effekseer backend developer. Effekseer User doesn't need it.
virtual void SetTextureUVStyle(UVStyle style)
Set an UV Style of texture when particles are rendered.
virtual void SetCameraMatrix(const ::Effekseer::Matrix44 &mat)
Set a camera matrix.
virtual void ResetRenderState()=0
レンダーステートを強制的にリセットする。
virtual void SetRenderMode(Effekseer::RenderMode renderMode)
Specify a render mode.
Definition: EffekseerRendererDX9.h:163
virtual void DeleteProxyTexture(Effekseer::Backend::TextureRef &texture)
Delete a proxy texture.
virtual bool BeginRendering()=0
描画を開始する時に実行する。
virtual ::Effekseer::SpriteRendererRef CreateSpriteRenderer()=0
スプライトレンダラーを生成する。
virtual void SetProjectionMatrix(const ::Effekseer::Matrix44 &mat)
Set a projection matrix.
virtual UVStyle GetTextureUVStyle() const
Get an UV Style of texture when particles are rendered.
virtual OpenGLDeviceType GetDeviceType() const =0
get a device type
virtual ::Effekseer::Matrix44 GetProjectionMatrix() const
Get a projection matrix.
virtual void SetBackground(::Effekseer::Backend::TextureRef texture)
Specify a background texture.
virtual bool EndRendering()=0
描画を終了する時に実行する。
virtual void SetSquareMaxCount(int32_t count)=0
最大描画スプライト数を設定する。
virtual void SetLightDirection(const ::Effekseer::Vector3D &direction)
Specifiy the direction of light.
virtual ::Effekseer::RingRendererRef CreateRingRenderer()=0
リングレンダラーを生成する。
virtual void SetDepth(::Effekseer::Backend::TextureRef texture, const DepthReconstructionParameter &reconstructionParam)
Specify a depth texture and parameters to reconstruct from z to depth
Definition: EffekseerRendererGL.h:614
virtual ::Effekseer::TrackRendererRef CreateTrackRenderer()=0
軌跡レンダラーを生成する。
virtual void SetRestorationOfStatesFlag(bool flag)=0
ステートを復帰するかどうかのフラグを設定する。
virtual void OnLostDevice()=0
デバイスロストが発生した時に実行する。
virtual void OnResetDevice()=0
デバイスがリセットされた時に実行する。
virtual const ::Effekseer::Backend::TextureRef & GetBackground()
Get a background texture. Textures are generated by a function specific to each backend or SetBackgro...
virtual const ::Effekseer::Color & GetLightColor() const
Get the color of light.
virtual void NewFrame()
notify that new frame is started.
Definition: EffekseerRendererGL.h:187
virtual ::Effekseer::MaterialLoaderRef CreateMaterialLoader(::Effekseer::FileInterfaceRef fileInterface=nullptr)=0
Create default material loader.
virtual ::Effekseer::Vector3D GetLightDirection() const
Get the direction of light.
virtual ::Effekseer::Backend::TextureRef CreateProxyTexture(ProxyTextureType type)
Create a proxy texture.
virtual bool OnDistorting(Renderer *renderer)
A callback Don't hold renderer in the instance
Definition: EffekseerRendererGL.h:141
virtual void SetBackgroundTextureUVStyle(UVStyle style)
Set an UV Style of background when particles are rendered.
virtual void SetDistortingCallback(DistortingCallback *callback)=0
背景を歪ませるエフェクトが描画される前に呼ばれるコールバックを設定する。
virtual void SetBackground(GLuint background, bool hasMipmap=false)=0
Specify a background.
virtual ::Effekseer::ModelLoaderRef CreateModelLoader(::Effekseer::FileInterfaceRef fileInterface=nullptr)=0
標準のモデル読込クラスを生成する。
virtual ::Effekseer::Vector3D GetCameraPosition() const
Get a position of camera.
virtual Effekseer::Backend::GraphicsDeviceRef GetGraphicsDevice() const
Get the graphics device
virtual bool IsVertexArrayObjectSupported() const =0
get whether VAO is supported
static RendererRef Create(int32_t squareMaxCount, OpenGLDeviceType deviceType=OpenGLDeviceType::OpenGL2, bool isExtensionsEnabled=true)
Create an instance the number of maximum sprites device type of opengl whether does make extensions e...
virtual int32_t GetSquareMaxCount() const =0
最大描画スプライト数を取得する。
virtual ::Effekseer::ModelRendererRef CreateModelRenderer()=0
モデルレンダラーを生成する。
virtual const ::Effekseer::Color & GetLightAmbientColor() const
Get the color of ambient.
Properties in a texture.
Definition: EffekseerRendererGL.h:604
virtual DistortingCallback * GetDistortingCallback()=0
背景を歪ませるエフェクトが描画される前に呼ばれるコールバックを取得する。
virtual int32_t GetSquareMaxCount() const =0
最大描画スプライト数を取得する。
virtual float GetTime() const
Get a current time (s)