First attempt to play audio

This commit is contained in:
2023-01-17 00:11:22 -08:00
parent f2a0d3b3bb
commit 2950bc9184
44 changed files with 698 additions and 82 deletions

View File

@ -0,0 +1,7 @@
# Copyright (c) 2023 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# Subdirs
add_subdirectory(components)

View File

@ -0,0 +1,7 @@
# Copyright (c) 2023 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# Subdirs
add_subdirectory(display)

View File

@ -0,0 +1,7 @@
# Copyright (c) 2023 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# Subdirs
add_subdirectory(shader)

View File

@ -0,0 +1,10 @@
# Copyright (c) 2023 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# Sources
target_sources(${DAWN_TARGET_NAME}
PRIVATE
SimpleTexturedShaderInterface.cpp
)

View File

@ -0,0 +1,22 @@
// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#include "SimpleTexturedShaderInterface.hpp"
using namespace Dawn;
SimpleTexturedShaderInterface::SimpleTexturedShaderInterface(SceneItem *i) :
ShaderInterface<SimpleTexturedShader>(i)
{
}
void SimpleTexturedShaderInterface::setTexture(Texture *texture) {
this->getMaterial()->textureValues[this->getShader()->paramTexture] = texture;
}
void SimpleTexturedShaderInterface::setColor(struct Color color) {
this->getMaterial()->colorValues[this->getShader()->paramColor] = color;
}

View File

@ -0,0 +1,36 @@
// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "scene/components/display/ShaderInterface.hpp"
#include "display/shader/SimpleTexturedShader.hpp"
namespace Dawn {
class SimpleTexturedShaderInterface :
public ShaderInterface<SimpleTexturedShader>
{
public:
/**
* SimpleTexturedShader scene item component interface.
*
* @param i Scene Item this interface belongs to.
*/
SimpleTexturedShaderInterface(SceneItem *i);
/**
* Sets the primary colour texture to be used by the shader.
*
* @param texture Texture to use.
*/
void setTexture(Texture *texture);
/**
* Sets the multiplicitive color to be used by the shader.
*
* @param color Color to be used.
*/
void setColor(struct Color color);
};
}