Compare commits

..

No commits in common. "adf184159213ca64fccc711e830b1c3ae3066984" and "b9a007dd517072c3aa57bb24348f5630db8beccb" have entirely different histories.

11 changed files with 7 additions and 51 deletions

View File

@ -9,10 +9,6 @@ pkg_check_modules(EPOXY REQUIRED epoxy)
pkg_check_modules(SDL2 REQUIRED sdl2)
pkg_check_modules(ASSIMP REQUIRED assimp)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
#find_package(OpenCL REQUIRED)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_SOURCE_DIR}/imgui-submodule/imgui/examples" "${CMAKE_CURRENT_SOURCE_DIR}/imgui-submodule/imgui" ${EPOXY_INCLUDE_DIRS} ${ASSIMP_INCLUDE_DIRS} ${SDL2_INCLUDE_DIRS})
@ -49,10 +45,3 @@ add_compile_options(-Wall)
add_executable(${PROJECT_NAME} ${SOURCES} ${IMGUI_SOURCES})
target_link_libraries(${PROJECT_NAME} m pthread ${EPOXY_LIBRARIES} ${SDL2_LIBRARIES} ${ASSIMP_LIBRARIES} glm)
install (TARGETS ${PROJECT_NAME} DESTINATION bin)
target_precompile_headers(${PROJECT_NAME}
PUBLIC
"$<$<COMPILE_LANGUAGE:CXX>:stb/stb_image.h>"
"$<$<COMPILE_LANGUAGE:CXX>:glm/glm.hpp>"
PRIVATE
)

View File

@ -1,7 +1,7 @@
#ifndef GLOBALCANVASSETTINGS_H
#define GLOBALCANVASSETTINGS_H
//#include <glm/glm.hpp>
#include <glm/glm.hpp>
class GlobalCanvasSettings
{

View File

@ -4,8 +4,8 @@
#include <opengl-playground/opengltexture.hpp>
#include <memory>
#include <vector>
//#include <glm/glm.hpp>
#include <iostream>
#include <glm/glm.hpp>
class Material
{
@ -42,8 +42,6 @@ class Material
glm::vec3 diff_color;
glm::vec3 ambient_color;
glm::vec3 specular_color;
friend std::ostream &operator<<(std::ostream &os, Material const &material);
};
#endif // MATERIAL_H

View File

@ -4,7 +4,7 @@
#include <string>
#include <epoxy/gl.h>
#include <opengl-playground/openglshader.hpp>
//#include <glm/glm.hpp>
#include <glm/glm.hpp>
#include <memory>
class OpenGlGraphics

View File

@ -3,7 +3,7 @@
#include <string>
#include <epoxy/gl.h>
//#include <glm/glm.hpp>
#include <glm/glm.hpp>
class OpenGlShaderProgram
{

2
models/.gitignore vendored
View File

@ -1,2 +0,0 @@
*.blend1
*.blend*

Binary file not shown.

View File

@ -1,18 +1,6 @@
#include <opengl-playground/material.hpp>
std::ostream &operator<<(std::ostream &os, glm::vec3 const &vec3)
{
return os << "(" << vec3.r << "|" << vec3.g << "|" << vec3.b << ")";
}
std::ostream &operator<<(std::ostream &os, Material const &material)
{
return os << "Diffuse Color: " << material.diff_color << ", "
<< "Ambient Color: " << material.ambient_color << ", "
<< "Specular Color: " << material.specular_color << ", "
<< "Texture counts (diff, amb, spec): " << material.diffuse_textures.size()
<< ", " << material.ambient_textures.size() << ", " << material.specular_textures.size();
}
Material::Material()
{

View File

@ -135,7 +135,6 @@ Mesh Model::processMesh(aiMesh *mesh, const aiScene *scene)
material->Get(AI_MATKEY_SHININESS, mesh_material.shininess);
material->Get(AI_MATKEY_SHININESS_STRENGTH, mesh_material.shininess_strength);
std::cout << "Material: " << mesh_material << std::endl;
}

View File

@ -3,7 +3,6 @@
#define STB_IMAGE_IMPLEMENTATION
#include <stb/stb_image.h>
#include <iostream>
#include <filesystem>
OpenGlTexture::OpenGlTexture(const std::string &texture_path)
{
@ -37,14 +36,8 @@ void OpenGlTexture::setRGBDataFromBytes(unsigned int width, unsigned int height,
void OpenGlTexture::loadFromImagePath(const std::string &base_directory)
{
int width, height, nrChannels;
std::filesystem::path base_path(base_directory);
std::filesystem::path tex_path(this->texture_path);
std::string filename;
if (tex_path.is_relative())
filename = base_path / tex_path;
else
filename = tex_path;
std::string filename = this->texture_path;
filename = base_directory + '/' + filename;
unsigned char *data = stbi_load(filename.c_str(), &width, &height, &nrChannels, 0);
if (data) {

View File

@ -1,10 +1 @@
#include <opengl-playground/vertex.hpp>
Vertex operator+(Vertex const &a, Vertex const &b)
{
Vertex out = a;
out.Position + b.Position;
return out;
}