Removing named namespace from code base.

This commit is contained in:
2026-08-22 21:39:21 -04:00
parent 678795b793
commit 4180622d6a
158 changed files with 12260 additions and 12648 deletions
+25 -25
View File
@@ -1,4 +1,4 @@
#include <Controller/DebugCameraController.h> #include <Controller/DebugCameraController.h>
#include <Controller/ControllerUtils.h> #include <Controller/ControllerUtils.h>
#include <Core/Common/CoreUtils.h> #include <Core/Common/CoreUtils.h>
@@ -24,10 +24,10 @@ void ActivateDebugController()
{ {
Assert(gIsDebugCameraActive == false); Assert(gIsDebugCameraActive == false);
Juliet::Camera* currentCam = Juliet::GetCurrentCamera(); Camera* currentCam = GetCurrentCamera();
gPreviousCameraIndex = currentCam->Index; gPreviousCameraIndex = currentCam->Index;
Juliet::SetCurrentCamera(kDebugCamera); SetCurrentCamera(kDebugCamera);
gIsDebugCameraActive = true; gIsDebugCameraActive = true;
gFirstUpdate = true; gFirstUpdate = true;
@@ -41,7 +41,7 @@ void DeactivateDebugController()
gIsDebugCameraActive = false; gIsDebugCameraActive = false;
Juliet::SetCurrentCamera(gPreviousCameraIndex); SetCurrentCamera(gPreviousCameraIndex);
} }
bool IsDebugControllerActive() bool IsDebugControllerActive()
@@ -51,26 +51,26 @@ bool IsDebugControllerActive()
void UpdateDebugController(float dt) void UpdateDebugController(float dt)
{ {
Juliet::Camera* currentCam = Juliet::GetCurrentCamera(); Camera* currentCam = GetCurrentCamera();
if (gFirstUpdate) if (gFirstUpdate)
{ {
Juliet::Vector3 dir = Juliet::Vector3{ 0.0f, 0.0f, 0.0f } - currentCam->Position; Vector3 dir = Vector3{ 0.0f, 0.0f, 0.0f } - currentCam->Position;
dir = Juliet::Normalize(dir); dir = Normalize(dir);
gPitch = asinf(dir.z); gPitch = asinf(dir.z);
gYaw = atan2f(dir.y, dir.x); gYaw = atan2f(dir.y, dir.x);
gFirstUpdate = false; gFirstUpdate = false;
Juliet::Vector3 forward; Vector3 forward;
forward.x = cosf(gPitch) * cosf(gYaw); forward.x = cosf(gPitch) * cosf(gYaw);
forward.y = cosf(gPitch) * sinf(gYaw); forward.y = cosf(gPitch) * sinf(gYaw);
forward.z = sinf(gPitch); forward.z = sinf(gPitch);
Juliet::Vector3 right = Juliet::Normalize(Juliet::Cross(Juliet::Vector3{ 0.0f, 0.0f, 1.0f }, forward)); Vector3 right = Normalize(Cross(Vector3{ 0.0f, 0.0f, 1.0f }, forward));
currentCam->Target = currentCam->Position + forward; currentCam->Target = currentCam->Position + forward;
currentCam->Up = Juliet::Cross(forward, right); currentCam->Up = Cross(forward, right);
} }
bool isRightMouseButtonDown = Juliet::IsMouseButtonDown(Juliet::MouseButton::Right); bool isRightMouseButtonDown = IsMouseButtonDown(MouseButton::Right);
if (isRightMouseButtonDown && !gWasRightMouseButtonDown) if (isRightMouseButtonDown && !gWasRightMouseButtonDown)
{ {
gIsFpsModeActive = !gIsFpsModeActive; gIsFpsModeActive = !gIsFpsModeActive;
@@ -82,7 +82,7 @@ void UpdateDebugController(float dt)
return; return;
} }
Juliet::MousePosition mouseDelta = Juliet::GetMouseDelta(); MousePosition mouseDelta = GetMouseDelta();
float sensitivity = 0.005f; float sensitivity = 0.005f;
gYaw += mouseDelta.X * sensitivity; gYaw += mouseDelta.X * sensitivity;
@@ -91,52 +91,52 @@ void UpdateDebugController(float dt)
gPitch = std::min(gPitch, 1.5f); gPitch = std::min(gPitch, 1.5f);
gPitch = std::max(gPitch, -1.5f); gPitch = std::max(gPitch, -1.5f);
if (Juliet::IsKeyDown(Juliet::ScanCode::Q)) if (IsKeyDown(ScanCode::Q))
{ {
gYaw -= 2.0f * dt; gYaw -= 2.0f * dt;
} }
if (Juliet::IsKeyDown(Juliet::ScanCode::E)) if (IsKeyDown(ScanCode::E))
{ {
gYaw += 2.0f * dt; gYaw += 2.0f * dt;
} }
Juliet::Vector3 forward; Vector3 forward;
forward.x = cosf(gPitch) * cosf(gYaw); forward.x = cosf(gPitch) * cosf(gYaw);
forward.y = cosf(gPitch) * sinf(gYaw); forward.y = cosf(gPitch) * sinf(gYaw);
forward.z = sinf(gPitch); forward.z = sinf(gPitch);
Juliet::Vector3 right = Juliet::Normalize(Juliet::Cross(Juliet::Vector3{ 0.0f, 0.0f, 1.0f }, forward)); Vector3 right = Normalize(Cross(Vector3{ 0.0f, 0.0f, 1.0f }, forward));
Juliet::Vector3 defaultUp = Juliet::Cross(forward, right); Vector3 defaultUp = Cross(forward, right);
static const float kMovementPerFrame = 10.f; // 10m/s static const float kMovementPerFrame = 10.f; // 10m/s
float speedPerFrame = kMovementPerFrame; float speedPerFrame = kMovementPerFrame;
if (Juliet::IsKeyDown(Juliet::ScanCode::LeftShift)) if (IsKeyDown(ScanCode::LeftShift))
{ {
speedPerFrame *= 10.f; // 100m/s speedPerFrame *= 10.f; // 100m/s
} }
if (Juliet::IsKeyDown(Juliet::ScanCode::W)) if (IsKeyDown(ScanCode::W))
{ {
currentCam->Position = currentCam->Position + forward * (speedPerFrame * dt); currentCam->Position = currentCam->Position + forward * (speedPerFrame * dt);
} }
if (Juliet::IsKeyDown(Juliet::ScanCode::S)) if (IsKeyDown(ScanCode::S))
{ {
currentCam->Position = currentCam->Position - forward * (speedPerFrame * dt); currentCam->Position = currentCam->Position - forward * (speedPerFrame * dt);
} }
if (Juliet::IsKeyDown(Juliet::ScanCode::D)) if (IsKeyDown(ScanCode::D))
{ {
currentCam->Position = currentCam->Position + right * (speedPerFrame * dt); currentCam->Position = currentCam->Position + right * (speedPerFrame * dt);
} }
if (Juliet::IsKeyDown(Juliet::ScanCode::A)) if (IsKeyDown(ScanCode::A))
{ {
currentCam->Position = currentCam->Position - right * (speedPerFrame * dt); currentCam->Position = currentCam->Position - right * (speedPerFrame * dt);
} }
if (Juliet::IsKeyDown(Juliet::ScanCode::Space)) if (IsKeyDown(ScanCode::Space))
{ {
currentCam->Position = currentCam->Position + defaultUp * (speedPerFrame * dt); currentCam->Position = currentCam->Position + defaultUp * (speedPerFrame * dt);
} }
if (Juliet::IsKeyDown(Juliet::ScanCode::LeftControl)) if (IsKeyDown(ScanCode::LeftControl))
{ {
currentCam->Position = currentCam->Position - defaultUp * (speedPerFrame * dt); currentCam->Position = currentCam->Position - defaultUp * (speedPerFrame * dt);
} }
@@ -148,7 +148,7 @@ void UpdateDebugController(float dt)
#if JULIET_DEBUG #if JULIET_DEBUG
void RenderImGuiDebugController(float dt) void RenderImGuiDebugController(float dt)
{ {
Juliet::Camera* currentCam = Juliet::GetCurrentCamera(); Camera* currentCam = GetCurrentCamera();
ImGui::Text("Delta time: %f", dt); ImGui::Text("Delta time: %f", dt);
+2 -3
View File
@@ -1,13 +1,12 @@
#include <Debug/DebugTopBar.h> #include <Debug/DebugTopBar.h>
#include <game.h> #include <game.h>
#include <imgui.h> #include <imgui.h>
namespace namespace
{ {
Juliet::String GetGameModeName(GameMode gameMode) String GetGameModeName(GameMode gameMode)
{ {
using namespace Juliet;
switch (gameMode) switch (gameMode)
{ {
case GameMode::Editor: return WrapString("Editor"); case GameMode::Editor: return WrapString("Editor");
+7 -7
View File
@@ -1,4 +1,4 @@
#pragma once #pragma once
#include <Core/Common/CoreUtils.h> #include <Core/Common/CoreUtils.h>
#include <Core/Memory/Allocator.h> #include <Core/Memory/Allocator.h>
@@ -8,19 +8,19 @@
#define DECLARE_ENTITY() \ #define DECLARE_ENTITY() \
Entity* Base; \ Entity* Base; \
static const Juliet::Class* Kind; static const Class* Kind;
// Will register the class globally at launch // Will register the class globally at launch
#define DEFINE_ENTITY(entity) \ #define DEFINE_ENTITY(entity) \
constexpr Juliet::Class entityKind##entity(#entity, sizeof(#entity) / sizeof(char)); \ constexpr Class entityKind##entity(#entity, sizeof(#entity) / sizeof(char)); \
const Juliet::Class* entity::Kind = &entityKind##entity; const Class* entity::Kind = &entityKind##entity;
using DerivedType = void*; using DerivedType = void*;
struct Entity final struct Entity final
{ {
EntityID ID; EntityID ID;
const Juliet::Class* Kind; const Class* Kind;
DerivedType Derived; DerivedType Derived;
float X, Y; float X, Y;
index_t MeshInstance = indexMax; index_t MeshInstance = indexMax;
@@ -28,7 +28,7 @@ struct Entity final
template <typename EntityType> template <typename EntityType>
concept EntityConcept = requires(EntityType entity) { concept EntityConcept = requires(EntityType entity) {
requires std::same_as<decltype(entity.Kind), const Juliet::Class*>; requires std::same_as<decltype(entity.Kind), const Class*>;
requires std::same_as<decltype(entity.Base), Entity*>; requires std::same_as<decltype(entity.Base), Entity*>;
}; };
@@ -44,7 +44,7 @@ template <typename EntityType>
EntityType* MakeEntity(EntityManager& manager, float x, float y) EntityType* MakeEntity(EntityManager& manager, float x, float y)
{ {
auto* arena = manager.Arena; auto* arena = manager.Arena;
EntityType* result = Juliet::ArenaPushStruct<EntityType>(arena); EntityType* result = ArenaPushStruct<EntityType>(arena);
Entity base; Entity base;
base.X = x; base.X = x;
base.Y = y; base.Y = y;
+6 -6
View File
@@ -1,18 +1,18 @@
#include <Entity/EntityManager.h> #include <Entity/EntityManager.h>
#include <Entity/Entity.h> #include <Entity/Entity.h>
#include <Graphics/MeshRenderer.h> #include <Graphics/MeshRenderer.h>
EntityID EntityManager::ID = 0; EntityID EntityManager::ID = 0;
void InitEntityManager(Juliet::NonNullPtr<World> world) void InitEntityManager(NonNullPtr<World> world)
{ {
EntityManager* newManager = Juliet::ArenaPushStruct<EntityManager>(world->WorldArena); EntityManager* newManager = ArenaPushStruct<EntityManager>(world->WorldArena);
world->EntityManager = newManager; world->EntityManager = newManager;
newManager->Entities.Create(world->WorldArena JULIET_DEBUG_PARAM("Entities")); newManager->Entities.Create(world->WorldArena JULIET_DEBUG_PARAM("Entities"));
newManager->Arena = Juliet::ArenaAllocate({ .Name = "Entity Arena" }); newManager->Arena = ArenaAllocate({ .Name = "Entity Arena" });
} }
void ShutdownEntityManager() void ShutdownEntityManager()
@@ -22,7 +22,7 @@ void ShutdownEntityManager()
EntityManager& GetEntityManager() EntityManager& GetEntityManager()
{ {
Juliet::NonNullPtr entityManager = GetGameState()->World->EntityManager; NonNullPtr entityManager = GetGameState()->World->EntityManager;
return *entityManager; return *entityManager;
} }
@@ -37,7 +37,7 @@ void UpdateEntityManager(EntityManager& manager)
{ {
if (ent.MeshInstance != indexMax) if (ent.MeshInstance != indexMax)
{ {
Juliet::SetMeshInstanceTransform(ent.MeshInstance, Juliet::MatrixTranslation(ent.X, ent.Y, 0.0f)); SetMeshInstanceTransform(ent.MeshInstance, MatrixTranslation(ent.X, ent.Y, 0.0f));
} }
} }
} }
+4 -4
View File
@@ -1,4 +1,4 @@
#pragma once #pragma once
#include <Core/Common/CoreTypes.h> #include <Core/Common/CoreTypes.h>
#include <Core/Container/Vector.h> #include <Core/Container/Vector.h>
@@ -11,13 +11,13 @@ struct EntityManager
{ {
static EntityID ID; static EntityID ID;
Juliet::Arena* Arena; Arena* Arena;
// TODO: Should be a pool // TODO: Should be a pool
Juliet::VectorArena<Entity, 1024> Entities; VectorArena<Entity, 1024> Entities;
}; };
void InitEntityManager(Juliet::NonNullPtr<World> world); void InitEntityManager(NonNullPtr<World> world);
void ShutdownEntityManager(); void ShutdownEntityManager();
EntityManager& GetEntityManager(); EntityManager& GetEntityManager();
void RegisterEntity(EntityManager& manager, Entity* entity); void RegisterEntity(EntityManager& manager, Entity* entity);
+2 -4
View File
@@ -1,4 +1,4 @@
#include <game.h> #include <game.h>
#include <Controller/DebugCameraController.h> #include <Controller/DebugCameraController.h>
#include <Core/HAL/Filesystem/Filesystem.h> #include <Core/HAL/Filesystem/Filesystem.h>
@@ -31,14 +31,12 @@ extern "C" JULIET_API void __cdecl GameShutdown()
{ {
printf("Shutting down game...\n"); printf("Shutting down game...\n");
using namespace Juliet;
ShutdownEntityManager(); ShutdownEntityManager();
} }
extern "C" JULIET_API void __cdecl GameUpdate(Juliet::GameData* params, [[maybe_unused]] float deltaTime) extern "C" JULIET_API void __cdecl GameUpdate(GameData* params, [[maybe_unused]] float deltaTime)
{ {
using namespace Juliet;
gGameState = params->GameState; gGameState = params->GameState;
if (!gGameState) if (!gGameState)
+3 -3
View File
@@ -1,4 +1,4 @@
#pragma once #pragma once
#include <Core/Memory/MemoryArena.h> #include <Core/Memory/MemoryArena.h>
@@ -6,7 +6,7 @@ struct EntityManager;
struct World struct World
{ {
Juliet::Arena* WorldArena; Arena* WorldArena;
EntityManager* EntityManager; EntityManager* EntityManager;
}; };
@@ -19,7 +19,7 @@ enum class GameMode
struct GameState struct GameState
{ {
Juliet::Arena* TotalArena; Arena* TotalArena;
World* World; World* World;
@@ -1,13 +1,10 @@
#pragma once #pragma once
#include <Core/Application/IApplication.h> #include <Core/Application/IApplication.h>
#include <Core/Common/CoreTypes.h> #include <Core/Common/CoreTypes.h>
#include <Juliet.h> #include <Juliet.h>
namespace Juliet
{
enum class JulietInit_Flags : uint8; enum class JulietInit_Flags : uint8;
struct Arena; struct Arena;
extern JULIET_API void StartApplication(IApplication& app, JulietInit_Flags flags); extern JULIET_API void StartApplication(IApplication& app, JulietInit_Flags flags);
} // namespace Juliet
@@ -1,9 +1,7 @@
#pragma once #pragma once
#include <Core/Common/NonNullPtr.h> #include <Core/Common/NonNullPtr.h>
namespace Juliet
{
struct Camera; struct Camera;
struct RenderPass; struct RenderPass;
struct CommandList; struct CommandList;
@@ -29,4 +27,3 @@ namespace Juliet
virtual ColorTargetInfo GetColorTargetInfo(Texture* swapchainTexture) = 0; virtual ColorTargetInfo GetColorTargetInfo(Texture* swapchainTexture) = 0;
virtual DepthStencilTargetInfo* GetDepthTargetInfo() = 0; virtual DepthStencilTargetInfo* GetDepthTargetInfo() = 0;
}; };
} // namespace Juliet
+1 -4
View File
@@ -1,9 +1,7 @@
#pragma once #pragma once
// From https://web.mit.edu/freebsd/head/sys/libkern/crc32.c // From https://web.mit.edu/freebsd/head/sys/libkern/crc32.c
namespace Juliet
{
namespace details namespace details
{ {
constexpr uint32_t crc32_tab[] = { constexpr uint32_t crc32_tab[] = {
@@ -55,4 +53,3 @@ namespace Juliet
return crc32(str, length); return crc32(str, length);
} }
} // namespace Juliet
+4 -7
View File
@@ -1,10 +1,8 @@
#pragma once #pragma once
#include <Core/Common/CoreTypes.h> #include <Core/Common/CoreTypes.h>
#include <Juliet.h> #include <Juliet.h>
namespace Juliet
{
#define global static #define global static
@@ -59,7 +57,7 @@ namespace Juliet
{ \ { \
if (!(expression)) [[unlikely]] \ if (!(expression)) [[unlikely]] \
{ \ { \
Juliet::JulietAssert(#expression, message); \ JulietAssert(#expression, message); \
} \ } \
} \ } \
JULIET_WARNING_POP \ JULIET_WARNING_POP \
@@ -71,7 +69,7 @@ namespace Juliet
long hr_val = (hr_expression); \ long hr_val = (hr_expression); \
if (hr_val < 0) \ if (hr_val < 0) \
{ \ { \
Juliet::JulietAssert(#hr_expression, message, std::source_location::current(), hr_val); \ JulietAssert(#hr_expression, message, std::source_location::current(), hr_val); \
} \ } \
} \ } \
while (0) while (0)
@@ -83,7 +81,7 @@ namespace Juliet
#define Unimplemented() \ #define Unimplemented() \
do \ do \
{ \ { \
Juliet::JulietAssert("UNIMPLEMENTED", "This code path is not yet functional."); \ JulietAssert("UNIMPLEMENTED", "This code path is not yet functional."); \
} \ } \
while (0) while (0)
@@ -228,4 +226,3 @@ namespace Juliet
const uint32 bitmask16 = 0x0000'ffff; const uint32 bitmask16 = 0x0000'ffff;
// ... // ...
const uint32 bitmask32 = 0xffff'ffff; const uint32 bitmask32 = 0xffff'ffff;
} // namespace Juliet
+1 -4
View File
@@ -1,7 +1,5 @@
#pragma once #pragma once
namespace Juliet
{
template <typename T> template <typename T>
concept IsEnum = std::is_enum_v<T>; concept IsEnum = std::is_enum_v<T>;
@@ -86,4 +84,3 @@ namespace Juliet
{ {
return static_cast<E>(value); return static_cast<E>(value);
} }
} // namespace Juliet
+1 -4
View File
@@ -1,9 +1,7 @@
#pragma once #pragma once
#include <Core/Common/CoreUtils.h> #include <Core/Common/CoreUtils.h>
namespace Juliet
{
template <typename Type, typename OtherType> template <typename Type, typename OtherType>
concept NonNullPtr_Convertible = std::is_convertible_v<OtherType*, Type*>; concept NonNullPtr_Convertible = std::is_convertible_v<OtherType*, Type*>;
@@ -110,4 +108,3 @@ namespace Juliet
template <typename T> template <typename T>
NonNullPtr(T*) -> NonNullPtr<T>; NonNullPtr(T*) -> NonNullPtr<T>;
} // namespace Juliet
+3 -6
View File
@@ -1,4 +1,4 @@
#pragma once #pragma once
#include <Core/Common/NonNullPtr.h> #include <Core/Common/NonNullPtr.h>
#include <Core/Math/MathUtils.h> #include <Core/Math/MathUtils.h>
@@ -14,8 +14,6 @@
#undef RESTORE_GLOBAL #undef RESTORE_GLOBAL
#endif #endif
namespace Juliet
{
struct Arena; struct Arena;
#define ConstString(str) { const_cast<char*>((str)), sizeof(str) - 1 } #define ConstString(str) { const_cast<char*>((str)), sizeof(str) - 1 }
@@ -174,10 +172,9 @@ namespace Juliet
} }
#define juliet_snprintf snprintf #define juliet_snprintf snprintf
} // namespace Juliet
#ifdef UNIT_TEST #ifdef UNIT_TEST
namespace Juliet::UnitTest namespace UnitTest
{ {
inline void TestFindChar() inline void TestFindChar()
{ {
@@ -192,5 +189,5 @@ namespace Juliet::UnitTest
Assert(FindChar(s2, 'f').Str - s2.Str == 5); Assert(FindChar(s2, 'f').Str - s2.Str == 5);
Assert(FindChar(s3, '1').Str - s3.Str == 0); Assert(FindChar(s3, '1').Str - s3.Str == 0);
} }
} // namespace Juliet::UnitTest } // namespace UnitTest
#endif #endif
+1 -4
View File
@@ -1,10 +1,8 @@
#pragma once #pragma once
#include <Core/Common/NonNullPtr.h> #include <Core/Common/NonNullPtr.h>
#include <Core/Memory/MemoryArena.h> #include <Core/Memory/MemoryArena.h>
namespace Juliet
{
template <typename Type, size_t ReserveSize = 16> template <typename Type, size_t ReserveSize = 16>
struct VectorArena struct VectorArena
{ {
@@ -211,4 +209,3 @@ namespace Juliet
"VectorArena must have a standard layout to remain POD-like."); "VectorArena must have a standard layout to remain POD-like.");
static_assert(std::is_trivially_copyable_v<VectorArena<int>>, static_assert(std::is_trivially_copyable_v<VectorArena<int>>,
"VectorArena must be trivially copyable (no custom destructors/assignment)."); "VectorArena must be trivially copyable (no custom destructors/assignment).");
} // namespace Juliet
+1 -4
View File
@@ -1,12 +1,10 @@
#pragma once #pragma once
#include <Core/Common/CoreTypes.h> #include <Core/Common/CoreTypes.h>
#include <Core/Common/NonNullPtr.h> #include <Core/Common/NonNullPtr.h>
#include <Core/Common/String.h> #include <Core/Common/String.h>
#include <Juliet.h> #include <Juliet.h>
namespace Juliet
{
struct Window; struct Window;
using WindowID = uint8; using WindowID = uint8;
@@ -18,4 +16,3 @@ namespace Juliet
extern JULIET_API WindowID GetWindowID(NonNullPtr<Window> window); extern JULIET_API WindowID GetWindowID(NonNullPtr<Window> window);
extern JULIET_API void SetWindowTitle(NonNullPtr<Window> window, String title); extern JULIET_API void SetWindowTitle(NonNullPtr<Window> window, String title);
} // namespace Juliet
@@ -1,12 +1,9 @@
#pragma once #pragma once
#include <Core/Common/NonNullPtr.h> #include <Core/Common/NonNullPtr.h>
namespace Juliet
{
struct DynamicLibrary; struct DynamicLibrary;
extern JULIET_API DynamicLibrary* LoadDynamicLibrary(const char* filename); extern JULIET_API DynamicLibrary* LoadDynamicLibrary(const char* filename);
extern JULIET_API FunctionPtr LoadFunction(NonNullPtr<DynamicLibrary> lib, const char* functionName); extern JULIET_API FunctionPtr LoadFunction(NonNullPtr<DynamicLibrary> lib, const char* functionName);
extern JULIET_API void UnloadDynamicLibrary(NonNullPtr<DynamicLibrary> lib); extern JULIET_API void UnloadDynamicLibrary(NonNullPtr<DynamicLibrary> lib);
} // namespace Juliet
+1 -4
View File
@@ -1,4 +1,4 @@
#pragma once #pragma once
#include <Core/HAL/Display/Display.h> #include <Core/HAL/Display/Display.h>
#include <Core/HAL/Keyboard/Keyboard.h> #include <Core/HAL/Keyboard/Keyboard.h>
@@ -9,8 +9,6 @@
// Handles all events from systems handling the Hardware // Handles all events from systems handling the Hardware
// Very inspired by SDL3 // Very inspired by SDL3
namespace Juliet
{
enum class EventType : uint32 enum class EventType : uint32
{ {
None = 0, None = 0,
@@ -120,4 +118,3 @@ namespace Juliet
extern JULIET_API bool AddEvent(SystemEvent& event); extern JULIET_API bool AddEvent(SystemEvent& event);
extern void Events_NewFrame(float deltaTime); extern void Events_NewFrame(float deltaTime);
} // namespace Juliet
@@ -1,9 +1,7 @@
#pragma once #pragma once
#include <Core/Common/String.h> #include <Core/Common/String.h>
namespace Juliet
{
// Returns the path to the application directory // Returns the path to the application directory
[[nodiscard]] extern JULIET_API String GetBasePath(); [[nodiscard]] extern JULIET_API String GetBasePath();
@@ -17,4 +15,3 @@ namespace Juliet
[[nodiscard]] extern JULIET_API String GetAssetPath(NonNullPtr<Arena> arena, String filename); [[nodiscard]] extern JULIET_API String GetAssetPath(NonNullPtr<Arena> arena, String filename);
[[nodiscard]] extern JULIET_API bool IsAbsolutePath(String path); [[nodiscard]] extern JULIET_API bool IsAbsolutePath(String path);
} // namespace Juliet
+1 -4
View File
@@ -1,11 +1,9 @@
#pragma once #pragma once
#include <Core/Common/NonNullPtr.h> #include <Core/Common/NonNullPtr.h>
#include <Core/Common/String.h> #include <Core/Common/String.h>
#include <Juliet.h> #include <Juliet.h>
namespace Juliet
{
// Opaque type // Opaque type
struct IOStream; struct IOStream;
@@ -66,4 +64,3 @@ namespace Juliet
extern JULIET_API ByteBuffer LoadFile(NonNullPtr<Arena> arena, NonNullPtr<IOStream> stream, bool closeStreamWhenDone); extern JULIET_API ByteBuffer LoadFile(NonNullPtr<Arena> arena, NonNullPtr<IOStream> stream, bool closeStreamWhenDone);
extern JULIET_API bool IOClose(NonNullPtr<IOStream> stream); extern JULIET_API bool IOClose(NonNullPtr<IOStream> stream);
} // namespace Juliet
+1 -4
View File
@@ -1,9 +1,7 @@
#pragma once #pragma once
#include <Core/Common/CoreTypes.h> #include <Core/Common/CoreTypes.h>
namespace Juliet
{
// Represents a Virtual Key corresponding to the Physical key, but localized using the keyboard layout // Represents a Virtual Key corresponding to the Physical key, but localized using the keyboard layout
// ScanCode reprensent US ASCII Keyboard // ScanCode reprensent US ASCII Keyboard
// WASD Scan codes are ZQSD in KeyCode for French keyboard // WASD Scan codes are ZQSD in KeyCode for French keyboard
@@ -190,4 +188,3 @@ namespace Juliet
Alt = LeftAlt | RightAlt, Alt = LeftAlt | RightAlt,
OSCommand = LeftOSCommand | RightOSCommand, OSCommand = LeftOSCommand | RightOSCommand,
}; };
} // namespace Juliet
+1 -4
View File
@@ -1,11 +1,9 @@
#pragma once #pragma once
#include <Core/HAL/Keyboard/KeyCode.h> #include <Core/HAL/Keyboard/KeyCode.h>
#include <Core/HAL/Keyboard/ScanCode.h> #include <Core/HAL/Keyboard/ScanCode.h>
#include <Juliet.h> #include <Juliet.h>
namespace Juliet
{
using KeyboardID = uint8; using KeyboardID = uint8;
enum class KeyPosition : bool enum class KeyPosition : bool
@@ -32,4 +30,3 @@ namespace Juliet
extern JULIET_API KeyMod GetKeyModState(); extern JULIET_API KeyMod GetKeyModState();
extern JULIET_API KeyCode GetKeyCodeFromScanCode(ScanCode scanCode, KeyMod keyModState); extern JULIET_API KeyCode GetKeyCodeFromScanCode(ScanCode scanCode, KeyMod keyModState);
} // namespace Juliet
+1 -4
View File
@@ -1,7 +1,5 @@
#pragma once #pragma once
namespace Juliet
{
// Follow the HID Usage page for USB // Follow the HID Usage page for USB
// https://usb.org/sites/default/files/hut1_5.pdf // https://usb.org/sites/default/files/hut1_5.pdf
// 0 to 256 Is dedicated to Keyboard Usage Page (0x07) // 0 to 256 Is dedicated to Keyboard Usage Page (0x07)
@@ -183,4 +181,3 @@ namespace Juliet
Count = 512 Count = 512
}; };
} // namespace Juliet
+1 -4
View File
@@ -1,7 +1,5 @@
#pragma once #pragma once
namespace Juliet
{
using MouseID = uint8; using MouseID = uint8;
enum class MouseButton : uint8 enum class MouseButton : uint8
@@ -25,4 +23,3 @@ namespace Juliet
JULIET_API extern MousePosition GetMousePosition(); JULIET_API extern MousePosition GetMousePosition();
JULIET_API extern MousePosition GetMouseDelta(); JULIET_API extern MousePosition GetMouseDelta();
JULIET_API extern MouseButton GetMouseButtonState(); JULIET_API extern MouseButton GetMouseButtonState();
} // namespace Juliet
+1 -4
View File
@@ -1,10 +1,8 @@
#pragma once #pragma once
#include <Core/Common/CoreTypes.h> #include <Core/Common/CoreTypes.h>
#include <Juliet.h> #include <Juliet.h>
namespace Juliet
{
namespace Memory namespace Memory
{ {
Byte* OS_Reserve(size_t size); Byte* OS_Reserve(size_t size);
@@ -46,4 +44,3 @@ namespace Juliet
using EntryPointFunc = int (*)(int, wchar_t**); using EntryPointFunc = int (*)(int, wchar_t**);
JULIET_API int Bootstrap(EntryPointFunc entryPointFunc, int argc, wchar_t** argv); JULIET_API int Bootstrap(EntryPointFunc entryPointFunc, int argc, wchar_t** argv);
} // namespace Juliet
+1 -4
View File
@@ -1,9 +1,7 @@
#pragma once #pragma once
#include <Core/Common/String.h> #include <Core/Common/String.h>
namespace Juliet
{
// Fwd Declare // Fwd Declare
struct DynamicLibrary; struct DynamicLibrary;
@@ -35,4 +33,3 @@ namespace Juliet
extern JULIET_API void ReloadCode(HotReloadCode& code); extern JULIET_API void ReloadCode(HotReloadCode& code);
extern JULIET_API bool ShouldReloadCode(const HotReloadCode& code); extern JULIET_API bool ShouldReloadCode(const HotReloadCode& code);
} // namespace Juliet
+1 -4
View File
@@ -1,4 +1,4 @@
#pragma once #pragma once
#include <Core/Common/CoreTypes.h> #include <Core/Common/CoreTypes.h>
#include <Core/Common/NonNullPtr.h> #include <Core/Common/NonNullPtr.h>
@@ -7,8 +7,6 @@
struct ImGuiContext; struct ImGuiContext;
namespace Juliet
{
struct Window; struct Window;
struct GraphicsDevice; struct GraphicsDevice;
@@ -26,6 +24,5 @@ namespace Juliet
// Run internal unit tests // Run internal unit tests
JULIET_API void RunTests(); JULIET_API void RunTests();
} // namespace ImGuiService } // namespace ImGuiService
} // namespace Juliet
#endif // JULIET_ENABLE_IMGUI #endif // JULIET_ENABLE_IMGUI
+2 -2
View File
@@ -1,4 +1,4 @@
#pragma once #pragma once
#include <Core/Common/NonNullPtr.h> #include <Core/Common/NonNullPtr.h>
#include <Core/HAL/Display/Window.h> #include <Core/HAL/Display/Window.h>
@@ -6,7 +6,7 @@
#include <Juliet.h> #include <Juliet.h>
namespace Juliet::UnitTest namespace UnitTest
{ {
void TestImGui(); void TestImGui();
} }
+1 -4
View File
@@ -1,9 +1,7 @@
#pragma once #pragma once
#include <Core/Common/CoreTypes.h> #include <Core/Common/CoreTypes.h>
namespace Juliet
{
enum class JulietInit_Flags : uint8 enum class JulietInit_Flags : uint8
{ {
None = 0, None = 0,
@@ -23,4 +21,3 @@ namespace Juliet
void JulietInit(JulietInit_Flags flags); void JulietInit(JulietInit_Flags flags);
void JulietShutdown(); void JulietShutdown();
} // namespace Juliet
+1 -4
View File
@@ -1,4 +1,4 @@
#pragma once #pragma once
#include <Core/Common/CoreTypes.h> #include <Core/Common/CoreTypes.h>
#include <Core/Common/NonNullPtr.h> #include <Core/Common/NonNullPtr.h>
@@ -9,8 +9,6 @@
// TODO Juliet Containers + Allocators... // TODO Juliet Containers + Allocators...
// TODO: Juliet chrono, because it prevents me from doing #define global static // TODO: Juliet chrono, because it prevents me from doing #define global static
namespace Juliet
{
enum class LogLevel : uint8; enum class LogLevel : uint8;
enum class LogCategory : uint8; enum class LogCategory : uint8;
@@ -26,4 +24,3 @@ namespace Juliet
extern void JULIET_API LogMessage(LogCategory category, const char* fmt, ...); extern void JULIET_API LogMessage(LogCategory category, const char* fmt, ...);
extern void JULIET_API LogWarning(LogCategory category, const char* fmt, ...); extern void JULIET_API LogWarning(LogCategory category, const char* fmt, ...);
extern void JULIET_API LogError(LogCategory category, const char* fmt, ...); extern void JULIET_API LogError(LogCategory category, const char* fmt, ...);
} // namespace Juliet
+1 -4
View File
@@ -1,7 +1,5 @@
#pragma once #pragma once
namespace Juliet
{
enum class LogLevel : uint8 enum class LogLevel : uint8
{ {
Debug = 0, Debug = 0,
@@ -19,4 +17,3 @@ namespace Juliet
Tool = 4, Tool = 4,
Game = 5, Game = 5,
}; };
} // namespace Juliet
+4 -4
View File
@@ -1,4 +1,4 @@
#pragma once #pragma once
#include <Core/HAL/OS/OS.h> #include <Core/HAL/OS/OS.h>
@@ -12,12 +12,12 @@ extern int JulietMain(int, wchar_t**);
#if UNICODE #if UNICODE
int wmain(int argc, wchar_t** argv) int wmain(int argc, wchar_t** argv)
{ {
return Juliet::Bootstrap(JulietMain, argc, argv); return Bootstrap(JulietMain, argc, argv);
} }
#else #else
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
return Juliet::Bootstrap(JulietMain, argc, argv); return Bootstrap(JulietMain, argc, argv);
} }
#endif #endif
@@ -38,7 +38,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
(void)szCmdLine; (void)szCmdLine;
(void)sw; (void)sw;
return Juliet::Bootstrap(JulietMain, __argc, __wargv); return Bootstrap(JulietMain, __argc, __wargv);
} }
} }
#else #else
+1 -4
View File
@@ -1,10 +1,8 @@
#pragma once #pragma once
#include <Core/Common/CoreTypes.h> #include <Core/Common/CoreTypes.h>
#include <Juliet.h> #include <Juliet.h>
namespace Juliet
{
extern JULIET_API float RoundF(float value); extern JULIET_API float RoundF(float value);
inline int32 LRoundF(float value) inline int32 LRoundF(float value)
@@ -49,4 +47,3 @@ namespace Juliet
} }
return val; return val;
} }
} // namespace Juliet
+1 -4
View File
@@ -1,10 +1,8 @@
#pragma once #pragma once
#include <Core/Math/Vector.h> #include <Core/Math/Vector.h>
#include <math.h> #include <math.h>
namespace Juliet
{
struct Matrix struct Matrix
{ {
float m[4][4]; float m[4][4];
@@ -191,4 +189,3 @@ namespace Juliet
return out; return out;
} }
} // namespace Juliet
+1 -4
View File
@@ -1,7 +1,5 @@
#pragma once #pragma once
namespace Juliet
{
struct Rectangle struct Rectangle
{ {
int32 X; int32 X;
@@ -9,4 +7,3 @@ namespace Juliet
int32 Width; int32 Width;
int32 Height; int32 Height;
}; };
} // namespace Juliet
+1 -4
View File
@@ -1,11 +1,9 @@
#pragma once #pragma once
#include <Core/Common/CoreTypes.h> #include <Core/Common/CoreTypes.h>
#include <Juliet.h> #include <Juliet.h>
#include <math.h> #include <math.h>
namespace Juliet
{
struct Vector3 struct Vector3
{ {
float x, y, z; float x, y, z;
@@ -36,4 +34,3 @@ namespace Juliet
} }
inline float Dot(const Vector3& a, const Vector3& b) { return a.x * b.x + a.y * b.y + a.z * b.z; } inline float Dot(const Vector3& a, const Vector3& b) { return a.x * b.x + a.y * b.y + a.z * b.z; }
} // namespace Juliet
+1 -4
View File
@@ -1,10 +1,8 @@
#pragma once #pragma once
#include <Juliet.h> #include <Juliet.h>
#include <Core/Common/CoreUtils.h> #include <Core/Common/CoreUtils.h>
namespace Juliet
{
// Uninitialized allocation // Uninitialized allocation
JULIET_API void* Malloc(size_t elem_size); JULIET_API void* Malloc(size_t elem_size);
// Initialized to 0 allocation // Initialized to 0 allocation
@@ -28,4 +26,3 @@ namespace Juliet
memory = nullptr; memory = nullptr;
} }
} }
} // namespace Juliet
+1 -4
View File
@@ -1,4 +1,4 @@
#pragma once #pragma once
#include <Core/Common/CoreTypes.h> #include <Core/Common/CoreTypes.h>
#include <Core/Common/CoreUtils.h> #include <Core/Common/CoreUtils.h>
@@ -10,8 +10,6 @@
#include <Core/Memory/MemoryArenaDebug.h> #include <Core/Memory/MemoryArenaDebug.h>
#endif #endif
namespace Juliet
{
constexpr global uint64 g_Arena_Default_Reserve_Size = Megabytes(64); constexpr global uint64 g_Arena_Default_Reserve_Size = Megabytes(64);
constexpr global uint64 g_Arena_Default_Commit_Size = Kilobytes(64); constexpr global uint64 g_Arena_Default_Commit_Size = Kilobytes(64);
constexpr global uint64 k_ArenaHeaderSize = 128; constexpr global uint64 k_ArenaHeaderSize = 128;
@@ -128,4 +126,3 @@ namespace Juliet
TempArena ArenaTempBegin(NonNullPtr<Arena> arena); TempArena ArenaTempBegin(NonNullPtr<Arena> arena);
void ArenaTempEnd(TempArena temp); void ArenaTempEnd(TempArena temp);
} // namespace Juliet
@@ -1,4 +1,4 @@
#pragma once #pragma once
#include <Core/Common/CoreTypes.h> #include <Core/Common/CoreTypes.h>
#include <Core/Common/NonNullPtr.h> #include <Core/Common/NonNullPtr.h>
@@ -7,8 +7,6 @@
#if JULIET_DEBUG #if JULIET_DEBUG
namespace Juliet
{
struct Arena; struct Arena;
struct MemoryBlock; struct MemoryBlock;
@@ -47,6 +45,5 @@ namespace Juliet
JULIET_API Arena* GetDebugInfoArena(); JULIET_API Arena* GetDebugInfoArena();
} // namespace Juliet
#endif #endif
+1 -4
View File
@@ -1,11 +1,9 @@
#pragma once #pragma once
#include <Core/Common/CoreTypes.h> #include <Core/Common/CoreTypes.h>
#define ArraySize(array) (sizeof(array) / sizeof(array[0])) #define ArraySize(array) (sizeof(array) / sizeof(array[0]))
namespace Juliet
{
inline int32 MemCompare(const void* leftValue, const void* rightValue, size_t size) inline int32 MemCompare(const void* leftValue, const void* rightValue, size_t size)
{ {
auto left = static_cast<const unsigned char*>(leftValue); auto left = static_cast<const unsigned char*>(leftValue);
@@ -75,4 +73,3 @@ namespace Juliet
#define MemCopy memcpy #define MemCopy memcpy
#define MemoryZero(dst, size) MemSet(dst, 0, size) #define MemoryZero(dst, size) MemSet(dst, 0, size)
} // namespace Juliet
+1 -4
View File
@@ -1,11 +1,8 @@
#pragma once #pragma once
#include <Core/Common/CoreTypes.h> #include <Core/Common/CoreTypes.h>
namespace Juliet
{
// TODO : Do something better. // TODO : Do something better.
constexpr uint32 kLocalhost = (127 << 3) | (0 << 2) | (0 << 1) | 1; constexpr uint32 kLocalhost = (127 << 3) | (0 << 2) | (0 << 1) | 1;
constexpr uint32 kAnyIp = 0; constexpr uint32 kAnyIp = 0;
constexpr uint32 kBroadcastIp = (255 << 3) | (255 << 2) | (255 << 1) | 255; constexpr uint32 kBroadcastIp = (255 << 3) | (255 << 2) | (255 << 1) | 255;
} // namespace Juliet
@@ -1,10 +1,8 @@
#pragma once #pragma once
#include <Core/Common/CoreTypes.h> #include <Core/Common/CoreTypes.h>
#include <Core/Container/Vector.h> #include <Core/Container/Vector.h>
namespace Juliet
{
class NetworkPacket class NetworkPacket
{ {
public: public:
@@ -33,4 +31,3 @@ namespace Juliet
VectorArena<Byte, 4096> Data; VectorArena<Byte, 4096> Data;
size_t PartialSendIndex = 0; size_t PartialSendIndex = 0;
}; };
} // namespace Juliet
+1 -4
View File
@@ -1,9 +1,7 @@
#pragma once #pragma once
#include <Core/Networking/SocketHandle.h> #include <Core/Networking/SocketHandle.h>
namespace Juliet
{
class Socket class Socket
{ {
public: public:
@@ -53,4 +51,3 @@ namespace Juliet
SocketHandle Handle; SocketHandle Handle;
Protocol ProtocolType; Protocol ProtocolType;
}; };
} // namespace Juliet
@@ -1,14 +1,11 @@
#pragma once #pragma once
#if JULIET_WIN32 #if JULIET_WIN32
#include <basetsd.h> #include <basetsd.h>
#endif #endif
namespace Juliet
{
#if JULIET_WIN32 #if JULIET_WIN32
using SocketHandle = UINT_PTR; using SocketHandle = UINT_PTR;
#else #else
using SocketHandle = int; using SocketHandle = int;
#endif #endif
} // namespace Juliet
+1 -4
View File
@@ -1,11 +1,9 @@
#pragma once #pragma once
#include <Core/Networking/IPAddress.h> #include <Core/Networking/IPAddress.h>
#include <Core/Networking/Socket.h> #include <Core/Networking/Socket.h>
#include <Core/Networking/TcpSocket.h> #include <Core/Networking/TcpSocket.h>
namespace Juliet
{
class TcpListener : public Socket class TcpListener : public Socket
{ {
public: public:
@@ -18,4 +16,3 @@ namespace Juliet
Status Accept(TcpSocket& socket); Status Accept(TcpSocket& socket);
void Close(); void Close();
}; };
} // namespace Juliet
+1 -4
View File
@@ -1,9 +1,7 @@
#pragma once #pragma once
#include <Core/Networking/Socket.h> #include <Core/Networking/Socket.h>
namespace Juliet
{
class NetworkPacket; class NetworkPacket;
class TcpSocket : public Socket class TcpSocket : public Socket
@@ -21,4 +19,3 @@ namespace Juliet
private: private:
friend class TcpListener; friend class TcpListener;
}; };
} // namespace Juliet
+1 -1
View File
@@ -1,4 +1,4 @@
#pragma once #pragma once
#include <algorithm> #include <algorithm>
#include <bit> #include <bit>
+1 -4
View File
@@ -1,7 +1,4 @@
#pragma once #pragma once
namespace Juliet
{
using Mutex = std::mutex; using Mutex = std::mutex;
using LockGuard = std::lock_guard<Mutex>; using LockGuard = std::lock_guard<Mutex>;
} // namespace Juliet
+1 -4
View File
@@ -1,9 +1,7 @@
#pragma once #pragma once
#include <Core/Common/String.h> #include <Core/Common/String.h>
namespace Juliet
{
uint32 thread_id(); uint32 thread_id();
void set_thread_name(String name); void set_thread_name(String name);
@@ -16,4 +14,3 @@ namespace Juliet
{ {
} }
} }
} // namespace Juliet
+1 -4
View File
@@ -1,10 +1,8 @@
#pragma once #pragma once
#include <Core/Common/CoreTypes.h> #include <Core/Common/CoreTypes.h>
#include <Core/Memory/MemoryArena.h> #include <Core/Memory/MemoryArena.h>
namespace Juliet
{
struct thread_context struct thread_context
{ {
Arena* ScratchArenas[2]; Arena* ScratchArenas[2];
@@ -21,4 +19,3 @@ namespace Juliet
Arena* thread_context_get_scratch(Arena** conflicts, size_t count); Arena* thread_context_get_scratch(Arena** conflicts, size_t count);
TempArena scratch_begin(Arena** conflicts, size_t count); TempArena scratch_begin(Arena** conflicts, size_t count);
void scratch_end(TempArena scratch); void scratch_end(TempArena scratch);
} // namespace Juliet
+1 -4
View File
@@ -1,9 +1,6 @@
#pragma once #pragma once
#include <Core/Common/String.h> #include <Core/Common/String.h>
#include <Graphics/MeshRenderer.h> #include <Graphics/MeshRenderer.h>
namespace Juliet
{
JULIET_API extern MeshAssetID LoadMesh(String filename); JULIET_API extern MeshAssetID LoadMesh(String filename);
}
+1 -4
View File
@@ -1,10 +1,8 @@
#pragma once #pragma once
#include <Core/Common/CRC32.h> #include <Core/Common/CRC32.h>
#include <Juliet.h> #include <Juliet.h>
namespace Juliet
{
struct Class struct Class
{ {
uint32 CRC; uint32 CRC;
@@ -30,4 +28,3 @@ namespace Juliet
{ {
return cls.CRC == type::StaticClass->CRC; return cls.CRC == type::StaticClass->CRC;
} }
} // namespace Juliet
+3 -3
View File
@@ -1,12 +1,12 @@
#pragma once #pragma once
#include <Juliet.h> #include <Juliet.h>
#if JULIET_DEBUG #if JULIET_DEBUG
namespace Juliet::Debug namespace Debug
{ {
JULIET_API void DebugDrawMemoryArena(); JULIET_API void DebugDrawMemoryArena();
} // namespace Juliet::Debug } // namespace Debug
#endif #endif
+1 -4
View File
@@ -1,9 +1,7 @@
#pragma once #pragma once
#include <Core/Application/IApplication.h> #include <Core/Application/IApplication.h>
namespace Juliet
{
enum class JulietInit_Flags : uint8; enum class JulietInit_Flags : uint8;
struct Engine struct Engine
@@ -22,4 +20,3 @@ namespace Juliet
void RunEngine(); void RunEngine();
extern Arena* GetPlatformArena(); extern Arena* GetPlatformArena();
} // namespace Juliet
+1 -4
View File
@@ -1,10 +1,8 @@
#pragma once #pragma once
#include <Core/Math/Matrix.h> #include <Core/Math/Matrix.h>
#include <Juliet.h> #include <Juliet.h>
namespace Juliet
{
struct Camera struct Camera
{ {
index_t Index; index_t Index;
@@ -35,4 +33,3 @@ namespace Juliet
JULIET_API extern void ReserveCamera(size_t amount); JULIET_API extern void ReserveCamera(size_t amount);
JULIET_API extern Camera* GetCurrentCamera(); JULIET_API extern Camera* GetCurrentCamera();
JULIET_API extern void SetCurrentCamera(index_t index); JULIET_API extern void SetCurrentCamera(index_t index);
} // namespace Juliet
+1 -4
View File
@@ -1,7 +1,5 @@
#pragma once #pragma once
namespace Juliet
{
template <typename Type> template <typename Type>
struct ColorType struct ColorType
{ {
@@ -13,4 +11,3 @@ namespace Juliet
using FColor = ColorType<float>; using FColor = ColorType<float>;
using Color = ColorType<uint8>; using Color = ColorType<uint8>;
} // namespace Juliet
+1 -4
View File
@@ -1,4 +1,4 @@
#pragma once #pragma once
#include <Core/Math/Vector.h> #include <Core/Math/Vector.h>
#include <Graphics/Camera.h> #include <Graphics/Camera.h>
@@ -6,12 +6,9 @@
#include <Graphics/Graphics.h> #include <Graphics/Graphics.h>
#include <Juliet.h> #include <Juliet.h>
namespace Juliet
{
extern JULIET_API void DebugDisplay_Initialize(NonNullPtr<Arena> arena, GraphicsDevice* device); extern JULIET_API void DebugDisplay_Initialize(NonNullPtr<Arena> arena, GraphicsDevice* device);
extern JULIET_API void DebugDisplay_Shutdown(GraphicsDevice* device); extern JULIET_API void DebugDisplay_Shutdown(GraphicsDevice* device);
extern JULIET_API void DebugDisplay_DrawLine(const Vector3& start, const Vector3& end, const FColor& color, bool overlay); extern JULIET_API void DebugDisplay_DrawLine(const Vector3& start, const Vector3& end, const FColor& color, bool overlay);
extern JULIET_API void DebugDisplay_DrawSphere(const Vector3& center, float radius, const FColor& color, bool overlay); extern JULIET_API void DebugDisplay_DrawSphere(const Vector3& center, float radius, const FColor& color, bool overlay);
extern JULIET_API void DebugDisplay_Prepare(CommandList* cmdList); extern JULIET_API void DebugDisplay_Prepare(CommandList* cmdList);
extern JULIET_API void DebugDisplay_Flush(CommandList* cmdList, RenderPass* renderPass, const Camera& camera); extern JULIET_API void DebugDisplay_Flush(CommandList* cmdList, RenderPass* renderPass, const Camera& camera);
} // namespace Juliet
+1 -4
View File
@@ -12,8 +12,6 @@
#include <Juliet.h> #include <Juliet.h>
// Graphics Interface // Graphics Interface
namespace Juliet
{
// Opaque types // Opaque types
struct CommandList; struct CommandList;
struct GraphicsDevice; struct GraphicsDevice;
@@ -121,7 +119,7 @@ namespace Juliet
extern JULIET_API void EndRenderPass(NonNullPtr<RenderPass> renderPass); extern JULIET_API void EndRenderPass(NonNullPtr<RenderPass> renderPass);
extern JULIET_API void SetGraphicsViewPort(NonNullPtr<RenderPass> renderPass, const GraphicsViewPort& viewPort); extern JULIET_API void SetGraphicsViewPort(NonNullPtr<RenderPass> renderPass, const GraphicsViewPort& viewPort);
extern JULIET_API void SetScissorRect(NonNullPtr<RenderPass> renderPass, const Rectangle& rectangle); extern JULIET_API void SetScissorRect(NonNullPtr<RenderPass> renderPass, const struct Rectangle& rectangle);
extern JULIET_API void SetBlendConstants(NonNullPtr<RenderPass> renderPass, FColor blendConstants); extern JULIET_API void SetBlendConstants(NonNullPtr<RenderPass> renderPass, FColor blendConstants);
extern JULIET_API void SetStencilReference(NonNullPtr<RenderPass> renderPass, uint8 reference); extern JULIET_API void SetStencilReference(NonNullPtr<RenderPass> renderPass, uint8 reference);
@@ -174,4 +172,3 @@ namespace Juliet
extern JULIET_API void DestroyGraphicsBuffer(NonNullPtr<GraphicsDevice> device, NonNullPtr<GraphicsBuffer> buffer); extern JULIET_API void DestroyGraphicsBuffer(NonNullPtr<GraphicsDevice> device, NonNullPtr<GraphicsBuffer> buffer);
extern JULIET_API void DestroyGraphicsTransferBuffer(NonNullPtr<GraphicsDevice> device, NonNullPtr<GraphicsTransferBuffer> buffer); extern JULIET_API void DestroyGraphicsTransferBuffer(NonNullPtr<GraphicsDevice> device, NonNullPtr<GraphicsTransferBuffer> buffer);
} // namespace Juliet
+1 -4
View File
@@ -1,7 +1,5 @@
#pragma once #pragma once
namespace Juliet
{
enum class BufferUsage : uint8 enum class BufferUsage : uint8
{ {
None = 0, None = 0,
@@ -33,4 +31,3 @@ namespace Juliet
// Opaque // Opaque
struct GraphicsBuffer; struct GraphicsBuffer;
struct GraphicsTransferBuffer; struct GraphicsTransferBuffer;
} // namespace Juliet
+2 -5
View File
@@ -10,9 +10,7 @@
#define ALLOW_SHADER_HOT_RELOAD 0 #define ALLOW_SHADER_HOT_RELOAD 0
#endif #endif
namespace Juliet enum class GraphicsDriverType : uint8
{
enum class DriverType : uint8
{ {
Any = 0, Any = 0,
DX12 = 1, DX12 = 1,
@@ -20,7 +18,6 @@ namespace Juliet
struct GraphicsConfig struct GraphicsConfig
{ {
DriverType PreferredDriver = DriverType::DX12; GraphicsDriverType PreferredDriver = GraphicsDriverType::DX12;
bool EnableDebug; bool EnableDebug;
}; };
} // namespace Juliet
+1 -4
View File
@@ -1,9 +1,7 @@
#pragma once #pragma once
#include <Graphics/Shader.h> #include <Graphics/Shader.h>
#include <Graphics/Texture.h> #include <Graphics/Texture.h>
namespace Juliet
{
// Forward Declare // Forward Declare
struct ColorTargetDescription; struct ColorTargetDescription;
@@ -222,4 +220,3 @@ namespace Juliet
// Opaque type // Opaque type
struct GraphicsPipeline; struct GraphicsPipeline;
} // namespace Juliet
+1 -4
View File
@@ -1,12 +1,9 @@
#pragma once #pragma once
#include <Graphics/Graphics.h> #include <Graphics/Graphics.h>
#include <Juliet.h> #include <Juliet.h>
namespace Juliet
{
extern bool ImGuiRenderer_Initialize(GraphicsDevice* device); extern bool ImGuiRenderer_Initialize(GraphicsDevice* device);
extern void ImGuiRenderer_Shutdown(GraphicsDevice* device); extern void ImGuiRenderer_Shutdown(GraphicsDevice* device);
extern void ImGuiRenderer_NewFrame(); extern void ImGuiRenderer_NewFrame();
extern JULIET_API void ImGuiRenderer_Render(CommandList* cmdList, RenderPass* renderPass); extern JULIET_API void ImGuiRenderer_Render(CommandList* cmdList, RenderPass* renderPass);
} // namespace Juliet
+1 -4
View File
@@ -1,10 +1,8 @@
#pragma once #pragma once
#include <Juliet.h> #include <Juliet.h>
#include <Core/Math/Vector.h> #include <Core/Math/Vector.h>
namespace Juliet
{
struct PointLight struct PointLight
{ {
Vector3 Position; Vector3 Position;
@@ -12,4 +10,3 @@ namespace Juliet
Vector3 Color; Vector3 Color;
float Intensity; float Intensity;
}; };
} // namespace Juliet
+1 -4
View File
@@ -1,4 +1,4 @@
#pragma once #pragma once
#include <Core/Common/CoreTypes.h> #include <Core/Common/CoreTypes.h>
#include <Core/Common/NonNullPtr.h> #include <Core/Common/NonNullPtr.h>
@@ -7,8 +7,6 @@
#include <Core/Math/Vector.h> #include <Core/Math/Vector.h>
#include <Juliet.h> #include <Juliet.h>
namespace Juliet
{
struct Arena; struct Arena;
struct Vertex; struct Vertex;
@@ -37,4 +35,3 @@ namespace Juliet
MaterialAssetID MaterialAsset; MaterialAssetID MaterialAsset;
Matrix Transform = MatrixIdentity(); Matrix Transform = MatrixIdentity();
}; };
} // namespace Juliet
+1 -4
View File
@@ -1,4 +1,4 @@
#pragma once #pragma once
#include <Core/Container/Vector.h> #include <Core/Container/Vector.h>
#include <Core/Math/Matrix.h> #include <Core/Math/Matrix.h>
@@ -9,8 +9,6 @@
#include <Graphics/Mesh.h> #include <Graphics/Mesh.h>
#include <Juliet.h> #include <Juliet.h>
namespace Juliet
{
struct GraphicsTransferBuffer; struct GraphicsTransferBuffer;
struct RenderPass; struct RenderPass;
struct CommandList; struct CommandList;
@@ -57,4 +55,3 @@ namespace Juliet
JULIET_API void ReloadMeshRendererShaders(); JULIET_API void ReloadMeshRendererShaders();
#endif #endif
} // namespace Juliet
+1 -4
View File
@@ -1,11 +1,9 @@
#pragma once #pragma once
#include <Core/Math/Matrix.h> #include <Core/Math/Matrix.h>
#include <Core/Math/Vector.h> #include <Core/Math/Vector.h>
#include <Juliet.h> #include <Juliet.h>
namespace Juliet
{
struct PushData struct PushData
{ {
Matrix ViewProjection; Matrix ViewProjection;
@@ -29,4 +27,3 @@ namespace Juliet
Vector4 MeshAlbedo; Vector4 MeshAlbedo;
}; };
} // namespace Juliet
+1 -4
View File
@@ -1,10 +1,8 @@
#pragma once #pragma once
#include <Graphics/Colors.h> #include <Graphics/Colors.h>
#include <Graphics/Texture.h> #include <Graphics/Texture.h>
namespace Juliet
{
enum struct LoadOperation : uint8 enum struct LoadOperation : uint8
{ {
Load, // Load the texture from memory (preserve) Load, // Load the texture from memory (preserve)
@@ -112,4 +110,3 @@ namespace Juliet
// Opaque Type // Opaque Type
struct RenderPass; struct RenderPass;
} // namespace Juliet
+1 -4
View File
@@ -1,9 +1,7 @@
#pragma once #pragma once
#include <Core/Common/String.h> #include <Core/Common/String.h>
namespace Juliet
{
// Opaque type // Opaque type
struct Shader; struct Shader;
@@ -20,4 +18,3 @@ namespace Juliet
String EntryPoint; String EntryPoint;
}; };
} // namespace Juliet
+1 -4
View File
@@ -1,4 +1,4 @@
#pragma once #pragma once
#include <Juliet.h> #include <Juliet.h>
@@ -6,8 +6,6 @@
#include <Core/Math/Matrix.h> #include <Core/Math/Matrix.h>
#include <Graphics/GraphicsConfig.h> #include <Graphics/GraphicsConfig.h>
namespace Juliet
{
struct RenderPass; struct RenderPass;
struct CommandList; struct CommandList;
struct Window; struct Window;
@@ -28,4 +26,3 @@ namespace Juliet
JULIET_API void ReloadSkyboxShaders(); JULIET_API void ReloadSkyboxShaders();
#endif #endif
} // namespace Juliet
+1 -4
View File
@@ -1,7 +1,5 @@
#pragma once #pragma once
namespace Juliet
{
enum struct TextureFormat : uint8 enum struct TextureFormat : uint8
{ {
Invalid, Invalid,
@@ -180,4 +178,3 @@ namespace Juliet
// Opaque Type // Opaque Type
struct Texture; struct Texture;
} // namespace Juliet
+1 -4
View File
@@ -1,7 +1,5 @@
#pragma once #pragma once
namespace Juliet
{
struct Vertex struct Vertex
{ {
float Position[3]; float Position[3];
@@ -10,4 +8,3 @@ namespace Juliet
}; };
using Index = uint16; using Index = uint16;
} // namespace Juliet
@@ -1,10 +1,8 @@
#include <Core/Application/ApplicationManager.h> #include <Core/Application/ApplicationManager.h>
#include <Core/JulietInit.h> #include <Core/JulietInit.h>
#include <Engine/Engine.h> #include <Engine/Engine.h>
namespace Juliet
{
void StartApplication(IApplication& app, JulietInit_Flags flags) void StartApplication(IApplication& app, JulietInit_Flags flags)
{ {
InitializeEngine(flags); InitializeEngine(flags);
@@ -17,4 +15,3 @@ namespace Juliet
ShutdownEngine(); ShutdownEngine();
} }
} // namespace Juliet
+1 -4
View File
@@ -1,12 +1,10 @@
#include <Core/Logging/LogManager.h> #include <Core/Logging/LogManager.h>
#include <Core/Logging/LogTypes.h> #include <Core/Logging/LogTypes.h>
#include <Core/Memory/Allocator.h> #include <Core/Memory/Allocator.h>
#include <comdef.h> // For _com_error to decode HRESULTs #include <comdef.h> // For _com_error to decode HRESULTs
#include <intrin.h> // For __debugbreak #include <intrin.h> // For __debugbreak
namespace Juliet
{
void JulietAssert(const char* expression, const char* message, std::source_location location, long handleResult) void JulietAssert(const char* expression, const char* message, std::source_location location, long handleResult)
{ {
Log(LogLevel::Error, LogCategory::Core, "--- ASSERTION FAILED ---"); Log(LogLevel::Error, LogCategory::Core, "--- ASSERTION FAILED ---");
@@ -35,4 +33,3 @@ namespace Juliet
} }
buffer = {}; buffer = {};
} }
} // namespace Juliet
+1 -4
View File
@@ -1,12 +1,10 @@
#include <Core/Common/CoreUtils.h> #include <Core/Common/CoreUtils.h>
#include <Core/Common/String.h> #include <Core/Common/String.h>
#include <Core/Logging/LogManager.h> #include <Core/Logging/LogManager.h>
#include <Core/Logging/LogTypes.h> #include <Core/Logging/LogTypes.h>
#include <Core/Memory/MemoryArena.h> #include <Core/Memory/MemoryArena.h>
#include <Core/Memory/Utils.h> #include <Core/Memory/Utils.h>
namespace Juliet
{
namespace namespace
{ {
constexpr int32 kUnknown_UNICODE = 0xFFFD; constexpr int32 kUnknown_UNICODE = 0xFFFD;
@@ -625,4 +623,3 @@ namespace Juliet
return result; return result;
} }
} // namespace Juliet
+1 -4
View File
@@ -1,5 +1,2 @@
#include <Core/Container/Vector.h> #include <Core/Container/Vector.h>
namespace Juliet
{
}
+1 -4
View File
@@ -1,11 +1,9 @@
#include <Core/Common/CoreTypes.h> #include <Core/Common/CoreTypes.h>
#include <Core/HAL/Display/Display_cpp.h> #include <Core/HAL/Display/Display_cpp.h>
#include <Core/HAL/Display/DisplayDevice.h> #include <Core/HAL/Display/DisplayDevice.h>
#include <Core/Memory/Allocator.h> #include <Core/Memory/Allocator.h>
#include <Core/Memory/MemoryArena.h> #include <Core/Memory/MemoryArena.h>
namespace Juliet
{
namespace namespace
{ {
DisplayDevice* g_CurrentDisplayDevice = nullptr; DisplayDevice* g_CurrentDisplayDevice = nullptr;
@@ -159,4 +157,3 @@ namespace Juliet
{ {
return g_CurrentDisplayDevice; return g_CurrentDisplayDevice;
} }
} // namespace Juliet
+1 -4
View File
@@ -1,11 +1,9 @@
#pragma once #pragma once
#include <Core/Common/NonNullPtr.h> #include <Core/Common/NonNullPtr.h>
#include <Core/Container/Vector.h> #include <Core/Container/Vector.h>
#include <Core/HAL/Display/Window.h> #include <Core/HAL/Display/Window.h>
namespace Juliet
{
// Driver to the display device. // Driver to the display device.
// Functions ptr will be set by the chosen factory // Functions ptr will be set by the chosen factory
// Acts as a singleton after Initialize has been called and is freed in Shutdown. // Acts as a singleton after Initialize has been called and is freed in Shutdown.
@@ -44,4 +42,3 @@ namespace Juliet
// Utils // Utils
extern DisplayDevice* GetDisplayDevice(); extern DisplayDevice* GetDisplayDevice();
} // namespace Juliet
+1 -4
View File
@@ -1,7 +1,4 @@
#pragma once #pragma once
namespace Juliet
{
void InitializeDisplaySystem(); void InitializeDisplaySystem();
void ShutdownDisplaySystem(); void ShutdownDisplaySystem();
} // namespace Juliet
@@ -1,8 +1,8 @@
#include <Core/HAL/Display/DisplayDevice.h> #include <Core/HAL/Display/DisplayDevice.h>
#include <Core/HAL/Display/Win32/Win32DisplayEvent.h> #include <Core/HAL/Display/Win32/Win32DisplayEvent.h>
#include <Core/HAL/Display/Win32/Win32Window.h> #include <Core/HAL/Display/Win32/Win32Window.h>
namespace Juliet::Win32 namespace Win32
{ {
namespace namespace
{ {
@@ -43,10 +43,7 @@ namespace Juliet::Win32
} }
} // namespace } // namespace
} // namespace Juliet::Win32 } // namespace Win32
// Factory cannot be in an anonymous/unknown namespace // Factory cannot be in an anonymous/unknown namespace
namespace Juliet
{
DisplayDeviceFactory Win32DisplayDeviceFactory = { .Name = "Win32", .CreateDevice = Win32::CreateDevice }; DisplayDeviceFactory Win32DisplayDeviceFactory = { .Name = "Win32", .CreateDevice = Win32::CreateDevice };
}
@@ -1,4 +1,4 @@
#include <Core/Common/EnumUtils.h> #include <Core/Common/EnumUtils.h>
#include <Core/HAL/Display/DisplayDevice.h> #include <Core/HAL/Display/DisplayDevice.h>
#include <Core/HAL/Display/Win32/Win32DisplayEvent.h> #include <Core/HAL/Display/Win32/Win32DisplayEvent.h>
#include <Core/HAL/Display/Win32/Win32Window.h> #include <Core/HAL/Display/Win32/Win32Window.h>
@@ -20,7 +20,7 @@
extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
#endif #endif
namespace Juliet::Win32 namespace Win32
{ {
namespace namespace
{ {
@@ -276,4 +276,4 @@ namespace Juliet::Win32
return CallWindowProcA(DefWindowProcA, handle, message, wParam, lParam); return CallWindowProcA(DefWindowProcA, handle, message, wParam, lParam);
} }
} // namespace Juliet::Win32 } // namespace Win32
@@ -1,15 +1,12 @@
#pragma once #pragma once
#include <Core/Common/NonNullPtr.h> #include <Core/Common/NonNullPtr.h>
#include <Core/HAL/Win32.h> #include <Core/HAL/Win32.h>
namespace Juliet
{
struct DisplayDevice; struct DisplayDevice;
}
namespace Juliet::Win32 namespace Win32
{ {
extern void PumpEvents(NonNullPtr<DisplayDevice> self); extern void PumpEvents(NonNullPtr<DisplayDevice> self);
extern LRESULT CALLBACK Win32MainWindowCallback(HWND Handle, UINT Message, WPARAM WParam, LPARAM LParam); extern LRESULT CALLBACK Win32MainWindowCallback(HWND Handle, UINT Message, WPARAM WParam, LPARAM LParam);
} // namespace Juliet::Win32 } // namespace Win32
@@ -1,10 +1,10 @@
#include <Core/HAL/Display/Win32/Win32DisplayEvent.h> #include <Core/HAL/Display/Win32/Win32DisplayEvent.h>
#include <Core/HAL/Display/Win32/Win32Window.h> #include <Core/HAL/Display/Win32/Win32Window.h>
#include <Core/HAL/Display/Window.h> #include <Core/HAL/Display/Window.h>
#include <Core/Memory/Allocator.h> #include <Core/Memory/Allocator.h>
#include <Core/Memory/MemoryArena.h> #include <Core/Memory/MemoryArena.h>
namespace Juliet::Win32 namespace Win32
{ {
namespace namespace
{ {
@@ -101,4 +101,4 @@ namespace Juliet::Win32
auto& win32State = static_cast<Window32State&>(*window->State); auto& win32State = static_cast<Window32State&>(*window->State);
SetWindowTextA(win32State.Handle, CStr(title)); SetWindowTextA(win32State.Handle, CStr(title));
} }
} // namespace Juliet::Win32 } // namespace Win32
@@ -1,16 +1,13 @@
#pragma once #pragma once
#include <Core/Common/NonNullPtr.h> #include <Core/Common/NonNullPtr.h>
#include <Core/HAL/Display/Window.h> #include <Core/HAL/Display/Window.h>
#include <Core/HAL/Win32.h> #include <Core/HAL/Win32.h>
namespace Juliet
{
struct DisplayDevice; struct DisplayDevice;
struct Window; struct Window;
} // namespace Juliet
namespace Juliet::Win32 namespace Win32
{ {
// TODO : Evaluate if its worth the burden of casting to Window32State all the time // TODO : Evaluate if its worth the burden of casting to Window32State all the time
struct Window32State : WindowState struct Window32State : WindowState
@@ -26,4 +23,4 @@ namespace Juliet::Win32
extern void ShowWindow(NonNullPtr<DisplayDevice> self, NonNullPtr<Window> window); extern void ShowWindow(NonNullPtr<DisplayDevice> self, NonNullPtr<Window> window);
extern void HideWindow(NonNullPtr<DisplayDevice> self, NonNullPtr<Window> window); extern void HideWindow(NonNullPtr<DisplayDevice> self, NonNullPtr<Window> window);
extern void SetWindowTitle(NonNullPtr<DisplayDevice> self, NonNullPtr<Window> window, String title); extern void SetWindowTitle(NonNullPtr<DisplayDevice> self, NonNullPtr<Window> window, String title);
} // namespace Juliet::Win32 } // namespace Win32
+1 -4
View File
@@ -1,10 +1,8 @@
#pragma once #pragma once
#include <Core/Common/String.h> #include <Core/Common/String.h>
#include <Core/HAL/Display/Display.h> #include <Core/HAL/Display/Display.h>
namespace Juliet
{
struct Window; struct Window;
struct WindowState struct WindowState
{ {
@@ -21,4 +19,3 @@ namespace Juliet
int32 Height; int32 Height;
String Title; String Title;
}; };
} // namespace Juliet
@@ -1,10 +1,8 @@
#include <Core/HAL/DynLib/DynamicLibrary.h> #include <Core/HAL/DynLib/DynamicLibrary.h>
#include <Core/HAL/Win32.h> #include <Core/HAL/Win32.h>
#include <Core/Logging/LogManager.h> #include <Core/Logging/LogManager.h>
#include <Core/Logging/LogTypes.h> #include <Core/Logging/LogTypes.h>
namespace Juliet
{
DynamicLibrary* LoadDynamicLibrary(const char* filename) DynamicLibrary* LoadDynamicLibrary(const char* filename)
{ {
if (!filename) if (!filename)
@@ -41,4 +39,3 @@ namespace Juliet
{ {
FreeLibrary(reinterpret_cast<HMODULE>(lib.Get())); FreeLibrary(reinterpret_cast<HMODULE>(lib.Get()));
} }
} // namespace Juliet
+1 -4
View File
@@ -1,10 +1,8 @@
#include <Core/Common/EnumUtils.h> #include <Core/Common/EnumUtils.h>
#include <Core/HAL/Event/Keyboard_Private.h> #include <Core/HAL/Event/Keyboard_Private.h>
#include <Core/HAL/Event/KeyboardMapping.h> #include <Core/HAL/Event/KeyboardMapping.h>
#include <Core/HAL/Event/SystemEvent.h> #include <Core/HAL/Event/SystemEvent.h>
namespace Juliet
{
constexpr KeyboardID kGlobalKeyboardID = 0; constexpr KeyboardID kGlobalKeyboardID = 0;
namespace namespace
@@ -162,4 +160,3 @@ namespace Juliet
static_assert(ToUnderlying(KeyPosition::Up) == false); static_assert(ToUnderlying(KeyPosition::Up) == false);
static_assert(sizeof(ScanCode) == sizeof(uint16)); static_assert(sizeof(ScanCode) == sizeof(uint16));
static_assert(ToUnderlying(ScanCode::Count) == 512); static_assert(ToUnderlying(ScanCode::Count) == 512);
} // namespace Juliet
@@ -1,11 +1,9 @@
#include <Core/Common/CoreUtils.h> #include <Core/Common/CoreUtils.h>
#include <Core/Common/EnumUtils.h> #include <Core/Common/EnumUtils.h>
#include <Core/HAL/Event/KeyboardMapping.h> #include <Core/HAL/Event/KeyboardMapping.h>
#include <Core/HAL/Keyboard/KeyCode.h> #include <Core/HAL/Keyboard/KeyCode.h>
#include <Core/HAL/Keyboard/ScanCode.h> #include <Core/HAL/Keyboard/ScanCode.h>
namespace Juliet
{
namespace namespace
{ {
// clang-format off // clang-format off
@@ -201,4 +199,3 @@ namespace Juliet
// Handle everything else (characters that do not convert to ASCII code) // Handle everything else (characters that do not convert to ASCII code)
return GetNonPrintableKeys(scanCode); return GetNonPrintableKeys(scanCode);
} }
} // namespace Juliet
+1 -4
View File
@@ -1,10 +1,7 @@
#pragma once #pragma once
#include <Core/HAL/Keyboard/KeyCode.h> #include <Core/HAL/Keyboard/KeyCode.h>
#include <Core/HAL/Keyboard/ScanCode.h> #include <Core/HAL/Keyboard/ScanCode.h>
namespace Juliet
{
// Transforms ScanCode into KeyCode using the default US ASCII Mapping // Transforms ScanCode into KeyCode using the default US ASCII Mapping
extern KeyCode GetKeyCodeFromDefaultMapping(ScanCode scanCode, KeyMod keyModState); extern KeyCode GetKeyCodeFromDefaultMapping(ScanCode scanCode, KeyMod keyModState);
} // namespace Juliet
+1 -4
View File
@@ -1,12 +1,9 @@
#pragma once #pragma once
#include <Core/HAL/Keyboard/Keyboard.h> #include <Core/HAL/Keyboard/Keyboard.h>
#include <Core/HAL/Keyboard/KeyCode.h> #include <Core/HAL/Keyboard/KeyCode.h>
namespace Juliet
{
extern bool SendKeyboardKey(uint64 timestamp, KeyboardID ID, Key key, KeyPosition keyPosition); extern bool SendKeyboardKey(uint64 timestamp, KeyboardID ID, Key key, KeyPosition keyPosition);
extern void UpdateKeyboardstate(float deltaTime); extern void UpdateKeyboardstate(float deltaTime);
extern const KeyboardID kGlobalKeyboardID; extern const KeyboardID kGlobalKeyboardID;
} // namespace Juliet
+1 -4
View File
@@ -1,11 +1,9 @@
#include <Core/Common/EnumUtils.h> #include <Core/Common/EnumUtils.h>
#include <Core/HAL/Display/Window.h> #include <Core/HAL/Display/Window.h>
#include <Core/HAL/Event/Mouse_Private.h> #include <Core/HAL/Event/Mouse_Private.h>
#include <Core/HAL/Event/SystemEvent.h> #include <Core/HAL/Event/SystemEvent.h>
#include <Core/HAL/Mouse/Mouse.h> #include <Core/HAL/Mouse/Mouse.h>
namespace Juliet
{
namespace namespace
{ {
Mouse MouseState; Mouse MouseState;
@@ -155,4 +153,3 @@ namespace Juliet
mouseState.DeltaY = 0.0f; mouseState.DeltaY = 0.0f;
} }
} // namespace Juliet
+1 -4
View File
@@ -1,9 +1,7 @@
#pragma once #pragma once
#include <Core/HAL/Mouse/Mouse.h> #include <Core/HAL/Mouse/Mouse.h>
namespace Juliet
{
struct Window; struct Window;
struct Mouse struct Mouse
@@ -29,4 +27,3 @@ namespace Juliet
extern void SendMouseButton(uint64 timestamp, NonNullPtr<Window> window, MouseID mouseID, MouseButton button, bool pressed); extern void SendMouseButton(uint64 timestamp, NonNullPtr<Window> window, MouseID mouseID, MouseButton button, bool pressed);
extern const MouseID kGlobalMouseID; extern const MouseID kGlobalMouseID;
} // namespace Juliet
+1 -4
View File
@@ -1,4 +1,4 @@
#include <Core/HAL/Display/DisplayDevice.h> #include <Core/HAL/Display/DisplayDevice.h>
#include <Core/HAL/Event/SystemEvent.h> #include <Core/HAL/Event/SystemEvent.h>
#include <Core/HAL/Event/Keyboard_Private.h> #include <Core/HAL/Event/Keyboard_Private.h>
@@ -9,8 +9,6 @@
#pragma pop_macro("global") #pragma pop_macro("global")
namespace Juliet
{
namespace namespace
{ {
// TODO : make my own queue / using vector // TODO : make my own queue / using vector
@@ -97,4 +95,3 @@ namespace Juliet
UpdateMouseState(); UpdateMouseState();
} }
} // namespace Juliet
+3 -3
View File
@@ -1,8 +1,8 @@
#pragma once #pragma once
#include <Core/HAL/Keyboard/ScanCode.h> #include <Core/HAL/Keyboard/ScanCode.h>
namespace Juliet::Win32 namespace Win32
{ {
// Conversion table from Win32 scan code to HID Usage Page (see Keyboard.h) // Conversion table from Win32 scan code to HID Usage Page (see Keyboard.h)
// https://learn.microsoft.com/en-us/windows/win32/inputdev/about-keyboard-input#extended-key-flag // https://learn.microsoft.com/en-us/windows/win32/inputdev/about-keyboard-input#extended-key-flag
@@ -267,4 +267,4 @@ namespace Juliet::Win32
}; };
// clang-format on // clang-format on
} // namespace Juliet::Win32 } // namespace Win32
+1 -4
View File
@@ -1,9 +1,7 @@
#include <Core/HAL/Display/Window.h> #include <Core/HAL/Display/Window.h>
#include <Core/HAL/Event/SystemEvent.h> #include <Core/HAL/Event/SystemEvent.h>
#include <Core/HAL/Event/WindowEvent.h> #include <Core/HAL/Event/WindowEvent.h>
namespace Juliet
{
bool SendWindowEvent(Window* window, EventType type) bool SendWindowEvent(Window* window, EventType type)
{ {
Assert(window); Assert(window);
@@ -18,4 +16,3 @@ namespace Juliet
return evtPosted; return evtPosted;
} }
} // namespace Juliet
+1 -4
View File
@@ -1,9 +1,6 @@
#pragma once #pragma once
namespace Juliet
{
struct Window; struct Window;
enum class EventType : uint32; enum class EventType : uint32;
extern bool SendWindowEvent(Window* window, EventType type); extern bool SendWindowEvent(Window* window, EventType type);
} // namespace Juliet
@@ -1,4 +1,4 @@
#include <Core/Common/CoreTypes.h> #include <Core/Common/CoreTypes.h>
#include <Core/Common/CoreUtils.h> #include <Core/Common/CoreUtils.h>
#include <Core/Common/String.h> #include <Core/Common/String.h>
#include <Core/HAL/Filesystem/Filesystem.h> #include <Core/HAL/Filesystem/Filesystem.h>
@@ -9,8 +9,6 @@
#include <Core/Logging/LogTypes.h> #include <Core/Logging/LogTypes.h>
#include <Core/Memory/Allocator.h> #include <Core/Memory/Allocator.h>
namespace Juliet
{
namespace namespace
{ {
String CachedBasePath = {}; String CachedBasePath = {};
@@ -98,4 +96,3 @@ namespace Juliet
CachedAssetBasePath.Size = 0; CachedAssetBasePath.Size = 0;
CachedAssetBasePath.Str = nullptr; CachedAssetBasePath.Str = nullptr;
} }
} // namespace Juliet
@@ -1,7 +1,7 @@
#pragma once #pragma once
namespace Juliet::Platform namespace Platform
{ {
extern String GetBasePath(NonNullPtr<Arena> arena); extern String GetBasePath(NonNullPtr<Arena> arena);
extern bool IsAbsolutePath(String path); extern bool IsAbsolutePath(String path);
} // namespace Juliet::Platform } // namespace Platform
@@ -1,7 +1,4 @@
#pragma once #pragma once
namespace Juliet
{
extern void InitFilesystem(NonNullPtr<Arena> arena); extern void InitFilesystem(NonNullPtr<Arena> arena);
extern void ShutdownFilesystem(); extern void ShutdownFilesystem();
} // namespace Juliet
@@ -1,11 +1,11 @@
#include <Core/Common/String.h> #include <Core/Common/String.h>
#include <Core/HAL/Filesystem/Filesystem_Platform.h> #include <Core/HAL/Filesystem/Filesystem_Platform.h>
#include <Core/HAL/Win32.h> #include <Core/HAL/Win32.h>
#include <Core/Logging/LogManager.h> #include <Core/Logging/LogManager.h>
#include <Core/Logging/LogTypes.h> #include <Core/Logging/LogTypes.h>
#include <Core/Memory/Allocator.h> #include <Core/Memory/Allocator.h>
namespace Juliet::Platform namespace Platform
{ {
String GetBasePath(NonNullPtr<Arena> arena) String GetBasePath(NonNullPtr<Arena> arena)
{ {
@@ -91,4 +91,4 @@ namespace Juliet::Platform
return false; return false;
} }
} // namespace Juliet::Platform } // namespace Platform

Some files were not shown because too many files have changed in this diff Show More