Skip to content

Commit

Permalink
removed assimp
Browse files Browse the repository at this point in the history
refactor cmake
restore tests
  • Loading branch information
hotstreams committed Dec 5, 2023
1 parent 5c15fc1 commit 775567e
Show file tree
Hide file tree
Showing 97 changed files with 1,401 additions and 10,895 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: build
run: |
mkdir build
cmake -DGLSLANG_SHADER_OUTPUT=ON -S . -B build
cmake -DBUILD_SAMPLES=OFF -DBUILD_TESTS=ON -DOPENGL_SHADER_OUTPUT=ON -S . -B build
cd build
make
- name: test
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "thirdparty/assimp"]
path = thirdparty/assimp
url = https://github.com/assimp/assimp
[submodule "thirdparty/stbimage"]
path = thirdparty/stbimage
url = https://github.com/nothings/stb
Expand Down
327 changes: 92 additions & 235 deletions CMakeLists.txt

Large diffs are not rendered by default.

503 changes: 251 additions & 252 deletions demo/assets.cpp

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions demo/demo.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#include "assets.hpp"
#include "scene.hpp"
//#include "scene.hpp"

#include <limitless/core/context_observer.hpp>
#include <limitless/text/text_instance.hpp>
#include <limitless/util/color_picker.hpp>
#include <iostream>
#include <limitless/core/state_query.hpp>
#include <limitless/core/texture/state_texture.hpp>

Expand All @@ -19,7 +18,7 @@ class Game : public MouseMoveObserver, public KeyObserver, public FramebufferObs
Camera camera;
Renderer render;
DemoAssets assets;
LimitlessDemo::DemoScene scene;
// LimitlessDemo::DemoScene scene;

bool done {};
bool hidden_text {};
Expand All @@ -29,7 +28,7 @@ class Game : public MouseMoveObserver, public KeyObserver, public FramebufferObs
, camera {window_size}
, render {context}
, assets {context, render, ENGINE_ASSETS_DIR}
, scene {context, assets}
// , scene {context, assets}
{
camera.setPosition({-3.0f, 2.0f, 3.0f});

Expand Down Expand Up @@ -69,7 +68,7 @@ class Game : public MouseMoveObserver, public KeyObserver, public FramebufferObs
}

if (key == GLFW_KEY_TAB && state == InputState::Pressed) {
scene.next(camera);
// scene.next(camera);
}

