Skip to content

Commit

Permalink
feat: rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
aryanbaburajan committed Mar 15, 2024
1 parent 1ee8425 commit b8e5d57
Show file tree
Hide file tree
Showing 3,198 changed files with 23,053 additions and 1,579,668 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
labels: 'bug'
assignees: ''

---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/code_formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Code formatting
about: Change scripts/files to follow good practices.
title: ''
labels: enhancement
labels: 'enhancement'
assignees: ''

---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
labels: 'feature'
assignees: ''

---
Expand Down
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
.vs
.vscode
Build
Docs/*
!Docs/doxygen-awesome*
!Docs/header.html
Resources/Sandbox/Scenes/*
*.hint
Installer/__pycache__/*
Docs/html/
34 changes: 0 additions & 34 deletions Build.bat

This file was deleted.

64 changes: 0 additions & 64 deletions Build.sh

This file was deleted.

30 changes: 2 additions & 28 deletions CMake/FindDucktape.cmake
Original file line number Diff line number Diff line change
@@ -1,29 +1,3 @@
# Ducktape | An open source C++ 2D & 3D game Engine that focuses on being fast, and powerful.
# Copyright (C) 2022 Aryan Baburajan
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# In case of any further questions feel free to contact me at
# the following email address:
# [email protected]

#[=======================================================================[.rst:
Documentation for using find_package() to find the Ducktape library.
#]=======================================================================]

set (Ducktape_FOUND true)

# OpenGL
Expand All @@ -36,11 +10,12 @@ endif ()

set (Ducktape_INCLUDE_DIR
${Ducktape_ROOT_DIR}/Engine;
${Ducktape_ROOT_DIR}/Editor;
${Ducktape_ROOT_DIR}/Runtime;
${Ducktape_ROOT_DIR}/Extern/;
${Ducktape_ROOT_DIR}/Extern/glm/;
${Ducktape_ROOT_DIR}/Extern/glfw/include/;
${Ducktape_ROOT_DIR}/Extern/glad/include/;
${Ducktape_ROOT_DIR}/Extern/entt/single_include;
${Ducktape_ROOT_DIR}/Extern/assimp/include;
${Ducktape_ROOT_DIR}/Build/Extern/assimp/include;
${Ducktape_ROOT_DIR}/Extern/imgui/backends/;
Expand All @@ -49,7 +24,6 @@ set (Ducktape_INCLUDE_DIR
)

set (Ducktape_LIBRARY
Ducktape
glfw
OpenGL::GL
glad
Expand Down
94 changes: 68 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,77 @@
cmake_minimum_required(VERSION 3.8)
# MIT License

project("Ducktape" VERSION 1.0.0)
add_compile_definitions(DUCKTAPE_VERSION_MAJOR=${Ducktape_VERSION_MAJOR} DUCKTAPE_VERSION_MINOR=${Ducktape_VERSION_MINOR} DUCKTAPE_VERSION_PATCH=${Ducktape_VERSION_PATCH})
# Copyright (c) 2021 - 2023 Aryan Baburajan

set(ASSIMP_BUILD_ZLIB ON)
set(BUILD_ASSIMP_TOOLS OFF)
set(ASSIMP_BUILD_TESTS OFF)
set(ASSIMP_WARNINGS_AS_ERRORS OFF)
set(ASSIMP_BUILD_ALL_EXPORTER_BY_DEFAULT OFF)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

set(OpenGL_GL_PREFERENCE LEGACY)
set(GLFW_BUILD_DOCS OFF)
set(GLFW_BUILD_TESTS OFF)
set(GLFW_BUILD_EXAMPLES OFF)
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.

set(BUILD_SHARED_LIBS ON)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/Extern/assimp/cmake-modules;${CMAKE_MODULE_PATH}")
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/Build")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/Build")
cmake_minimum_required (VERSION 3.20)

if(WIN32)
add_subdirectory("${PROJECT_SOURCE_DIR}/Extern/assimp")
add_subdirectory("${PROJECT_SOURCE_DIR}/Extern/glfw")
endif(WIN32)
project ("Ducktape" VERSION 1.0.0)

add_subdirectory("${PROJECT_SOURCE_DIR}/Extern/glad")
add_subdirectory("${PROJECT_SOURCE_DIR}/Extern/imgui")
set (ASSIMP_BUILD_ZLIB ON CACHE BOOL "")
set (BUILD_ASSIMP_TOOLS OFF)
set (ASSIMP_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set (ASSIMP_WARNINGS_AS_ERRORS OFF CACHE BOOL "If the test suite for Assimp is built in addition to the library.")
set (ASSIMP_BUILD_ALL_EXPORTER_BY_DEFAULT OFF)

add_subdirectory("${PROJECT_SOURCE_DIR}/Engine")
set(BUILD_SHARED_LIBS OFF)
set (OpenGL_GL_PREFERENCE LEGACY)
set (GLFW_BUILD_DOCS OFF)
set (GLFW_BUILD_TESTS OFF)
set (GLFW_BUILD_EXAMPLES OFF)

add_subdirectory("${PROJECT_SOURCE_DIR}/Editor")
add_subdirectory("${PROJECT_SOURCE_DIR}/Resources/Sandbox/Assets/Scripts")
option (DT_EXPORT "Build the project for export." OFF)

if (DT_EXPORT)
add_compile_definitions (DT_EXPORT)
else ()
set (BUILD_SHARED_LIBS ON CACHE BOOL "")
endif ()

set (CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/Extern/assimp/cmake-modules;${CMAKE_MODULE_PATH}")

set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/Build")
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/Build")

if (WIN32)
add_subdirectory ("${PROJECT_SOURCE_DIR}/Extern/assimp")
add_subdirectory ("${PROJECT_SOURCE_DIR}/Extern/glfw")
endif (WIN32)

add_subdirectory ("${PROJECT_SOURCE_DIR}/Extern/glad")
add_subdirectory ("${PROJECT_SOURCE_DIR}/Extern/imgui")

# Ducktape Dependencies
set (CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMake/;${CMAKE_MODULE_PATH}")
set (Ducktape_ROOT_DIR "${PROJECT_SOURCE_DIR}")
find_package (Ducktape REQUIRED)

if (Ducktape_FOUND)
message (STATUS "Ducktape found.")
else (Ducktape_FOUND)
message (STATUS "Ducktape not found.")
endif ()

include_directories (${Ducktape_INCLUDE_DIR})
link_directories (${Ducktape_LIBRARY_DIR})
link_libraries (${Ducktape_LIBRARY})

add_subdirectory ("${PROJECT_SOURCE_DIR}/Engine")
add_subdirectory ("${PROJECT_SOURCE_DIR}/Editor")
add_subdirectory ("${PROJECT_SOURCE_DIR}/Runtime")
add_subdirectory ("${PROJECT_SOURCE_DIR}/Sandbox/")
65 changes: 10 additions & 55 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

If you are interested in contributing to this game engine, feel free to fork the repository and make your own changes.

**Note**: Please do not submit pull requests with new features or major changes. Instead, please file an issue first for discussion. If you'd like a feature implemented into the Game Engine, feel free to use [this issue template](https://github.com/DucktapeEngine/Ducktape/issues/new?assignees=&labels=&template=feature_request.md&title=). Or if you encountered a bug, you may use [this issue template](https://github.com/DucktapeEngine/Ducktape/issues/new?assignees=&labels=&template=bug_report.md&title=) instead.
**Note**: Please do not submit pull requests with entirely new features or major changes. Instead, please file an issue first for discussion. If you'd like a feature implemented into the engine, feel free to use [this issue template](https://github.com/DucktapeEngine/Ducktape/issues/new?assignees=&labels=&template=feature_request.md&title=) to discuss it beforehand. Or if you encountered a bug, you may use [this issue template](https://github.com/DucktapeEngine/Ducktape/issues/new?assignees=&labels=&template=bug_report.md&title=) instead.

## Setting up Ducktape for development

Before you proceed further, feel free to join [the Ducktape Discord Server](https://dsc.gg/ducktape) for any help that you may need!
Before you proceed further, feel free to join [the Ducktape Discord Server](https://dsc.gg/ducktape) for any help regarding Ducktape.

### Clone the repository
Fork this repository to your own account.
Expand All @@ -15,7 +15,7 @@ Then, clone the repository using:
git clone https://github.com/<username>/Ducktape.git
```

### Install dependencies
### Install dependencies (For Linux users)
#### Debian

```sh
Expand All @@ -38,64 +38,19 @@ sudo pacman -S libx11 libxrandr libxinerama libxcursor libxi mesa assimp glfw-x1
```

### Compile Ducktape
Execute the build script (`Build.bat` if you're on Windows, `Build.sh` if you're on Linux):
#### Windows
```bat
cd Ducktape
build.bat
cmake -DCMAKE_BUILD_TYPE=Debug -S . -B ./Build
cd Build
cmake --build .
```
#### Linux
```sh
cd Ducktape
chmod +x build.sh
./build.sh
```

Select the generator for CMake
```
Setting up Ducktape for compiling...
Choose your generator:
1) Borland Makefiles
2) MSYS Makefiles
3) MinGW Makefiles (Default for Windows)
4) NMake Makefiles
5) NMake Makefiles JOM
6) Unix Makefiles (Default for Linux)
7) Watcom WMake
Enter your option (1,2,3,4,5,6,7):
```
Enter the path to your C++ compiler (or the compiler command name if it's in your environment PATH variable):

Like, `g++` if you have the GNU compiler installed.
```
Specify your compiler:
(You may enter a path to your compiler or just the compiler's command name if th
e compiler path is already in your PATH environment variable)
```
Select the build type:
```
Choose the build type:
1) Debug
2) Release
Enter your option (1,2):
```
Now the Engine and the Editor should compile.

Note that before you run the Editor, you need to copy the Dll binaries of glfw, glad, assimp, and imgui to the same directory as the Editor exe (./Build/Editor).
These files are usually situated in:
- ./Build/Extern/glfw/src
- ./Build/Extern/glad
- ./Build/Extern/assimp/bin
- ./Build/Extern/imgui

Now run
```
./Editor/Editor.exe
./DucktapeRuntime.exe
```

### Commit naming in Ducktape follows a specific format:
### Ducktape's commit message convention:
```
[tag]: <Commit details>
<tag>: <commit msg>
```
where `[tag]` is:
- **feat** - a new feature is introduced with the changes
Expand All @@ -112,5 +67,5 @@ where `[tag]` is:

For example:
```
feat: Added Linux support
feat: added audio system
```
Loading

0 comments on commit b8e5d57

Please sign in to comment.