commit 2d8cba9012d316a1206431582cf467294ae68709 Author: omigamedev Date: Tue Jan 6 22:59:23 2026 +0100 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/build diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..5b90b5b --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.22.1) +project("mosis-designer") + +set(CMAKE_CXX_STANDARD 23) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(RmlUi CONFIG REQUIRED) +find_package(glfw3 CONFIG REQUIRED) + +set(RMLUI_BACKEND "D:/vcpkg/buildtrees/rmlui/src/6.1-fbf6dfc3b5.clean/Backends") + +add_executable(mosis-designer + main.cpp + ${RMLUI_BACKEND}/RmlUi_Backend_GLFW_GL3.cpp + ${RMLUI_BACKEND}/RmlUi_Platform_GLFW.cpp + ${RMLUI_BACKEND}/RmlUi_Renderer_GL3.cpp +) +target_link_libraries(mosis-designer PUBLIC + RmlUi::RmlUi glfw +) +target_include_directories(mosis-designer PUBLIC + ${RMLUI_BACKEND} +) diff --git a/assets/LatoLatin-Bold.ttf b/assets/LatoLatin-Bold.ttf new file mode 100644 index 0000000..c598c24 Binary files /dev/null and b/assets/LatoLatin-Bold.ttf differ diff --git a/assets/LatoLatin-BoldItalic.ttf b/assets/LatoLatin-BoldItalic.ttf new file mode 100644 index 0000000..c1f225a Binary files /dev/null and b/assets/LatoLatin-BoldItalic.ttf differ diff --git a/assets/LatoLatin-Italic.ttf b/assets/LatoLatin-Italic.ttf new file mode 100644 index 0000000..c61fc07 Binary files /dev/null and b/assets/LatoLatin-Italic.ttf differ diff --git a/assets/LatoLatin-Regular.ttf b/assets/LatoLatin-Regular.ttf new file mode 100644 index 0000000..bcc5778 Binary files /dev/null and b/assets/LatoLatin-Regular.ttf differ diff --git a/assets/demo.rml b/assets/demo.rml new file mode 100644 index 0000000..5af0f3e --- /dev/null +++ b/assets/demo.rml @@ -0,0 +1,28 @@ + + + + Fullscreen Mobile UI + + +
+ 22:47 +
+ 📶 + 🔋 +
+
+ +
+
+

Activity

+

Monday, January 5

+
+
+ + + +
\ No newline at end of file diff --git a/assets/phone.rcss b/assets/phone.rcss new file mode 100644 index 0000000..007f4f0 --- /dev/null +++ b/assets/phone.rcss @@ -0,0 +1,101 @@ +/* Ensure the body fills the entire window */ +body { + font-family: LatoLatin; + width: 100%; + height: 100%; + margin: 0; + padding: 0; + background: #0f0f12; + color: white; +} + +/* Status Bar pinned to top */ +#status-bar { + display: block; + height: 40px; + padding: 10px 20px 0; + background-color: rgba(0, 0, 0, 0.2); +} + +.time { + float: left; + font-weight: bold; + font-size: 1.1em; +} + +.status-icons { + float: right; +} + +.icon { + margin-left: 10px; +} + +/* Content area grows to fill space */ +#content { + padding: 20px; + /* Leaves room for status and nav bars */ + height: 80%; + align: center; +} + +.header-section { + margin-bottom: 30px; + text-align: center; +} + +h1 { + font-size: 2.5em; + font-weight: bold; +} + +/* Mobile-style cards */ +.card { + background: #1e1e24; + border-radius: 20px; + padding: 20px; + margin-bottom: 15px; + border: 1px solid #333; +} + +.card-title { + font-size: 1.2em; + margin-bottom: 10px; + color: #3498db; +} + +.progress-bar { + height: 8px; + background: #333; + border-radius: 4px; + margin: 10px 0; +} + +.progress-fill { + width: 84%; + height: 100%; + background: #3498db; + border-radius: 4px; +} + +/* Navigation Bar pinned to bottom */ +#nav-bar { + position: absolute; + bottom: 0; + width: 100%; + height: 65px; + background-color: #16161a; + display: flex; + justify-content: space-around; + align-items: center; + border-top: 1px solid #333; +} + +.nav-item { + font-size: 1.9em; + color: #888; +} + +.nav-item:hover { + color: #3498db; +} \ No newline at end of file diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..77ac549 --- /dev/null +++ b/main.cpp @@ -0,0 +1,73 @@ +#include +#include +#include +#include +#include +#include +#include + +void LoadFonts() +{ + const Rml::String directory = "assets/"; + + struct FontFace { + const char* filename; + bool fallback_face; + }; + FontFace font_faces[] = { + {"LatoLatin-Regular.ttf", false}, + {"LatoLatin-Italic.ttf", false}, + {"LatoLatin-Bold.ttf", false}, + {"LatoLatin-BoldItalic.ttf", false}, + {"NotoEmoji-Regular.ttf", true}, + }; + + for (const FontFace& face : font_faces) + Rml::LoadFontFace(directory + face.filename, face.fallback_face); +} + +int main() +{ + const int window_width = 1024; + const int window_height = 768; + + if (!Backend::Initialize("Load Document Sample", window_width, window_height, true)) + { + return -1; + } + + Rml::SetSystemInterface(Backend::GetSystemInterface()); + Rml::SetRenderInterface(Backend::GetRenderInterface()); + Rml::Initialise(); + + Rml::Context* context = Rml::CreateContext("main", Rml::Vector2i(window_width, window_height)); + if (!context) + { + Rml::Shutdown(); + Backend::Shutdown(); + return -1; + } + + LoadFonts(); + + if (Rml::ElementDocument* document = context->LoadDocument("assets/demo.rml")) + { + document->Show(); + } + + bool running = true; + while (running) + { + // Handle input and window events. + running = Backend::ProcessEvents(context); + context->Update(); + Backend::BeginFrame(); + context->Render(); + Backend::PresentFrame(); + } + + Rml::Shutdown(); + Backend::Shutdown(); + + return EXIT_SUCCESS; +} diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 0000000..2b1e4f7 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "mosis-designer", + "version-string": "0.1.0", + "dependencies": [ + "rmlui", + "glfw3" + ] +} \ No newline at end of file