Skip to content

Commit

Permalink
Update a header and add an error
Browse files Browse the repository at this point in the history
  • Loading branch information
durswd committed Mar 15, 2020
1 parent f3e19cc commit 159f687
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dev/Cpp/CreateHeader.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def output(self,path):

effekseerRendererGLHeader = CreateHeader()
effekseerRendererGLHeader.readLines('EffekseerRendererGL/EffekseerRenderer/EffekseerRendererGL.Base.Pre.h')
effekseerRendererGLHeader.readLines('EffekseerRendererGL/EffekseerRenderer/EffekseerRendererGL.DeviceObjectCollection.h')
effekseerRendererGLHeader.readLines('EffekseerRendererCommon/EffekseerRenderer.Renderer.h')
effekseerRendererGLHeader.readLines('EffekseerRendererGL/EffekseerRenderer/EffekseerRendererGL.Renderer.h')
effekseerRendererGLHeader.output('EffekseerRendererGL/EffekseerRendererGL.h')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,10 @@ ::Effekseer::MaterialData* MaterialLoader::Load(const void* data, int32_t size,
else
{
Effekseer::Material material;
material.Load((const uint8_t*)data, size);
if (!material.Load((const uint8_t*)data, size))
{
std::cout << "Error : Invalid material is loaded." << std::endl;
}
auto compiler = ::Effekseer::CreateUniqueReference(new Effekseer::MaterialCompilerGL());
auto binary = ::Effekseer::CreateUniqueReference(compiler->Compile(&material));

Expand Down
51 changes: 51 additions & 0 deletions Dev/Cpp/EffekseerRendererGL/EffekseerRendererGL.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,57 @@ enum class OpenGLDeviceType

#endif // __EFFEKSEERRENDERER_GL_BASE_PRE_H__

#ifndef __EFFEKSEERRENDERER_GL_DEVICEOBJECT_COLLECTION_H__
#define __EFFEKSEERRENDERER_GL_DEVICEOBJECT_COLLECTION_H__

#include <set>
#include <Effekseer.h>

namespace EffekseerRendererGL
{

class DeviceObject;

class DeviceObjectCollection : public ::Effekseer::ReferenceObject
{
friend class DeviceObject;

private:
std::set<DeviceObject*> deviceObjects_;

/**
@brief register an object
*/
void Register(DeviceObject* device);

/**
@brief unregister an object
*/
void Unregister(DeviceObject* device);

public:
DeviceObjectCollection() = default;

~DeviceObjectCollection() = default;

/**
@brief
\~english Call when device lost causes
\~japanese デバイスロストが発生した時に実行する。
*/
void OnLostDevice();

/**
@brief
\~english Call when device reset causes
\~japanese デバイスがリセットされた時に実行する。
*/
void OnResetDevice();
};

} // namespace EffekseerRendererGL

#endif // __EFFEKSEERRENDERER_GL_DEVICEOBJECT_H__
#ifndef __EFFEKSEERRENDERER_RENDERER_H__
#define __EFFEKSEERRENDERER_RENDERER_H__

Expand Down

0 comments on commit 159f687

Please sign in to comment.