More cleanup complete
This commit is contained in:
@ -1,17 +0,0 @@
|
||||
# Copyright (c) 2023 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
# Includes
|
||||
target_include_directories(${DAWN_TARGET_NAME}
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
)
|
||||
|
||||
# Subdirs
|
||||
add_subdirectory(game)
|
||||
add_subdirectory(scene)
|
||||
|
||||
# Assets
|
||||
# include("${DAWN_ASSETS_SOURCE_DIR}/games/helloworld/CMakeLists.txt")
|
@ -1,9 +0,0 @@
|
||||
# Copyright (c) 2023 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
target_sources(${DAWN_TARGET_NAME}
|
||||
PRIVATE
|
||||
GameInit.cpp
|
||||
)
|
@ -1,13 +0,0 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "game/GameInit.hpp"
|
||||
#include "scene/SceneList.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
std::function<void(Scene&)> GameInit::getInitialScene() {
|
||||
return helloWorldScene;
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
# Copyright (c) 2023 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
target_sources(${DAWN_TARGET_NAME}
|
||||
PRIVATE
|
||||
HelloWorldScene.cpp
|
||||
)
|
@ -1,46 +0,0 @@
|
||||
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "scene/SceneList.hpp"
|
||||
#include "component/display/Camera.hpp"
|
||||
#include "prefab/SimpleSpinningCube.hpp"
|
||||
#include "component/display/material/SimpleTexturedMaterial.hpp"
|
||||
#include "display/mesh/QuadMesh.hpp"
|
||||
#include "component/ui/UICanvas.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
void Dawn::helloWorldScene(Scene &s) {
|
||||
// while(!s.getGame()->assetManager.isLoaded(font)) {
|
||||
// s.getGame()->assetManager.update();
|
||||
// }
|
||||
|
||||
auto cameraItem = s.createSceneItem();
|
||||
auto camera = cameraItem->addComponent<Camera>();
|
||||
cameraItem->lookAt({ 3, 3, 3 }, { 0, 0, 0 }, { 0, 1, 0 });
|
||||
camera->clipFar = 99999.99f;
|
||||
|
||||
glm::vec2 position = { 0, 0 };
|
||||
glm::vec2 size = { 1, 1 };
|
||||
auto quad = s.createSceneItem();
|
||||
auto quadMesh = std::make_shared<Mesh>();
|
||||
quadMesh->createBuffers(QUAD_VERTICE_COUNT, QUAD_INDICE_COUNT);
|
||||
QuadMesh::buffer(
|
||||
quadMesh,
|
||||
glm::vec4(position.x, position.y, size.x, size.y),
|
||||
glm::vec4(0, 0, 1, 1),
|
||||
0, 0, 0
|
||||
);
|
||||
|
||||
auto quadRenderer = quad->addComponent<MeshRenderer>();
|
||||
quadRenderer->mesh = quadMesh;
|
||||
|
||||
auto quadMaterial = quad->addComponent<SimpleTexturedMaterial>();
|
||||
quadMaterial->setColor(COLOR_WHITE);
|
||||
|
||||
auto uiCanvasItem = s.createSceneItem();
|
||||
auto uiCanvas = uiCanvasItem->addComponent<UICanvas>();
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "scene/Scene.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
void helloWorldScene(Scene &s);
|
||||
}
|
Reference in New Issue
Block a user