if (key == GLFW_KEY_SPACE && state == InputState::Pressed) {
Expand Down Expand Up @@ -117,8 +116,8 @@ class Game : public MouseMoveObserver, public KeyObserver, public FramebufferObs
auto delta_time = duration_cast<duration<float>>(current_time - last_time).count();
last_time = current_time;

scene.update(context, camera);
render.draw(context, assets, scene.getCurrentScene(), camera);
// scene.update(context, camera);
// render.draw(context, assets, scene.getCurrentScene(), camera);

context.swapBuffers();
context.pollEvents();
Expand Down
1 change: 0 additions & 1 deletion demo/effects_demoscene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <limitless/fx/emitters/beam_emitter.hpp>
#include <limitless/fx/emitters/sprite_emitter.hpp>
#include <limitless/fx/emitters/mesh_emitter.hpp>
#include <limitless/loaders/model_loader.hpp>
#include <limitless/instances/model_instance.hpp>
#include <limitless/models/skeletal_model.hpp>
#include <limitless/fx/modules/mesh_location_attachment.hpp>
Expand Down
2 changes: 1 addition & 1 deletion include/limitless/core/context_debug.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <GLFW/glfw3.h>

namespace Limitless {
#ifdef GL_DEBUG
#ifdef LIMITLESS_OPENGL_DEBUG
inline uint64_t gl_error_count = 0;

void APIENTRY glDebugOutput(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam);
Expand Down
1 change: 0 additions & 1 deletion include/limitless/loaders/asset_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <limitless/core/context_thread_pool.hpp>
#include <limitless/models/abstract_model.hpp>
#include <limitless/util/filesystem.hpp>
#include <limitless/loaders/model_loader.hpp>
#include <limitless/loaders/texture_loader.hpp>

namespace Limitless {
Expand Down
83 changes: 0 additions & 83 deletions include/limitless/loaders/model_loader.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion include/limitless/ms/material.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ namespace Limitless::ms {
* Mutable property getters for primitives
*/
glm::vec4& getColor();
glm::vec4& getEmissiveColor();
glm::vec3& getEmissiveColor();
float& getMetallic();
float& getRoughness();
float& getIoR();
Expand Down
2 changes: 1 addition & 1 deletion include/limitless/ms/material_builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Limitless::ms {
class Material::Builder {
private:
static inline std::map<UniqueMaterial, uint64_t> unique_materials;
static inline uint64_t next_shader_index {};
static inline uint64_t next_shader_index {1};
static inline std::mutex mutex;

std::map<Property, std::unique_ptr<Uniform>> properties;
Expand Down
24 changes: 24 additions & 0 deletions samples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#########################################
cmake_minimum_required(VERSION 3.10)

#########################################
project(limitless-engine-samples)

if (NOT BUILD_SAMPLES)
return()
endif()

add_executable(limitless-demo
demo/demo.cpp
# demo/materials_demoscene.cpp
# demo/lighting_demoscene.cpp
# demo/effects_demoscene.cpp
# demo/models_demoscene.cpp
demo/assets.cpp
)
target_link_libraries(limitless-demo PRIVATE limitless-engine)

add_executable(limitless-gltf-viewer
demo/gltf_viewer/gltf_viewer.cpp
)
target_link_libraries(limitless-gltf-viewer PRIVATE limitless-engine)
File renamed without changes.
2 changes: 1 addition & 1 deletion shaders/postprocessing/dof.frag
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Limitless::GLSL_VERSION
ENGINE::COMMON
Limitless::Extensions

#include "../pipeline/scene.glsl"
Expand Down
2 changes: 1 addition & 1 deletion shaders/postprocessing/dof.vert
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Limitless::GLSL_VERSION
ENGINE::COMMON
Limitless::Extensions

layout(location = 0) in vec3 position;
Expand Down
2 changes: 1 addition & 1 deletion shaders/postprocessing/fxaa.frag
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Limitless::GLSL_VERSION
ENGINE::COMMON
Limitless::Extensions

in vec2 uv;
Expand Down
2 changes: 1 addition & 1 deletion shaders/postprocessing/fxaa.vert
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Limitless::GLSL_VERSION
ENGINE::COMMON
Limitless::Extensions

layout(location = 0) in vec3 vertex_position;
Expand Down
2 changes: 1 addition & 1 deletion shaders/postprocessing/postprocess.frag
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Limitless::GLSL_VERSION
ENGINE::COMMON
Limitless::Extensions

in vec2 fs_uv;
Expand Down
2 changes: 1 addition & 1 deletion shaders/postprocessing/postprocess.vert
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Limitless::GLSL_VERSION
ENGINE::COMMON
Limitless::Extensions

layout(location = 0) in vec3 position;
Expand Down
2 changes: 1 addition & 1 deletion src/limitless/core/context_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

using namespace Limitless;

#ifdef GL_DEBUG
#ifdef LIMITLESS_OPENGL_DEBUG

void Limitless::activate_debug() {
GLint flags;
Expand Down
2 changes: 1 addition & 1 deletion src/limitless/core/context_initializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void ContextInitializer::getExtensions() noexcept {
extensions.emplace_back(name);
}

#ifdef OPENGL_TOSTER
#ifdef LIMITLESS_OPENGL_NO_EXTENSIONS
std::cerr << "OpenGL toster mode" << std::endl;
extensions.clear();
extensions.emplace_back("GL_ARB_shader_storage_buffer_object");
Expand Down
2 changes: 1 addition & 1 deletion src/limitless/core/shader/shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void Shader::checkStatus() const {

if (log_size == 0) {

#ifdef GLSLANG_SHADER_OUTPUT
#ifdef LIMITLESS_OPENGL_SHADER_OUTPUT
static int i = 0;

for (const auto& [ext, t]: shader_file_extensions) {
Expand Down
1 change: 0 additions & 1 deletion src/limitless/loaders/effect_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <limitless/serialization/effect_serializer.hpp>

#include <limitless/assets.hpp>
#include <limitless/loaders/asset_manager.hpp>
#include <limitless/util/bytebuffer.hpp>
#include <limitless/instances/effect_instance.hpp>

Expand Down
1 change: 0 additions & 1 deletion src/limitless/loaders/material_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <limitless/util/bytebuffer.hpp>
#include <limitless/ms/material.hpp>
#include <limitless/serialization/material_serializer.hpp>
#include <limitless/loaders/asset_manager.hpp>

using namespace Limitless;
using namespace Limitless::ms;
Expand Down
Loading

0 comments on commit 775567e

Please sign in to comment.