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
{
class AutoPrerenderingScene : public Scene
class AutoPrerenderingScene : public charcoal::Scene
{
public:
AutoPrerenderingScene(Application& application) : Scene(application) {}
virtual ~AutoPrerenderingScene() {}
using charcoal::Scene::Scene;
void prerender() override;

View File

@ -12,18 +12,7 @@ namespace charcoal
class Batch : public PoseableBatch<Vertex, Index, Renderable>
{
public:
Batch(
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)
{}
using PoseableBatch<Vertex, Index, Renderable>::PoseableBatch;
protected:
void setup_vao() override;

View File

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

View File

@ -11,10 +11,7 @@ namespace charcoal
class Batch : public Prerenderable, public charcoal::Batch<VertexType, IndexType, element_buffer_count, RenderableT>
{
public:
Batch(
const RenderableT* renderable,
int element_render_count
) : charcoal::Batch<VertexType, IndexType, element_buffer_count, RenderableT>(renderable, element_render_count) {}
using charcoal::Batch<VertexType, IndexType, element_buffer_count, RenderableT>::Batch;
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
{
public:
Camera2D(const vec2& size, const vec2& position = vec2(0.0f, 0.0f))
: 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) {}
using charcoal::Camera2D::Camera2D;
void prerender() override { charcoal::Camera2D::prerender(); }
};

View File

@ -10,16 +10,7 @@ namespace charcoal
class Camera3D : public Prerenderable, public charcoal::Camera3D
{
public:
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) {}
using charcoal::Camera3D::Camera3D;
void prerender() override { charcoal::Camera3D::prerender(); }
};

View File

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

View File

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

View File

@ -12,18 +12,7 @@ namespace charcoal
class Batch : public PoseableBatch<Vertex, Index, Renderable>
{
public:
Batch(
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)
{}
using PoseableBatch<Vertex, Index, Renderable>::PoseableBatch;
protected:
void setup_vao() override;

View File

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

View File

@ -12,18 +12,7 @@ namespace charcoal
class Batch : public PoseableBatch<Vertex, Index, Renderable>
{
public:
Batch(
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)
{}
using PoseableBatch<Vertex, Index, Renderable>::PoseableBatch;
protected:
void setup_vao() override;

View File

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

View File

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

View File

@ -14,21 +14,8 @@ namespace charcoal
{
public:
// 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.
SpriteBatch(
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)
{}
using Poseable2DBatch<VertexType, IndexType, TextureRenderable<VertexType, IndexType> >::Poseable2DBatch;
void preprender() const override
{

View File

@ -12,18 +12,7 @@ namespace charcoal
class Batch : public PoseableBatch<Vertex, Index, Renderable>
{
public:
Batch(
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)
{}
using PoseableBatch<Vertex, Index, Renderable>::PoseableBatch;
void preprender() const override;

View File

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