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

@ -23,4 +23,5 @@ target_include_directories(${DAWN_TARGET_NAME}
)
# Subdirs
add_subdirectory(display)
add_subdirectory(display)
add_subdirectory(scene)

View File

@ -36,8 +36,10 @@ void Texture::setSize(int32_t width, int32_t height) {
// Setup our preferred texture params, later this will be configurable.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// Initialize the texture to blank
glTexImage2D(

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);
};
}