Compare commits
No commits in common. "8e7907fd202ea2528b2c19f09e2b9173a41dd8af" and "086a2ca39f9a569273ce47b4957494ec2a59c21e" have entirely different histories.
8e7907fd20
...
086a2ca39f
14 changed files with 12 additions and 128 deletions
|
@ -1,10 +1,8 @@
|
||||||
cmake_minimum_required(VERSION 3.30.0)
|
cmake_minimum_required(VERSION 3.31..)
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
project(openblocks VERSION 0.1.0)
|
project(openblocks VERSION 0.1.0)
|
||||||
set(OpenGL_GL_PREFERENCE "GLVND")
|
set(OpenGL_GL_PREFERENCE "GLVND")
|
||||||
|
|
||||||
set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" )
|
|
||||||
|
|
||||||
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
|
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
|
||||||
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
|
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
|
||||||
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
|
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
|
||||||
|
@ -13,7 +11,4 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
add_subdirectory(core)
|
add_subdirectory(core)
|
||||||
add_subdirectory(client)
|
add_subdirectory(client)
|
||||||
add_subdirectory(editor)
|
add_subdirectory(editor)
|
||||||
|
|
||||||
|
|
||||||
install(FILES $<TARGET_RUNTIME_DLLS:editor> TYPE BIN)
|
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"version": 2,
|
|
||||||
"configurePresets": [
|
|
||||||
{
|
|
||||||
"name": "vcpkg",
|
|
||||||
"generator": "Visual Studio 17 2022",
|
|
||||||
"binaryDir": "${sourceDir}/build",
|
|
||||||
"cacheVariables": {
|
|
||||||
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"version": 2,
|
|
||||||
"configurePresets": [
|
|
||||||
{
|
|
||||||
"name": "default",
|
|
||||||
"inherits": "vcpkg",
|
|
||||||
"environment": {
|
|
||||||
"VCPKG_ROOT": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\vcpkg\\vcpkg.exe"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
# Distributed under the OSI-approved BSD 3-Clause License.
|
|
||||||
# Copyright Stefano Sinigardi
|
|
||||||
|
|
||||||
#.rst:
|
|
||||||
# FindStb
|
|
||||||
# ------------
|
|
||||||
#
|
|
||||||
# Find the Stb include headers.
|
|
||||||
#
|
|
||||||
# Result Variables
|
|
||||||
# ^^^^^^^^^^^^^^^^
|
|
||||||
#
|
|
||||||
# This module defines the following variables:
|
|
||||||
#
|
|
||||||
# ``Stb_FOUND``
|
|
||||||
# True if Stb library found
|
|
||||||
#
|
|
||||||
# ``Stb_INCLUDE_DIR``
|
|
||||||
# Location of Stb headers
|
|
||||||
#
|
|
||||||
|
|
||||||
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
|
|
||||||
include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
|
|
||||||
|
|
||||||
if(NOT Stb_INCLUDE_DIR)
|
|
||||||
find_path(Stb_INCLUDE_DIR NAMES stb_image.h PATHS ${Stb_DIR} PATH_SUFFIXES include stb include/stb)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package_handle_standard_args(Stb DEFAULT_MSG Stb_INCLUDE_DIR)
|
|
||||||
mark_as_advanced(Stb_INCLUDE_DIR)
|
|
|
@ -6,13 +6,10 @@ include_directories(${GLEW_INCLUDE_DIRS})
|
||||||
find_package(OpenGL)
|
find_package(OpenGL)
|
||||||
find_package(glm CONFIG REQUIRED)
|
find_package(glm CONFIG REQUIRED)
|
||||||
find_package(ReactPhysics3D REQUIRED)
|
find_package(ReactPhysics3D REQUIRED)
|
||||||
find_package(pugixml 1.15 REQUIRED)
|
find_package(pugixml REQUIRED)
|
||||||
|
|
||||||
find_package(Stb REQUIRED)
|
|
||||||
include_directories(${Stb_INCLUDE_DIR})
|
|
||||||
|
|
||||||
file(GLOB_RECURSE SOURCES "src/*.cpp" "src/*.h")
|
file(GLOB_RECURSE SOURCES "src/*.cpp" "src/*.h")
|
||||||
add_library(openblocks STATIC ${SOURCES})
|
add_library(openblocks ${SOURCES})
|
||||||
set_target_properties(openblocks PROPERTIES OUTPUT_NAME "openblocks")
|
set_target_properties(openblocks PROPERTIES OUTPUT_NAME "openblocks")
|
||||||
target_link_libraries(openblocks ${GLEW_LIBRARIES} OpenGL::GL ReactPhysics3D::ReactPhysics3D pugixml::pugixml)
|
target_link_libraries(openblocks ${GLEW_LIBRARIES} OpenGL::GL ReactPhysics3D::ReactPhysics3D pugixml::pugixml)
|
||||||
target_include_directories(openblocks PUBLIC "src" "../include")
|
target_include_directories(openblocks PUBLIC "src" "../include")
|
|
@ -28,6 +28,7 @@ namespace Data {
|
||||||
std::string name;
|
std::string name;
|
||||||
Deserializer deserializer;
|
Deserializer deserializer;
|
||||||
FromString fromString;
|
FromString fromString;
|
||||||
|
TypeInfo(const TypeInfo&) = delete;
|
||||||
};
|
};
|
||||||
|
|
||||||
class String;
|
class String;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include <GL/glew.h>
|
#include <GL/glew.h>
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#include <stb_image.h>
|
#include <stb/stb_image.h>
|
||||||
|
|
||||||
#include "skybox.h"
|
#include "skybox.h"
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <GL/glew.h>
|
#include <GL/glew.h>
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#include <stb_image.h>
|
#include <stb/stb_image.h>
|
||||||
|
|
||||||
Texture::Texture(const char* texturePath, unsigned int format, bool noMipMaps) {
|
Texture::Texture(const char* texturePath, unsigned int format, bool noMipMaps) {
|
||||||
glGenTextures(1, &this->ID);
|
glGenTextures(1, &this->ID);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <GL/glew.h>
|
#include <GL/glew.h>
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#include <stb_image.h>
|
#include <stb/stb_image.h>
|
||||||
|
|
||||||
Texture3D::Texture3D(const char* texturePath, unsigned int tileWidth, unsigned int tileHeight, unsigned int tileCount, unsigned int format) {
|
Texture3D::Texture3D(const char* texturePath, unsigned int tileWidth, unsigned int tileHeight, unsigned int tileCount, unsigned int format) {
|
||||||
glGenTextures(1, &this->ID);
|
glGenTextures(1, &this->ID);
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#define STB_IMAGE_IMPLEMENTATION
|
#define STB_IMAGE_IMPLEMENTATION
|
||||||
#include <stb_image.h>
|
#include <stb/stb_image.h>
|
|
@ -1,4 +1,4 @@
|
||||||
cmake_minimum_required(VERSION 3.30.0)
|
cmake_minimum_required(VERSION 3.31..)
|
||||||
|
|
||||||
project(editor VERSION 0.1 LANGUAGES CXX)
|
project(editor VERSION 0.1 LANGUAGES CXX)
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ set(CMAKE_AUTOUIC ON)
|
||||||
set(CMAKE_AUTOMOC ON)
|
set(CMAKE_AUTOMOC ON)
|
||||||
set(CMAKE_AUTORCC ON)
|
set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
@ -14,7 +14,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets LinguistTools)
|
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets LinguistTools)
|
||||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets LinguistTools)
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets LinguistTools)
|
||||||
|
|
||||||
|
|
||||||
set(TS_FILES editor_en_US.ts)
|
set(TS_FILES editor_en_US.ts)
|
||||||
|
|
||||||
set(PROJECT_SOURCES
|
set(PROJECT_SOURCES
|
||||||
|
@ -76,32 +75,6 @@ if (${QT_VERSION} GREATER_EQUAL 6)
|
||||||
target_link_libraries(editor PRIVATE Qt6::OpenGL Qt6::OpenGLWidgets)
|
target_link_libraries(editor PRIVATE Qt6::OpenGL Qt6::OpenGLWidgets)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Copy assets
|
|
||||||
add_custom_command(
|
|
||||||
TARGET editor POST_BUILD
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
||||||
${CMAKE_SOURCE_DIR}/assets
|
|
||||||
$<TARGET_FILE_DIR:editor>/assets)
|
|
||||||
|
|
||||||
# Copy Qt files
|
|
||||||
if (WIN32)
|
|
||||||
#include("${QT_DEPLOY_SUPPORT}")
|
|
||||||
|
|
||||||
# TODO: Add other translations
|
|
||||||
add_custom_command(
|
|
||||||
TARGET editor POST_BUILD
|
|
||||||
COMMAND ${WINDEPLOYQT_EXECUTABLE} $<TARGET_FILE:editor> --translations en --no-compiler-runtime --no-opengl-sw --no-system-d3d-compiler --plugindir $<TARGET_FILE_DIR:editor>/qtplugins
|
|
||||||
)
|
|
||||||
# No sense adding opengl-sw given that hardware acceleration is necessary, anyway
|
|
||||||
# Also don't want to clutter with plugins, add only needed ones
|
|
||||||
|
|
||||||
# Copy qt.conf to override default plugins location
|
|
||||||
add_custom_command(
|
|
||||||
TARGET editor POST_BUILD
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/qt.conf $<TARGET_FILE_DIR:editor>/qt.conf
|
|
||||||
)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
|
# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
|
||||||
# If you are developing for iOS or macOS you should consider setting an
|
# If you are developing for iOS or macOS you should consider setting an
|
||||||
# explicit, fixed bundle identifier manually though.
|
# explicit, fixed bundle identifier manually though.
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
[Paths]
|
|
||||||
Plugins = "qtplugins"
|
|
|
@ -1,14 +0,0 @@
|
||||||
{
|
|
||||||
"default-registry": {
|
|
||||||
"kind": "git",
|
|
||||||
"baseline": "0c4cf19224a049cf82f4521e29e39f7bd680440c",
|
|
||||||
"repository": "https://github.com/microsoft/vcpkg"
|
|
||||||
},
|
|
||||||
"registries": [
|
|
||||||
{
|
|
||||||
"kind": "artifact",
|
|
||||||
"location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
|
|
||||||
"name": "microsoft"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
10
vcpkg.json
10
vcpkg.json
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"dependencies": [
|
|
||||||
"glew",
|
|
||||||
"glfw3",
|
|
||||||
"glm",
|
|
||||||
{ "name": "pugixml", "version>=": "1.15" },
|
|
||||||
"sdl2",
|
|
||||||
"stb"
|
|
||||||
]
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue