diff --git a/Hazel-ScriptCore/Source/Hazel/InternalCalls.cs b/Hazel-ScriptCore/Source/Hazel/InternalCalls.cs index f98772cd3..50e1248e9 100644 --- a/Hazel-ScriptCore/Source/Hazel/InternalCalls.cs +++ b/Hazel-ScriptCore/Source/Hazel/InternalCalls.cs @@ -14,9 +14,18 @@ public static class InternalCalls [MethodImplAttribute(MethodImplOptions.InternalCall)] internal extern static void TransformComponent_GetTranslation(ulong entityID, out Vector3 translation); + [MethodImplAttribute(MethodImplOptions.InternalCall)] + internal extern static void TransformComponent_GetRotation(ulong entityID, out Vector3 rotation); + [MethodImplAttribute(MethodImplOptions.InternalCall)] + internal extern static void TransformComponent_GetScale(ulong entityID, out Vector3 scale); + [MethodImplAttribute(MethodImplOptions.InternalCall)] internal extern static void TransformComponent_SetTranslation(ulong entityID, ref Vector3 translation); + [MethodImplAttribute(MethodImplOptions.InternalCall)] + internal extern static void TransformComponent_SetRotation(ulong entityID, ref Vector3 rotation); + [MethodImplAttribute(MethodImplOptions.InternalCall)] + internal extern static void TransformComponent_SetScale(ulong entityID, ref Vector3 scale); [MethodImplAttribute(MethodImplOptions.InternalCall)] internal extern static void Rigidbody2DComponent_ApplyLinearImpulse(ulong entityID, ref Vector2 impulse, ref Vector2 point, bool wake); diff --git a/Hazel-ScriptCore/Source/Hazel/Scene/Components.cs b/Hazel-ScriptCore/Source/Hazel/Scene/Components.cs index 582bd9992..49f015823 100644 --- a/Hazel-ScriptCore/Source/Hazel/Scene/Components.cs +++ b/Hazel-ScriptCore/Source/Hazel/Scene/Components.cs @@ -25,6 +25,30 @@ public Vector3 Translation InternalCalls.TransformComponent_SetTranslation(Entity.ID, ref value); } } + public Vector3 Rotation + { + get + { + InternalCalls.TransformComponent_GetRotation(Entity.ID, out Vector3 rotation); + return rotation; + } + set + { + InternalCalls.TransformComponent_SetRotation(Entity.ID, ref value); + } + } + public Vector3 Scale + { + get + { + InternalCalls.TransformComponent_GetScale(Entity.ID, out Vector3 scale); + return scale; + } + set + { + InternalCalls.TransformComponent_SetScale(Entity.ID, ref value); + } + } } public class Rigidbody2DComponent : Component diff --git a/Hazel/src/Hazel/Core/Application.cpp b/Hazel/src/Hazel/Core/Application.cpp index 8da18234b..19444a106 100644 --- a/Hazel/src/Hazel/Core/Application.cpp +++ b/Hazel/src/Hazel/Core/Application.cpp @@ -25,7 +25,7 @@ namespace Hazel { if (!m_Specification.WorkingDirectory.empty()) std::filesystem::current_path(m_Specification.WorkingDirectory); - m_Window = Window::Create(WindowProps(m_Specification.Name)); + m_Window = Window::Create(WindowProps(m_Specification.Name),true); m_Window->SetEventCallback(HZ_BIND_EVENT_FN(Application::OnEvent)); Renderer::Init(); diff --git a/Hazel/src/Hazel/Core/Window.cpp b/Hazel/src/Hazel/Core/Window.cpp index 6ea8d6fb7..2c5f93790 100644 --- a/Hazel/src/Hazel/Core/Window.cpp +++ b/Hazel/src/Hazel/Core/Window.cpp @@ -7,14 +7,14 @@ namespace Hazel { - Scope Window::Create(const WindowProps& props) + Scope Window::Create(const WindowProps& props, bool maximized) { #ifdef HZ_PLATFORM_WINDOWS - return CreateScope(props); + return CreateScope(props,maximized); #else HZ_CORE_ASSERT(false, "Unknown platform!"); return nullptr; #endif } -} \ No newline at end of file +} diff --git a/Hazel/src/Hazel/Core/Window.h b/Hazel/src/Hazel/Core/Window.h index c31e1c52b..12628c37f 100644 --- a/Hazel/src/Hazel/Core/Window.h +++ b/Hazel/src/Hazel/Core/Window.h @@ -38,10 +38,9 @@ namespace Hazel { virtual void SetEventCallback(const EventCallbackFn& callback) = 0; virtual void SetVSync(bool enabled) = 0; virtual bool IsVSync() const = 0; - virtual void* GetNativeWindow() const = 0; - static Scope Create(const WindowProps& props = WindowProps()); + static Scope Create(const WindowProps& props = WindowProps(),bool maximized = false); }; } diff --git a/Hazel/src/Hazel/Scripting/ScriptGlue.cpp b/Hazel/src/Hazel/Scripting/ScriptGlue.cpp index 743e85481..ff460b783 100644 --- a/Hazel/src/Hazel/Scripting/ScriptGlue.cpp +++ b/Hazel/src/Hazel/Scripting/ScriptGlue.cpp @@ -22,25 +22,6 @@ namespace Hazel { #define HZ_ADD_INTERNAL_CALL(Name) mono_add_internal_call("Hazel.InternalCalls::" #Name, Name) - static void NativeLog(MonoString* string, int parameter) - { - char* cStr = mono_string_to_utf8(string); - std::string str(cStr); - mono_free(cStr); - std::cout << str << ", " << parameter << std::endl; - } - - static void NativeLog_Vector(glm::vec3* parameter, glm::vec3* outResult) - { - HZ_CORE_WARN("Value: {0}", *parameter); - *outResult = glm::normalize(*parameter); - } - - static float NativeLog_VectorDot(glm::vec3* parameter) - { - HZ_CORE_WARN("Value: {0}", *parameter); - return glm::dot(*parameter, *parameter); - } static MonoObject* GetScriptInstance(UUID entityID) { @@ -83,6 +64,25 @@ namespace Hazel { *outTranslation = entity.GetComponent().Translation; } + static void TransformComponent_GetRotation(UUID entityID, glm::vec3* outRotation) + { + Scene* scene = ScriptEngine::GetSceneContext(); + HZ_CORE_ASSERT(scene); + Entity entity = scene->GetEntityByUUID(entityID); + HZ_CORE_ASSERT(entity); + + *outRotation = entity.GetComponent().Rotation; + } + + static void TransformComponent_GetScale(UUID entityID, glm::vec3* outScale) + { + Scene* scene = ScriptEngine::GetSceneContext(); + HZ_CORE_ASSERT(scene); + Entity entity = scene->GetEntityByUUID(entityID); + HZ_CORE_ASSERT(entity); + + *outScale = entity.GetComponent().Scale; + } static void TransformComponent_SetTranslation(UUID entityID, glm::vec3* translation) { @@ -93,6 +93,24 @@ namespace Hazel { entity.GetComponent().Translation = *translation; } + static void TransformComponent_SetRotation(UUID entityID, glm::vec3* rotation) + { + Scene* scene = ScriptEngine::GetSceneContext(); + HZ_CORE_ASSERT(scene); + Entity entity = scene->GetEntityByUUID(entityID); + HZ_CORE_ASSERT(entity); + + entity.GetComponent().Rotation = *rotation; + } + static void TransformComponent_SetScale(UUID entityID, glm::vec3* scale) + { + Scene* scene = ScriptEngine::GetSceneContext(); + HZ_CORE_ASSERT(scene); + Entity entity = scene->GetEntityByUUID(entityID); + HZ_CORE_ASSERT(entity); + + entity.GetComponent().Scale = *scale; + } static void Rigidbody2DComponent_ApplyLinearImpulse(UUID entityID, glm::vec2* impulse, glm::vec2* point, bool wake) { @@ -194,10 +212,6 @@ namespace Hazel { void ScriptGlue::RegisterFunctions() { - HZ_ADD_INTERNAL_CALL(NativeLog); - HZ_ADD_INTERNAL_CALL(NativeLog_Vector); - HZ_ADD_INTERNAL_CALL(NativeLog_VectorDot); - HZ_ADD_INTERNAL_CALL(GetScriptInstance); HZ_ADD_INTERNAL_CALL(Entity_HasComponent); @@ -205,6 +219,10 @@ namespace Hazel { HZ_ADD_INTERNAL_CALL(TransformComponent_GetTranslation); HZ_ADD_INTERNAL_CALL(TransformComponent_SetTranslation); + HZ_ADD_INTERNAL_CALL(TransformComponent_GetRotation); + HZ_ADD_INTERNAL_CALL(TransformComponent_SetRotation); + HZ_ADD_INTERNAL_CALL(TransformComponent_GetScale); + HZ_ADD_INTERNAL_CALL(TransformComponent_SetScale); HZ_ADD_INTERNAL_CALL(Rigidbody2DComponent_ApplyLinearImpulse); HZ_ADD_INTERNAL_CALL(Rigidbody2DComponent_ApplyLinearImpulseToCenter); diff --git a/Hazel/src/Platform/Windows/WindowsWindow.cpp b/Hazel/src/Platform/Windows/WindowsWindow.cpp index af4a39dd7..17487c76b 100644 --- a/Hazel/src/Platform/Windows/WindowsWindow.cpp +++ b/Hazel/src/Platform/Windows/WindowsWindow.cpp @@ -20,11 +20,11 @@ namespace Hazel { HZ_CORE_ERROR("GLFW Error ({0}): {1}", error, description); } - WindowsWindow::WindowsWindow(const WindowProps& props) + WindowsWindow::WindowsWindow(const WindowProps& props,bool maximized) { HZ_PROFILE_FUNCTION(); - Init(props); + Init(props,maximized); } WindowsWindow::~WindowsWindow() @@ -34,7 +34,7 @@ namespace Hazel { Shutdown(); } - void WindowsWindow::Init(const WindowProps& props) + void WindowsWindow::Init(const WindowProps& props,bool maximized) { HZ_PROFILE_FUNCTION(); @@ -53,6 +53,9 @@ namespace Hazel { } { + if(maximized) + glfwWindowHint(GLFW_MAXIMIZED, GLFW_TRUE); + HZ_PROFILE_SCOPE("glfwCreateWindow"); #if defined(HZ_DEBUG) if (Renderer::GetAPI() == RendererAPI::API::OpenGL) @@ -196,5 +199,4 @@ namespace Hazel { { return m_Data.VSync; } - } diff --git a/Hazel/src/Platform/Windows/WindowsWindow.h b/Hazel/src/Platform/Windows/WindowsWindow.h index cb1d19cb2..3bb56e685 100644 --- a/Hazel/src/Platform/Windows/WindowsWindow.h +++ b/Hazel/src/Platform/Windows/WindowsWindow.h @@ -10,7 +10,7 @@ namespace Hazel { class WindowsWindow : public Window { public: - WindowsWindow(const WindowProps& props); + WindowsWindow(const WindowProps& props,bool maximized); virtual ~WindowsWindow(); void OnUpdate() override; @@ -22,10 +22,9 @@ namespace Hazel { void SetEventCallback(const EventCallbackFn& callback) override { m_Data.EventCallback = callback; } void SetVSync(bool enabled) override; bool IsVSync() const override; - virtual void* GetNativeWindow() const { return m_Window; } private: - virtual void Init(const WindowProps& props); + virtual void Init(const WindowProps& props,bool maximized); virtual void Shutdown(); private: GLFWwindow* m_Window; @@ -43,4 +42,4 @@ namespace Hazel { WindowData m_Data; }; -} \ No newline at end of file +} diff --git a/Hazelnut/SandboxProject/Assets/Scenes/Physics2D.hazel b/Hazelnut/SandboxProject/Assets/Scenes/Physics2D.hazel index 0d8671e3a..196c3bba3 100644 --- a/Hazelnut/SandboxProject/Assets/Scenes/Physics2D.hazel +++ b/Hazelnut/SandboxProject/Assets/Scenes/Physics2D.hazel @@ -1,58 +1,20 @@ Scene: Untitled Entities: - - Entity: 16672940118998907085 - TagComponent: - Tag: Floor - TransformComponent: - Translation: [-0.883175671, -1.09447932, 0] - Rotation: [0, 0, -0.638996005] - Scale: [6.74196768, 0.46067813, 1] - SpriteRendererComponent: - Color: [0.949806929, 0.455301404, 0.0660097376, 1] - TilingFactor: 1 - Rigidbody2DComponent: - BodyType: Static - FixedRotation: false - BoxCollider2DComponent: - Offset: [0, 0] - Size: [0.5, 0.5] - Density: 1 - Friction: 0.5 - Restitution: 0 - RestitutionThreshold: 0.5 - - Entity: 4793924497264767156 + - Entity: 8254140920860137284 TagComponent: - Tag: Camera + Tag: Player TransformComponent: - Translation: [0, 0, 4.99711323] - Rotation: [0, 0, 0] - Scale: [1, 1, 1] - CameraComponent: - Camera: - ProjectionType: 0 - PerspectiveFOV: 0.785398185 - PerspectiveNear: 0.00999999978 - PerspectiveFar: 1000 - OrthographicSize: 10 - OrthographicNear: -1 - OrthographicFar: 1 - Primary: true - FixedAspectRatio: false + Translation: [0.0495706201, 0.271503896, 0.0225147791] + Rotation: [0, 0, -0.235084534] + Scale: [0.361159712, 0.375572056, 0.848135769] ScriptComponent: - ClassName: Sandbox.Camera + ClassName: Sandbox.Player ScriptFields: - - Name: DistanceFromPlayer + - Name: Speed Type: Float - Data: 5 - - Entity: 15045535320033348975 - TagComponent: - Tag: Block - TransformComponent: - Translation: [-0.560881913, 0.980064034, 0.0225147791] - Rotation: [0, 0, 0] - Scale: [0.361159712, 0.375572056, 0.848135769] + Data: 1.25 SpriteRendererComponent: - Color: [0.277992249, 0.277989477, 0.277989477, 1] + Color: [1, 1, 1, 1] TilingFactor: 1 Rigidbody2DComponent: BodyType: Dynamic @@ -84,50 +46,67 @@ Entities: Friction: 0.5 Restitution: 0 RestitutionThreshold: 0.5 - - Entity: 8804479042241551551 + - Entity: 15045535320033348975 TagComponent: - Tag: Circle + Tag: Block TransformComponent: - Translation: [1.02738881, -1.70331478, 0] + Translation: [-0.560881913, 0.980064034, 0.0225147791] Rotation: [0, 0, 0] - Scale: [2.15999985, 2.15999985, 2.15999985] - CircleRendererComponent: - Color: [0.934362948, 0.362345755, 0.057721246, 1] - Thickness: 0.100000001 - Fade: 0.00499999989 + Scale: [0.361159712, 0.375572056, 0.848135769] + SpriteRendererComponent: + Color: [0.277992249, 0.277989477, 0.277989477, 1] + TilingFactor: 1 Rigidbody2DComponent: - BodyType: Static + BodyType: Dynamic FixedRotation: false - CircleCollider2DComponent: + BoxCollider2DComponent: Offset: [0, 0] - Radius: 0.5 - Density: 1 - Friction: 0.5 - Restitution: 0 + Size: [0.5, 0.5] + Density: 0.879999995 + Friction: 0.100000001 + Restitution: 0.819999993 RestitutionThreshold: 0.5 - - Entity: 8254140920860137284 + - Entity: 4793924497264767156 TagComponent: - Tag: Player + Tag: Camera TransformComponent: - Translation: [0.0495706201, 0.271503896, 0.0225147791] - Rotation: [0, 0, -0.235084534] - Scale: [0.361159712, 0.375572056, 0.848135769] + Translation: [0, 0, 4.99711323] + Rotation: [0, 0, 0] + Scale: [1, 1, 1] + CameraComponent: + Camera: + ProjectionType: 0 + PerspectiveFOV: 0.785398185 + PerspectiveNear: 0.00999999978 + PerspectiveFar: 1000 + OrthographicSize: 10 + OrthographicNear: -1 + OrthographicFar: 1 + Primary: true + FixedAspectRatio: false ScriptComponent: - ClassName: Sandbox.Player + ClassName: Sandbox.Camera ScriptFields: - - Name: Speed + - Name: DistanceFromPlayer Type: Float - Data: 1.25 + Data: 5 + - Entity: 16672940118998907085 + TagComponent: + Tag: Floor + TransformComponent: + Translation: [-0.883175671, -1.09447932, 0] + Rotation: [0, 0, -0.638996005] + Scale: [6.74196768, 0.46067813, 1] SpriteRendererComponent: - Color: [1, 1, 1, 1] + Color: [0.949806929, 0.455301404, 0.0660097376, 1] TilingFactor: 1 Rigidbody2DComponent: - BodyType: Dynamic + BodyType: Static FixedRotation: false BoxCollider2DComponent: Offset: [0, 0] Size: [0.5, 0.5] - Density: 0.879999995 - Friction: 0.100000001 - Restitution: 0.819999993 + Density: 1 + Friction: 0.5 + Restitution: 0 RestitutionThreshold: 0.5 \ No newline at end of file diff --git a/Hazelnut/SandboxProject/Assets/Scripts/.gitignore b/Hazelnut/SandboxProject/Assets/Scripts/.gitignore new file mode 100644 index 000000000..4a785c3ca --- /dev/null +++ b/Hazelnut/SandboxProject/Assets/Scripts/.gitignore @@ -0,0 +1 @@ +Binaries/* \ No newline at end of file diff --git a/Hazelnut/imgui.ini b/Hazelnut/imgui.ini index a05a877c6..22567d0ad 100644 --- a/Hazelnut/imgui.ini +++ b/Hazelnut/imgui.ini @@ -4,8 +4,7 @@ Size=1600,900 Collapsed=0 [Window][Debug##Default] -ViewportPos=1180,1184 -ViewportId=0x9F5F46A1 +Pos=19,19 Size=400,400 Collapsed=0 @@ -58,7 +57,7 @@ Collapsed=0 DockId=0x0000000B,0 [Docking][Data] -DockSpace ID=0x3BC79352 Window=0x4647B76E Pos=307,336 Size=1600,876 Split=X Selected=0x995B0CF8 +DockSpace ID=0x3BC79352 Window=0x4647B76E Pos=60,107 Size=1600,876 Split=X Selected=0x995B0CF8 DockNode ID=0x00000008 Parent=0x3BC79352 SizeRef=1262,876 Split=X DockNode ID=0x00000001 Parent=0x00000008 SizeRef=370,696 Split=Y Selected=0xC89E3217 DockNode ID=0x00000005 Parent=0x00000001 SizeRef=370,435 Selected=0x9A68760C diff --git a/Sandbox/assets/fonts/opensans/LICENSE.txt b/Sandbox/assets/fonts/opensans/LICENSE.txt deleted file mode 100644 index d64569567..000000000 --- a/Sandbox/assets/fonts/opensans/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/Sandbox/assets/fonts/opensans/OpenSans-Bold.ttf b/Sandbox/assets/fonts/opensans/OpenSans-Bold.ttf deleted file mode 100644 index efdd5e84a..000000000 Binary files a/Sandbox/assets/fonts/opensans/OpenSans-Bold.ttf and /dev/null differ diff --git a/Sandbox/assets/fonts/opensans/OpenSans-BoldItalic.ttf b/Sandbox/assets/fonts/opensans/OpenSans-BoldItalic.ttf deleted file mode 100644 index 9bf9b4e97..000000000 Binary files a/Sandbox/assets/fonts/opensans/OpenSans-BoldItalic.ttf and /dev/null differ diff --git a/Sandbox/assets/fonts/opensans/OpenSans-ExtraBold.ttf b/Sandbox/assets/fonts/opensans/OpenSans-ExtraBold.ttf deleted file mode 100644 index 67fcf0fb2..000000000 Binary files a/Sandbox/assets/fonts/opensans/OpenSans-ExtraBold.ttf and /dev/null differ diff --git a/Sandbox/assets/fonts/opensans/OpenSans-ExtraBoldItalic.ttf b/Sandbox/assets/fonts/opensans/OpenSans-ExtraBoldItalic.ttf deleted file mode 100644 index 086722809..000000000 Binary files a/Sandbox/assets/fonts/opensans/OpenSans-ExtraBoldItalic.ttf and /dev/null differ diff --git a/Sandbox/assets/fonts/opensans/OpenSans-Italic.ttf b/Sandbox/assets/fonts/opensans/OpenSans-Italic.ttf deleted file mode 100644 index 117856707..000000000 Binary files a/Sandbox/assets/fonts/opensans/OpenSans-Italic.ttf and /dev/null differ diff --git a/Sandbox/assets/fonts/opensans/OpenSans-Light.ttf b/Sandbox/assets/fonts/opensans/OpenSans-Light.ttf deleted file mode 100644 index 6580d3a16..000000000 Binary files a/Sandbox/assets/fonts/opensans/OpenSans-Light.ttf and /dev/null differ diff --git a/Sandbox/assets/fonts/opensans/OpenSans-LightItalic.ttf b/Sandbox/assets/fonts/opensans/OpenSans-LightItalic.ttf deleted file mode 100644 index 1e0c33198..000000000 Binary files a/Sandbox/assets/fonts/opensans/OpenSans-LightItalic.ttf and /dev/null differ diff --git a/Sandbox/assets/fonts/opensans/OpenSans-Regular.ttf b/Sandbox/assets/fonts/opensans/OpenSans-Regular.ttf deleted file mode 100644 index 29bfd35a2..000000000 Binary files a/Sandbox/assets/fonts/opensans/OpenSans-Regular.ttf and /dev/null differ diff --git a/Sandbox/assets/fonts/opensans/OpenSans-SemiBold.ttf b/Sandbox/assets/fonts/opensans/OpenSans-SemiBold.ttf deleted file mode 100644 index 54e7059cf..000000000 Binary files a/Sandbox/assets/fonts/opensans/OpenSans-SemiBold.ttf and /dev/null differ diff --git a/Sandbox/assets/fonts/opensans/OpenSans-SemiBoldItalic.ttf b/Sandbox/assets/fonts/opensans/OpenSans-SemiBoldItalic.ttf deleted file mode 100644 index aebcf1421..000000000 Binary files a/Sandbox/assets/fonts/opensans/OpenSans-SemiBoldItalic.ttf and /dev/null differ diff --git a/Sandbox/assets/shaders/FlatColor.glsl b/Sandbox/assets/shaders/FlatColor.glsl deleted file mode 100644 index 2d39fc5b6..000000000 --- a/Sandbox/assets/shaders/FlatColor.glsl +++ /dev/null @@ -1,26 +0,0 @@ -// Flat Color Shader - -#type vertex -#version 330 core - -layout(location = 0) in vec3 a_Position; - -uniform mat4 u_ViewProjection; -uniform mat4 u_Transform; - -void main() -{ - gl_Position = u_ViewProjection * u_Transform * vec4(a_Position, 1.0); -} - -#type fragment -#version 330 core - -layout(location = 0) out vec4 color; - -uniform vec4 u_Color; - -void main() -{ - color = u_Color; -} \ No newline at end of file diff --git a/Sandbox/assets/shaders/Texture.glsl b/Sandbox/assets/shaders/Texture.glsl deleted file mode 100644 index d6858cad6..000000000 --- a/Sandbox/assets/shaders/Texture.glsl +++ /dev/null @@ -1,101 +0,0 @@ -// Basic Texture Shader - -#type vertex -#version 450 core - -layout(location = 0) in vec3 a_Position; -layout(location = 1) in vec4 a_Color; -layout(location = 2) in vec2 a_TexCoord; -layout(location = 3) in float a_TexIndex; -layout(location = 4) in float a_TilingFactor; -layout(location = 5) in int a_EntityID; - -layout(std140, binding = 0) uniform Camera -{ - mat4 u_ViewProjection; -}; - -struct VertexOutput -{ - vec4 Color; - vec2 TexCoord; - float TexIndex; - float TilingFactor; -}; - -layout (location = 0) out VertexOutput Output; -layout (location = 4) out flat int v_EntityID; - -void main() -{ - Output.Color = a_Color; - Output.TexCoord = a_TexCoord; - Output.TexIndex = a_TexIndex; - Output.TilingFactor = a_TilingFactor; - v_EntityID = a_EntityID; - - gl_Position = u_ViewProjection * vec4(a_Position, 1.0); -} - -#type fragment -#version 450 core - -layout(location = 0) out vec4 color; -layout(location = 1) out int color2; - -struct VertexOutput -{ - vec4 Color; - vec2 TexCoord; - float TexIndex; - float TilingFactor; -}; - -layout (location = 0) in VertexOutput Input; -layout (location = 4) in flat int v_EntityID; - -layout (binding = 0) uniform sampler2D u_Textures[32]; - -void main() -{ - vec4 texColor = Input.Color; - - switch(int(Input.TexIndex)) - { - case 0: texColor *= texture(u_Textures[ 0], Input.TexCoord * Input.TilingFactor); break; - case 1: texColor *= texture(u_Textures[ 1], Input.TexCoord * Input.TilingFactor); break; - case 2: texColor *= texture(u_Textures[ 2], Input.TexCoord * Input.TilingFactor); break; - case 3: texColor *= texture(u_Textures[ 3], Input.TexCoord * Input.TilingFactor); break; - case 4: texColor *= texture(u_Textures[ 4], Input.TexCoord * Input.TilingFactor); break; - case 5: texColor *= texture(u_Textures[ 5], Input.TexCoord * Input.TilingFactor); break; - case 6: texColor *= texture(u_Textures[ 6], Input.TexCoord * Input.TilingFactor); break; - case 7: texColor *= texture(u_Textures[ 7], Input.TexCoord * Input.TilingFactor); break; - case 8: texColor *= texture(u_Textures[ 8], Input.TexCoord * Input.TilingFactor); break; - case 9: texColor *= texture(u_Textures[ 9], Input.TexCoord * Input.TilingFactor); break; - case 10: texColor *= texture(u_Textures[10], Input.TexCoord * Input.TilingFactor); break; - case 11: texColor *= texture(u_Textures[11], Input.TexCoord * Input.TilingFactor); break; - case 12: texColor *= texture(u_Textures[12], Input.TexCoord * Input.TilingFactor); break; - case 13: texColor *= texture(u_Textures[13], Input.TexCoord * Input.TilingFactor); break; - case 14: texColor *= texture(u_Textures[14], Input.TexCoord * Input.TilingFactor); break; - case 15: texColor *= texture(u_Textures[15], Input.TexCoord * Input.TilingFactor); break; - case 16: texColor *= texture(u_Textures[16], Input.TexCoord * Input.TilingFactor); break; - case 17: texColor *= texture(u_Textures[17], Input.TexCoord * Input.TilingFactor); break; - case 18: texColor *= texture(u_Textures[18], Input.TexCoord * Input.TilingFactor); break; - case 19: texColor *= texture(u_Textures[19], Input.TexCoord * Input.TilingFactor); break; - case 20: texColor *= texture(u_Textures[20], Input.TexCoord * Input.TilingFactor); break; - case 21: texColor *= texture(u_Textures[21], Input.TexCoord * Input.TilingFactor); break; - case 22: texColor *= texture(u_Textures[22], Input.TexCoord * Input.TilingFactor); break; - case 23: texColor *= texture(u_Textures[23], Input.TexCoord * Input.TilingFactor); break; - case 24: texColor *= texture(u_Textures[24], Input.TexCoord * Input.TilingFactor); break; - case 25: texColor *= texture(u_Textures[25], Input.TexCoord * Input.TilingFactor); break; - case 26: texColor *= texture(u_Textures[26], Input.TexCoord * Input.TilingFactor); break; - case 27: texColor *= texture(u_Textures[27], Input.TexCoord * Input.TilingFactor); break; - case 28: texColor *= texture(u_Textures[28], Input.TexCoord * Input.TilingFactor); break; - case 29: texColor *= texture(u_Textures[29], Input.TexCoord * Input.TilingFactor); break; - case 30: texColor *= texture(u_Textures[30], Input.TexCoord * Input.TilingFactor); break; - case 31: texColor *= texture(u_Textures[31], Input.TexCoord * Input.TilingFactor); break; - } - color = texColor; - - color2 = v_EntityID; -} diff --git a/Sandbox/assets/textures/Checkerboard.png b/Sandbox/assets/textures/Checkerboard.png deleted file mode 100644 index a384354d4..000000000 Binary files a/Sandbox/assets/textures/Checkerboard.png and /dev/null differ diff --git a/Sandbox/assets/textures/ChernoLogo.png b/Sandbox/assets/textures/ChernoLogo.png deleted file mode 100644 index 60e1e2a86..000000000 Binary files a/Sandbox/assets/textures/ChernoLogo.png and /dev/null differ diff --git a/Sandbox/imgui.ini b/Sandbox/imgui.ini deleted file mode 100644 index cdfd537cc..000000000 --- a/Sandbox/imgui.ini +++ /dev/null @@ -1,28 +0,0 @@ -[Window][Debug##Default] -Pos=60,60 -Size=400,400 -Collapsed=0 - -[Window][Test] -Pos=60,60 -Size=92,48 -Collapsed=0 - -[Window][ImGui Demo] -ViewportPos=1404,134 -ViewportId=0x080FC883 -Size=550,680 -Collapsed=0 - -[Window][Settings] -ViewportPos=1214,617 -ViewportId=0x1C33C293 -Size=432,366 -Collapsed=0 - -[Window][DockSpace Demo] -Size=1280,720 -Collapsed=0 - -[Docking][Data] - diff --git a/Sandbox/premake5.lua b/Sandbox/premake5.lua deleted file mode 100644 index 9d957a78e..000000000 --- a/Sandbox/premake5.lua +++ /dev/null @@ -1,46 +0,0 @@ -project "Sandbox" - kind "ConsoleApp" - language "C++" - cppdialect "C++17" - staticruntime "off" - - targetdir ("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}") - objdir ("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}") - - files - { - "src/**.h", - "src/**.cpp" - } - - includedirs - { - "%{wks.location}/Hazel/vendor/spdlog/include", - "%{wks.location}/Hazel/src", - "%{wks.location}/Hazel/vendor", - "%{IncludeDir.glm}", - "%{IncludeDir.entt}" - } - - links - { - "Hazel" - } - - filter "system:windows" - systemversion "latest" - - 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" diff --git a/Sandbox/src/ExampleLayer.cpp b/Sandbox/src/ExampleLayer.cpp deleted file mode 100644 index fcbfbdc61..000000000 --- a/Sandbox/src/ExampleLayer.cpp +++ /dev/null @@ -1,188 +0,0 @@ -#include "ExampleLayer.h" - -#include "imgui/imgui.h" - -#include -#include - -ExampleLayer::ExampleLayer() - : Layer("ExampleLayer"), m_CameraController(1280.0f / 720.0f) -{ - m_VertexArray = Hazel::VertexArray::Create(); - - float vertices[3 * 7] = { - -0.5f, -0.5f, 0.0f, 0.8f, 0.2f, 0.8f, 1.0f, - 0.5f, -0.5f, 0.0f, 0.2f, 0.3f, 0.8f, 1.0f, - 0.0f, 0.5f, 0.0f, 0.8f, 0.8f, 0.2f, 1.0f - }; - - Hazel::Ref vertexBuffer = Hazel::VertexBuffer::Create(vertices, sizeof(vertices)); - Hazel::BufferLayout layout = { - { Hazel::ShaderDataType::Float3, "a_Position" }, - { Hazel::ShaderDataType::Float4, "a_Color" } - }; - vertexBuffer->SetLayout(layout); - m_VertexArray->AddVertexBuffer(vertexBuffer); - - uint32_t indices[3] = { 0, 1, 2 }; - Hazel::Ref indexBuffer = Hazel::IndexBuffer::Create(indices, sizeof(indices) / sizeof(uint32_t)); - m_VertexArray->SetIndexBuffer(indexBuffer); - - m_SquareVA = Hazel::VertexArray::Create(); - - float squareVertices[5 * 4] = { - -0.5f, -0.5f, 0.0f, 0.0f, 0.0f, - 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, - 0.5f, 0.5f, 0.0f, 1.0f, 1.0f, - -0.5f, 0.5f, 0.0f, 0.0f, 1.0f - }; - - Hazel::Ref squareVB = Hazel::VertexBuffer::Create(squareVertices, sizeof(squareVertices)); - squareVB->SetLayout({ - { Hazel::ShaderDataType::Float3, "a_Position" }, - { Hazel::ShaderDataType::Float2, "a_TexCoord" } - }); - m_SquareVA->AddVertexBuffer(squareVB); - - uint32_t squareIndices[6] = { 0, 1, 2, 2, 3, 0 }; - Hazel::Ref squareIB = Hazel::IndexBuffer::Create(squareIndices, sizeof(squareIndices) / sizeof(uint32_t)); - m_SquareVA->SetIndexBuffer(squareIB); - - std::string vertexSrc = R"( - #version 330 core - - layout(location = 0) in vec3 a_Position; - layout(location = 1) in vec4 a_Color; - - uniform mat4 u_ViewProjection; - uniform mat4 u_Transform; - - out vec3 v_Position; - out vec4 v_Color; - - void main() - { - v_Position = a_Position; - v_Color = a_Color; - gl_Position = u_ViewProjection * u_Transform * vec4(a_Position, 1.0); - } - )"; - - std::string fragmentSrc = R"( - #version 330 core - - layout(location = 0) out vec4 color; - - in vec3 v_Position; - in vec4 v_Color; - - void main() - { - color = vec4(v_Position * 0.5 + 0.5, 1.0); - color = v_Color; - } - )"; - - m_Shader = Hazel::Shader::Create("VertexPosColor", vertexSrc, fragmentSrc); - - std::string flatColorShaderVertexSrc = R"( - #version 330 core - - layout(location = 0) in vec3 a_Position; - - uniform mat4 u_ViewProjection; - uniform mat4 u_Transform; - - out vec3 v_Position; - - void main() - { - v_Position = a_Position; - gl_Position = u_ViewProjection * u_Transform * vec4(a_Position, 1.0); - } - )"; - - std::string flatColorShaderFragmentSrc = R"( - #version 330 core - - layout(location = 0) out vec4 color; - - in vec3 v_Position; - - uniform vec3 u_Color; - - void main() - { - color = vec4(u_Color, 1.0); - } - )"; - - m_FlatColorShader = Hazel::Shader::Create("FlatColor", flatColorShaderVertexSrc, flatColorShaderFragmentSrc); - - auto textureShader = m_ShaderLibrary.Load("assets/shaders/Texture.glsl"); - - m_Texture = Hazel::Texture2D::Create("assets/textures/Checkerboard.png"); - m_ChernoLogoTexture = Hazel::Texture2D::Create("assets/textures/ChernoLogo.png"); - - textureShader->Bind(); - textureShader->SetInt("u_Texture", 0); -} - -void ExampleLayer::OnAttach() -{ -} - -void ExampleLayer::OnDetach() -{ -} - -void ExampleLayer::OnUpdate(Hazel::Timestep ts) -{ - // Update - m_CameraController.OnUpdate(ts); - - // Render - Hazel::RenderCommand::SetClearColor({ 0.1f, 0.1f, 0.1f, 1 }); - Hazel::RenderCommand::Clear(); - - Hazel::Renderer::BeginScene(m_CameraController.GetCamera()); - - glm::mat4 scale = glm::scale(glm::mat4(1.0f), glm::vec3(0.1f)); - - m_FlatColorShader->Bind(); - m_FlatColorShader->SetFloat3("u_Color", m_SquareColor); - - for (int y = 0; y < 20; y++) - { - for (int x = 0; x < 20; x++) - { - glm::vec3 pos(x * 0.11f, y * 0.11f, 0.0f); - glm::mat4 transform = glm::translate(glm::mat4(1.0f), pos) * scale; - Hazel::Renderer::Submit(m_FlatColorShader, m_SquareVA, transform); - } - } - - auto textureShader = m_ShaderLibrary.Get("Texture"); - - m_Texture->Bind(); - Hazel::Renderer::Submit(textureShader, m_SquareVA, glm::scale(glm::mat4(1.0f), glm::vec3(1.5f))); - m_ChernoLogoTexture->Bind(); - Hazel::Renderer::Submit(textureShader, m_SquareVA, glm::scale(glm::mat4(1.0f), glm::vec3(1.5f))); - - // Triangle - // Hazel::Renderer::Submit(m_Shader, m_VertexArray); - - Hazel::Renderer::EndScene(); -} - -void ExampleLayer::OnImGuiRender() -{ - ImGui::Begin("Settings"); - ImGui::ColorEdit3("Square Color", glm::value_ptr(m_SquareColor)); - ImGui::End(); -} - -void ExampleLayer::OnEvent(Hazel::Event& e) -{ - m_CameraController.OnEvent(e); -} diff --git a/Sandbox/src/ExampleLayer.h b/Sandbox/src/ExampleLayer.h deleted file mode 100644 index ec98d3bef..000000000 --- a/Sandbox/src/ExampleLayer.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -#include "Hazel.h" - -class ExampleLayer : public Hazel::Layer -{ -public: - ExampleLayer(); - virtual ~ExampleLayer() = default; - - virtual void OnAttach() override; - virtual void OnDetach() override; - - void OnUpdate(Hazel::Timestep ts) override; - virtual void OnImGuiRender() override; - void OnEvent(Hazel::Event& e) override; -private: - Hazel::ShaderLibrary m_ShaderLibrary; - Hazel::Ref m_Shader; - Hazel::Ref m_VertexArray; - - Hazel::Ref m_FlatColorShader; - Hazel::Ref m_SquareVA; - - Hazel::Ref m_Texture, m_ChernoLogoTexture; - - Hazel::OrthographicCameraController m_CameraController; - glm::vec3 m_SquareColor = { 0.2f, 0.3f, 0.8f }; -}; - diff --git a/Sandbox/src/Sandbox2D.cpp b/Sandbox/src/Sandbox2D.cpp deleted file mode 100644 index ff5ec435c..000000000 --- a/Sandbox/src/Sandbox2D.cpp +++ /dev/null @@ -1,85 +0,0 @@ -#include "Sandbox2D.h" -#include - -#include -#include - -Sandbox2D::Sandbox2D() - : Layer("Sandbox2D"), m_CameraController(1280.0f / 720.0f), m_SquareColor({ 0.2f, 0.3f, 0.8f, 1.0f }) -{ -} - -void Sandbox2D::OnAttach() -{ - HZ_PROFILE_FUNCTION(); - - m_CheckerboardTexture = Hazel::Texture2D::Create("assets/textures/Checkerboard.png"); -} - -void Sandbox2D::OnDetach() -{ - HZ_PROFILE_FUNCTION(); -} - -void Sandbox2D::OnUpdate(Hazel::Timestep ts) -{ - HZ_PROFILE_FUNCTION(); - - // Update - m_CameraController.OnUpdate(ts); - - // Render - Hazel::Renderer2D::ResetStats(); - { - HZ_PROFILE_SCOPE("Renderer Prep"); - Hazel::RenderCommand::SetClearColor({ 0.1f, 0.1f, 0.1f, 1 }); - Hazel::RenderCommand::Clear(); - } - - { - static float rotation = 0.0f; - rotation += ts * 50.0f; - - HZ_PROFILE_SCOPE("Renderer Draw"); - Hazel::Renderer2D::BeginScene(m_CameraController.GetCamera()); - Hazel::Renderer2D::DrawRotatedQuad({ 1.0f, 0.0f }, { 0.8f, 0.8f }, -45.0f, { 0.8f, 0.2f, 0.3f, 1.0f }); - Hazel::Renderer2D::DrawQuad({ -1.0f, 0.0f }, { 0.8f, 0.8f }, { 0.8f, 0.2f, 0.3f, 1.0f }); - Hazel::Renderer2D::DrawQuad({ 0.5f, -0.5f }, { 0.5f, 0.75f }, m_SquareColor); - Hazel::Renderer2D::DrawQuad({ 0.0f, 0.0f, -0.1f }, { 20.0f, 20.0f }, m_CheckerboardTexture, 10.0f); - Hazel::Renderer2D::DrawRotatedQuad({ -2.0f, 0.0f, 0.0f }, { 1.0f, 1.0f }, rotation, m_CheckerboardTexture, 20.0f); - Hazel::Renderer2D::EndScene(); - - Hazel::Renderer2D::BeginScene(m_CameraController.GetCamera()); - for (float y = -5.0f; y < 5.0f; y += 0.5f) - { - for (float x = -5.0f; x < 5.0f; x += 0.5f) - { - glm::vec4 color = { (x + 5.0f) / 10.0f, 0.4f, (y + 5.0f) / 10.0f, 0.7f }; - Hazel::Renderer2D::DrawQuad({ x, y }, { 0.45f, 0.45f }, color); - } - } - Hazel::Renderer2D::EndScene(); - } -} - -void Sandbox2D::OnImGuiRender() -{ - HZ_PROFILE_FUNCTION(); - - ImGui::Begin("Settings"); - - auto stats = Hazel::Renderer2D::GetStats(); - ImGui::Text("Renderer2D Stats:"); - ImGui::Text("Draw Calls: %d", stats.DrawCalls); - ImGui::Text("Quads: %d", stats.QuadCount); - ImGui::Text("Vertices: %d", stats.GetTotalVertexCount()); - ImGui::Text("Indices: %d", stats.GetTotalIndexCount()); - - ImGui::ColorEdit4("Square Color", glm::value_ptr(m_SquareColor)); - ImGui::End(); -} - -void Sandbox2D::OnEvent(Hazel::Event& e) -{ - m_CameraController.OnEvent(e); -} diff --git a/Sandbox/src/Sandbox2D.h b/Sandbox/src/Sandbox2D.h deleted file mode 100644 index b637573b3..000000000 --- a/Sandbox/src/Sandbox2D.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#include "Hazel.h" - -class Sandbox2D : public Hazel::Layer -{ -public: - Sandbox2D(); - virtual ~Sandbox2D() = default; - - virtual void OnAttach() override; - virtual void OnDetach() override; - - void OnUpdate(Hazel::Timestep ts) override; - virtual void OnImGuiRender() override; - void OnEvent(Hazel::Event& e) override; -private: - Hazel::OrthographicCameraController m_CameraController; - - // Temp - Hazel::Ref m_SquareVA; - Hazel::Ref m_FlatColorShader; - - Hazel::Ref m_CheckerboardTexture; - - glm::vec4 m_SquareColor = { 0.2f, 0.3f, 0.8f, 1.0f }; -}; \ No newline at end of file diff --git a/Sandbox/src/SandboxApp.cpp b/Sandbox/src/SandboxApp.cpp deleted file mode 100644 index ea0570ddd..000000000 --- a/Sandbox/src/SandboxApp.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include - -#include "Sandbox2D.h" -#include "ExampleLayer.h" - -class Sandbox : public Hazel::Application -{ -public: - Sandbox(const Hazel::ApplicationSpecification& specification) - : Hazel::Application(specification) - { - // PushLayer(new ExampleLayer()); - PushLayer(new Sandbox2D()); - } - - ~Sandbox() - { - } -}; - -Hazel::Application* Hazel::CreateApplication(Hazel::ApplicationCommandLineArgs args) -{ - ApplicationSpecification spec; - spec.Name = "Sandbox"; - spec.WorkingDirectory = "../Hazelnut"; - spec.CommandLineArgs = args; - - return new Sandbox(spec); -} diff --git a/premake5.lua b/premake5.lua index 12f453ddb..2313b91e0 100644 --- a/premake5.lua +++ b/premake5.lua @@ -41,7 +41,3 @@ group "" group "Tools" include "Hazelnut" group "" - -group "Misc" - include "Sandbox" -group ""