Skip to content

Commit

Permalink
Community maintenance (TheCherno#320)
Browse files Browse the repository at this point in the history
See PR for details
  • Loading branch information
LovelySanta authored Aug 22, 2020
1 parent 3177aca commit 0090b94
Show file tree
Hide file tree
Showing 34 changed files with 502 additions and 577 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
indent_style = tab
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Hazel Community Support (Discord)
url: https://thecherno.com/discord
about: Please ask Hazel related questions in the game-engine-series thread.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: 'Issue: Blank template'
name: 'Other issues: Blank template'
about: For issues that are not a bug report or feature request

---
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Binaries
**/bin/
!vendor/bin/premake/
!vendor/premake/bin/
bin-int/

# Hazel files
Expand All @@ -11,4 +11,4 @@ bin-int/
**.sln
**.vcxproj
**.vcxproj.filters
**.vcxproj.user
**.vcxproj.user
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[submodule "Hazel/vendor/spdlog"]
path = Hazel/vendor/spdlog
url = https://github.com/gabime/spdlog
url = ../../gabime/spdlog.git
branch = v1.x
[submodule "Hazel/vendor/GLFW"]
path = Hazel/vendor/GLFW
url = https://github.com/TheCherno/glfw
url = ../../TheCherno/glfw.git
branch = master
[submodule "Hazel/vendor/imgui"]
path = Hazel/vendor/imgui
url = https://github.com/TheCherno/imgui
url = ../../TheCherno/imgui.git
branch = docking
[submodule "Hazel/vendor/glm"]
path = Hazel/vendor/glm
url = https://github.com/g-truc/glm
url = ../../g-truc/glm.git
branch = master
69 changes: 69 additions & 0 deletions Hazel/premake5.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
project "Hazel"
kind "StaticLib"
language "C++"
cppdialect "C++17"
staticruntime "on"

targetdir ("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}")
objdir ("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}")

pchheader "hzpch.h"
pchsource "src/hzpch.cpp"

files
{
"src/**.h",
"src/**.cpp",
"vendor/stb_image/**.h",
"vendor/stb_image/**.cpp",
"vendor/glm/glm/**.hpp",
"vendor/glm/glm/**.inl",
}

defines
{
"_CRT_SECURE_NO_WARNINGS",
"GLFW_INCLUDE_NONE"
}

includedirs
{
"src",
"vendor/spdlog/include",
"%{IncludeDir.GLFW}",
"%{IncludeDir.Glad}",
"%{IncludeDir.ImGui}",
"%{IncludeDir.glm}",
"%{IncludeDir.stb_image}",
"%{IncludeDir.entt}"
}

links
{
"GLFW",
"Glad",
"ImGui",
"opengl32.lib"
}

filter "system:windows"
systemversion "latest"

defines
{
}

filter "configurations:Debug"
defines "HZ_DEBUG"
runtime "Debug"
symbols "on"

filter "configurations:Release"
defines "HZ_RELEASE"
runtime "Release"
optimize "on"

filter "configurations:Dist"
defines "HZ_DIST"
runtime "Release"
optimize "on"
41 changes: 1 addition & 40 deletions Hazel/src/Hazel/Core/Base.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,7 @@

#include <memory>

// Platform detection using predefined macros
#ifdef _WIN32
/* Windows x64/x86 */
#ifdef _WIN64
/* Windows x64 */
#define HZ_PLATFORM_WINDOWS
#else
/* Windows x86 */
#error "x86 Builds are not supported!"
#endif
#elif defined(__APPLE__) || defined(__MACH__)
#include <TargetConditionals.h>
/* TARGET_OS_MAC exists on all the platforms
* so we must check all of them (in this order)
* to ensure that we're running on MAC
* and not some other Apple platform */
#if TARGET_IPHONE_SIMULATOR == 1
#error "IOS simulator is not supported!"
#elif TARGET_OS_IPHONE == 1
#define HZ_PLATFORM_IOS
#error "IOS is not supported!"
#elif TARGET_OS_MAC == 1
#define HZ_PLATFORM_MACOS
#error "MacOS is not supported!"
#else
#error "Unknown Apple platform!"
#endif
/* We also have to check __ANDROID__ before __linux__
* since android is based on the linux kernel
* it has __linux__ defined */
#elif defined(__ANDROID__)
#define HZ_PLATFORM_ANDROID
#error "Android is not supported!"
#elif defined(__linux__)
#define HZ_PLATFORM_LINUX
#error "Linux is not supported!"
#else
/* Unknown compiler/platform */
#error "Unknown platform!"
#endif // End of platform detection
#include "Hazel/Core/PlatformDetection.h"

#ifdef HZ_DEBUG
#if defined(HZ_PLATFORM_WINDOWS)
Expand Down
5 changes: 3 additions & 2 deletions Hazel/src/Hazel/Core/Input.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "Hazel/Core/Base.h"
#include <glm/glm.hpp>

#include "Hazel/Core/KeyCodes.h"
#include "Hazel/Core/MouseCodes.h"

Expand All @@ -12,7 +13,7 @@ namespace Hazel {
static bool IsKeyPressed(KeyCode key);

static bool IsMouseButtonPressed(MouseCode button);
static std::pair<float, float> GetMousePosition();
static glm::vec2 GetMousePosition();
static float GetMouseX();
static float GetMouseY();
};
Expand Down
Loading

0 comments on commit 0090b94

Please sign in to comment.