Removed duplicate constructor problems using the 'using' directive

This commit is contained in:
elipzer 2018-10-13 14:07:08 -04:00
parent cbcf9dad21
commit 6020231c23
16 changed files with 13 additions and 92 deletions

View File

@ -10,11 +10,10 @@ namespace charcoal
{ {
namespace builtin namespace builtin
{ {
class AutoPrerenderingScene : public Scene class AutoPrerenderingScene : public charcoal::Scene
{ {
public: public:
AutoPrerenderingScene(Application& application) : Scene(application) {} using charcoal::Scene::Scene;
virtual ~AutoPrerenderingScene() {}
void prerender() override; void prerender() override;

View File

@ -12,18 +12,7 @@ namespace charcoal
class Batch : public PoseableBatch<Vertex, Index, Renderable> class Batch : public PoseableBatch<Vertex, Index, Renderable>
{ {
public: public:
Batch( using PoseableBatch<Vertex, Index, Renderable>::PoseableBatch;
Renderable* renderable,
int element_count
) : PoseableBatch<Vertex, Index, Renderable>(renderable, element_count)
{}
Batch(
Renderable* renderable,
int element_count,
int element_render_count
) : PoseableBatch<Vertex, Index, Renderable>(renderable, element_count, element_render_count)
{}
protected: protected:
void setup_vao() override; void setup_vao() override;

View File

@ -23,7 +23,6 @@ namespace charcoal
{ {
public: public:
Scene(Application& application) : AutoPrerenderingScene(application) {} Scene(Application& application) : AutoPrerenderingScene(application) {}
virtual ~Scene() {}
void init() override; void init() override;

View File

@ -11,10 +11,7 @@ namespace charcoal
class Batch : public Prerenderable, public charcoal::Batch<VertexType, IndexType, element_buffer_count, RenderableT> class Batch : public Prerenderable, public charcoal::Batch<VertexType, IndexType, element_buffer_count, RenderableT>
{ {
public: public:
Batch( using charcoal::Batch<VertexType, IndexType, element_buffer_count, RenderableT>::Batch;
const RenderableT* renderable,
int element_render_count
) : charcoal::Batch<VertexType, IndexType, element_buffer_count, RenderableT>(renderable, element_render_count) {}
void prerender() override { charcoal::Batch<VertexType, IndexType, element_buffer_count, RenderableT>::prerender(); } void prerender() override { charcoal::Batch<VertexType, IndexType, element_buffer_count, RenderableT>::prerender(); }
}; };

View File

@ -10,10 +10,7 @@ namespace charcoal
class Camera2D : public Prerenderable, public charcoal::Camera2D class Camera2D : public Prerenderable, public charcoal::Camera2D
{ {
public: public:
Camera2D(const vec2& size, const vec2& position = vec2(0.0f, 0.0f)) using charcoal::Camera2D::Camera2D;
: charcoal::Camera2D(size, position) {}
Camera2D(const vec3& size = vec3(2.0f, 2.0f, 2.0f), const vec3& position = vec3(0.0f, 0.0f, 0.0f))
: charcoal::Camera2D(size, position) {}
void prerender() override { charcoal::Camera2D::prerender(); } void prerender() override { charcoal::Camera2D::prerender(); }
}; };

View File

@ -10,16 +10,7 @@ namespace charcoal
class Camera3D : public Prerenderable, public charcoal::Camera3D class Camera3D : public Prerenderable, public charcoal::Camera3D
{ {
public: public:
Camera3D( using charcoal::Camera3D::Camera3D;
float fov_y,
float aspect_ratio,
float znear,
float zfar,
const vec3& position,
const vec3& forward = vec3(0.0f, 0.0f, 1.0f),
const vec3& up = vec3(0.0f, 1.0f, 0.0f),
const vec3& right = vec3(0.0f) // Zero for auto-calculated
) : charcoal::Camera3D(fov_y, aspect_ratio, znear, zfar, position, forward, up, right) {}
void prerender() override { charcoal::Camera3D::prerender(); } void prerender() override { charcoal::Camera3D::prerender(); }
}; };

View File

@ -107,9 +107,6 @@
<ClInclude Include="TexturedTypes.h"> <ClInclude Include="TexturedTypes.h">
<Filter>Header Files\Scenes\Textured</Filter> <Filter>Header Files\Scenes\Textured</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="LitShaderProgram.h">
<Filter>Header Files\Scenes\LitShadowed</Filter>
</ClInclude>
<ClInclude Include="LitShadowedBatch.h"> <ClInclude Include="LitShadowedBatch.h">
<Filter>Header Files\Scenes\LitShadowed</Filter> <Filter>Header Files\Scenes\LitShadowed</Filter>
</ClInclude> </ClInclude>
@ -191,5 +188,8 @@
<ClInclude Include="WithCamera.h"> <ClInclude Include="WithCamera.h">
<Filter>Header Files\General</Filter> <Filter>Header Files\General</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="LitShaderProgram.h">
<Filter>Header Files\Scenes\Lit</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -18,7 +18,6 @@ namespace charcoal
{ {
public: public:
Scene(Application& application) : AutoPrerenderingScene(application) {} Scene(Application& application) : AutoPrerenderingScene(application) {}
virtual ~Scene() {}
void init() override; void init() override;

View File

@ -12,18 +12,7 @@ namespace charcoal
class Batch : public PoseableBatch<Vertex, Index, Renderable> class Batch : public PoseableBatch<Vertex, Index, Renderable>
{ {
public: public:
Batch( using PoseableBatch<Vertex, Index, Renderable>::PoseableBatch;
Renderable* renderable,
int element_count
) : PoseableBatch<Vertex, Index, Renderable>(renderable, element_count)
{}
Batch(
Renderable* renderable,
int element_count,
int element_render_count
) : PoseableBatch<Vertex, Index, Renderable>(renderable, element_count, element_render_count)
{}
protected: protected:
void setup_vao() override; void setup_vao() override;

View File

@ -21,7 +21,6 @@ namespace charcoal
{ {
public: public:
Scene(Application& application) : AutoPrerenderingScene(application) {} Scene(Application& application) : AutoPrerenderingScene(application) {}
virtual ~Scene() {}
void init() override; void init() override;

View File

@ -12,18 +12,7 @@ namespace charcoal
class Batch : public PoseableBatch<Vertex, Index, Renderable> class Batch : public PoseableBatch<Vertex, Index, Renderable>
{ {
public: public:
Batch( using PoseableBatch<Vertex, Index, Renderable>::PoseableBatch;
Renderable* renderable,
int element_count
) : PoseableBatch<Vertex, Index, Renderable>(renderable, element_count)
{}
Batch(
Renderable* renderable,
int element_count,
int element_render_count
) : PoseableBatch<Vertex, Index, Renderable>(renderable, element_count, element_render_count)
{}
protected: protected:
void setup_vao() override; void setup_vao() override;

View File

@ -21,7 +21,6 @@ namespace charcoal
{ {
public: public:
Scene(Application& application) : AutoPrerenderingScene(application) {} Scene(Application& application) : AutoPrerenderingScene(application) {}
virtual ~Scene() {}
void init() override; void init() override;

View File

@ -14,7 +14,6 @@ namespace charcoal
class PoseableBatch : public builtin::Batch<VertexType, IndexType, 1, RenderableT> class PoseableBatch : public builtin::Batch<VertexType, IndexType, 1, RenderableT>
{ {
public: public:
// TODO: Figure out how to get rid of this typename garbage. If that it figured out, m_element_buffers should get fixed.
PoseableBatch( PoseableBatch(
RenderableT* renderable, RenderableT* renderable,
int element_count int element_count

View File

@ -14,21 +14,8 @@ namespace charcoal
{ {
public: public:
// Note: This is VERY similar to builtin::textured::Batch // Note: This is VERY similar to builtin::textured::Batch
// TODO: Use Poseable2D for each sprite's position
// TODO: Have a texture
// Note: Uses GL_TEXTURE0. The uniform for this texture should be set in the scene before rendering. // Note: Uses GL_TEXTURE0. The uniform for this texture should be set in the scene before rendering.
SpriteBatch( using Poseable2DBatch<VertexType, IndexType, TextureRenderable<VertexType, IndexType> >::Poseable2DBatch;
TextureRenderable<VertexType, IndexType>* renderable,
int element_count
) : Poseable2DBatch<VertexType, IndexType, TextureRenderable<VertexType, IndexType> >(renderable, element_count)
{}
SpriteBatch(
TextureRenderable<VertexType, IndexType>* renderable,
int element_count,
int element_render_count
) : Poseable2DBatch<VertexType, IndexType, TextureRenderable<VertexType, IndexType> >(renderable, element_count, element_render_count)
{}
void preprender() const override void preprender() const override
{ {

View File

@ -12,18 +12,7 @@ namespace charcoal
class Batch : public PoseableBatch<Vertex, Index, Renderable> class Batch : public PoseableBatch<Vertex, Index, Renderable>
{ {
public: public:
Batch( using PoseableBatch<Vertex, Index, Renderable>::PoseableBatch;
Renderable* renderable,
int element_count
) : PoseableBatch<Vertex, Index, Renderable>(renderable, element_count)
{}
Batch(
Renderable* renderable,
int element_count,
int element_render_count
) : PoseableBatch<Vertex, Index, Renderable>(renderable, element_count, element_render_count)
{}
void preprender() const override; void preprender() const override;

View File

@ -19,7 +19,6 @@ namespace charcoal
{ {
public: public:
Scene(Application& application) : AutoPrerenderingScene(application) {} Scene(Application& application) : AutoPrerenderingScene(application) {}
virtual ~Scene() {}
void init() override; void init() override;