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)
深度画像とZから深度を復元するためのパラメーターを取得する。
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
描画モードを取得する。
virtual void ResetDrawVertexCount()
描画された頂点数をリセットする
virtual int32_t GetDrawVertexCount() const
描画された頂点数をリセットする
virtual void SetTime(float time)
現在の時間を設定する。(秒)
Definition: EffekseerRendererDX9.h:151
virtual ::Effekseer::Matrix44 GetCameraMatrix() const
Get a camera matrix
virtual int32_t GetDrawCallCount() const
ドローコールの回数を取得する
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)
リニア空間でもガンマカラーを維持するようにするか、を設定する。
virtual UVStyle GetBackgroundTextureUVStyle() const
パーティクルを描画するときの背景のUVの状態を取得する。
virtual void ResetDrawCallCount()
ドローコールの回数をリセットする
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)
描画に使用するコマンドリストを設定する。この関数はDirectX9、DirectX11、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)
パーティクルを描画するときのUVの状態を設定する。
virtual void SetCameraMatrix(const ::Effekseer::Matrix44 &mat)
Set a camera matrix
virtual void ResetRenderState()=0
レンダーステートを強制的にリセットする。
virtual void SetRenderMode(Effekseer::RenderMode renderMode)
描画モードを設定する。
Definition: EffekseerRendererDX9.h:163
virtual void DeleteProxyTexture(Effekseer::Backend::TextureRef &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
パーティクルを描画するときのUVの状態を取得する。
virtual OpenGLDeviceType GetDeviceType() const =0
デバイスの種類を取得する。
virtual ::Effekseer::Matrix44 GetProjectionMatrix() const
Get a projection matrix
virtual void SetBackground(::Effekseer::Backend::TextureRef 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)
深度画像とZから深度を復元するためのパラメーターを設定する。
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()
背景を取得する。
virtual const ::Effekseer::Color & GetLightColor() const
Get the color of light
virtual void NewFrame()
新規フレームが始ったことを通知する。
Definition: EffekseerRendererGL.h:187
virtual ::Effekseer::MaterialLoaderRef CreateMaterialLoader(::Effekseer::FileInterfaceRef fileInterface=nullptr)=0
標準のマテリアル読込クラスを生成する。
virtual ::Effekseer::Vector3D GetLightDirection() const
Get the direction of light
virtual ::Effekseer::Backend::TextureRef CreateProxyTexture(ProxyTextureType type)
代替のテクスチャを生成する
virtual bool OnDistorting(Renderer *renderer)
コールバック
Definition: EffekseerRendererGL.h:141
virtual void SetBackgroundTextureUVStyle(UVStyle style)
パーティクルを描画するときの背景のUVの状態を設定する。
virtual void SetDistortingCallback(DistortingCallback *callback)=0
背景を歪ませるエフェクトが描画される前に呼ばれるコールバックを設定する。
virtual void SetBackground(GLuint background, bool hasMipmap=false)=0
背景を設定する。
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
グラフィクスデバイスを取得する。
virtual bool IsVertexArrayObjectSupported() const =0
VAOがサポートされているか取得する。
static RendererRef Create(int32_t squareMaxCount, OpenGLDeviceType deviceType=OpenGLDeviceType::OpenGL2, bool isExtensionsEnabled=true)
インスタンスを生成する。
virtual int32_t GetSquareMaxCount() const =0
最大描画スプライト数を取得する。
virtual ::Effekseer::ModelRendererRef CreateModelRenderer()=0
モデルレンダラーを生成する。
virtual const ::Effekseer::Color & GetLightAmbientColor() const
Get the color of ambient
テクスチャ内のプロパティ
Definition: EffekseerRendererGL.h:604
virtual DistortingCallback * GetDistortingCallback()=0
背景を歪ませるエフェクトが描画される前に呼ばれるコールバックを取得する。
virtual int32_t GetSquareMaxCount() const =0
最大描画スプライト数を取得する。
virtual float GetTime() const
現在の時間を取得する。(秒)