From 082507558727bc977dc0531fc57617fa284e5e9e Mon Sep 17 00:00:00 2001 From: brige Date: Mon, 6 Jan 2025 14:45:14 +0800 Subject: [PATCH] modify hunam render to translate --- src/CMakeLists.txt | 6 +++--- src/Ipc/IpcMoudle.h | 2 +- src/Ipc/ZmqMoudle.cpp | 3 ++- src/Ipc/ZmqMoudle.h | 3 ++- src/Main.cpp | 13 ++++++++++--- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 85f610f..57d8d97 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -25,7 +25,7 @@ INCLUDE_DIRECTORIES( ${Thirdparty} ${Thirdparty}/spdlog/include ${Thirdparty}/libipc/include - ${Thirdparty}/zeromq/include + #${Thirdparty}/zeromq/include ) link_directories( @@ -33,7 +33,7 @@ link_directories( ${Thirdparty}/glew/lib ${Thirdparty}/spdlog/lib ${Thirdparty}/libipc/lib - ${Thirdparty}/zeromq/debug/lib + #${Thirdparty}/zeromq/debug/lib ) # IF(CMAKE_SIZEOF_VOID_P EQUAL 8) @@ -72,7 +72,7 @@ target_link_libraries( glfw3 debug spdlogd optimized spdlog - libzmq-mt-gd-4_3_5 + #libzmq-mt-gd-4_3_5 ) diff --git a/src/Ipc/IpcMoudle.h b/src/Ipc/IpcMoudle.h index 78569a7..0ae469f 100644 --- a/src/Ipc/IpcMoudle.h +++ b/src/Ipc/IpcMoudle.h @@ -26,6 +26,6 @@ public: private: std::chrono::time_point lastHeartbeatTime_; - std::unique_ptr zmqMoudle_; + //std::unique_ptr zmqMoudle_; }; diff --git a/src/Ipc/ZmqMoudle.cpp b/src/Ipc/ZmqMoudle.cpp index 15949cc..1a91528 100644 --- a/src/Ipc/ZmqMoudle.cpp +++ b/src/Ipc/ZmqMoudle.cpp @@ -2,7 +2,7 @@ #include #include - +#if 0 #include ZmqMoudle::ZmqMoudle(ZmqMoudleCallback callback) @@ -58,3 +58,4 @@ work_->join(); } } +#endif diff --git a/src/Ipc/ZmqMoudle.h b/src/Ipc/ZmqMoudle.h index 8c0db28..1e17e8c 100644 --- a/src/Ipc/ZmqMoudle.h +++ b/src/Ipc/ZmqMoudle.h @@ -4,7 +4,7 @@ #include #include #include - +#if 0 using ZmqMoudleCallback = std::function; class ZmqMoudle { public: @@ -19,3 +19,4 @@ private: void* context_{ nullptr }; std::atomic shouldExit_; }; +#endif diff --git a/src/Main.cpp b/src/Main.cpp index ed1a1cd..08f640c 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -40,8 +40,8 @@ static int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevI glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE); } - glfwWindowHint(GLFW_RESIZABLE, true); - glfwWindowHint(GLFW_DECORATED, true); + //glfwWindowHint(GLFW_RESIZABLE, true); + //glfwWindowHint(GLFW_DECORATED, true); glfwWindowHint(GLFW_FOCUSED, true); glfwWindowHint(GLFW_MAXIMIZED, false); glfwWindowHint(GLFW_FLOATING, false); @@ -49,6 +49,11 @@ static int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevI glfwWindowHint(GLFW_AUTO_ICONIFY, true); //glfwWindowHint(GLFW_REFRESH_RATE, settings.refreshRate); glfwWindowHint(GLFW_SAMPLES, 4); + glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE); + glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); + glfwWindowHint(GLFW_DECORATED, GL_FALSE); + + //glfwWindowHint(GLFW_MOVABLE, GL_TRUE); GLFWwindow* window = glfwCreateWindow(860, 540, "humanRender", nullptr, nullptr); if (!window) { @@ -57,6 +62,8 @@ static int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevI return false; } + glfwSetWindowPos(window, 300, 600); + glfwSetWindowAttrib(window, GLFW_FLOATING, GLFW_TRUE); glfwSetKeyCallback(window, [](GLFWwindow* window, int key, int scancode, int action, int mods) { if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) glfwSetWindowShouldClose(window, GLFW_TRUE); @@ -121,7 +128,7 @@ static int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevI Texture2D background; int width, height, nrChannels; // The FileSystem::getPath(...) is part of the GitHub repository so we can find files on any IDE/platform; replace it with your own image path. - unsigned char* data = stbi_load("./data/background/background.jpg", &width, &height, &nrChannels, 0); + unsigned char* data = stbi_load("./data/background/background.png", &width, &height, &nrChannels, 0); if (data) { background.Create(width, height, nrChannels, nullptr); background.Update(width, height, nrChannels, data);