First attempt to play audio
This commit is contained in:
@ -23,4 +23,5 @@ target_include_directories(${DAWN_TARGET_NAME}
|
||||
)
|
||||
|
||||
# Subdirs
|
||||
add_subdirectory(display)
|
||||
add_subdirectory(display)
|
||||
add_subdirectory(scene)
|
@ -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(
|
||||
|
7
src/dawnopengl/scene/CMakeLists.txt
Normal file
7
src/dawnopengl/scene/CMakeLists.txt
Normal 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)
|
7
src/dawnopengl/scene/components/CMakeLists.txt
Normal file
7
src/dawnopengl/scene/components/CMakeLists.txt
Normal 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)
|
7
src/dawnopengl/scene/components/display/CMakeLists.txt
Normal file
7
src/dawnopengl/scene/components/display/CMakeLists.txt
Normal 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)
|
@ -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
|
||||
)
|
@ -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;
|
||||
}
|
@ -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);
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user