Skip to content

Commit 602d99a

Browse files
committed
Not building glfw if we are in the NullRenderer.
1 parent 1ba341f commit 602d99a

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

BrotBoxEngine/BBE/glfwWrapper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,7 @@ namespace bbe
2929
void glfwDestroyWindow(GLFWwindow* handle);
3030
void glfwTerminate(void);
3131
void glfwGetWindowPos(GLFWwindow* handle, int* xpos, int* ypos);
32+
const char* glfwGetClipboardString(GLFWwindow* handle);
33+
void glfwSetClipboardString(GLFWwindow* handle, const char* string);
3234
}
3335
}

BrotBoxEngine/Game.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,11 @@ void bbe::Game::setFixedFrametime(float time)
351351

352352
bbe::String bbe::Game::getClipboard() const
353353
{
354-
return bbe::String(glfwGetClipboardString(m_pwindow->m_pwindow));
354+
return bbe::String(glfwWrapper::glfwGetClipboardString(m_pwindow->m_pwindow));
355355
}
356356

357357
void bbe::Game::setClipboard(const bbe::String& string)
358358
{
359-
glfwSetClipboardString(m_pwindow->m_pwindow, string.getRaw());
359+
glfwWrapper::glfwSetClipboardString(m_pwindow->m_pwindow, string.getRaw());
360360
}
361361

BrotBoxEngine/glfwWrapper.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,19 @@ void bbe::glfwWrapper::glfwGetWindowPos(GLFWwindow* handle, int* xpos, int* ypos
150150
::glfwGetWindowPos(handle, xpos, ypos);
151151
#endif
152152
}
153+
154+
const char* bbe::glfwWrapper::glfwGetClipboardString(GLFWwindow* handle)
155+
{
156+
#ifndef BBE_RENDERER_NULL
157+
return ::glfwGetClipboardString(handle);
158+
#else
159+
return "";
160+
#endif
161+
}
162+
163+
void bbe::glfwWrapper::glfwSetClipboardString(GLFWwindow* handle, const char* string)
164+
{
165+
#ifndef BBE_RENDERER_NULL
166+
::glfwSetClipboardString(handle, string);
167+
#endif
168+
}

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,11 @@ target_sources(BrotBoxEngine PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Third-Party/img
107107

108108
if(EMSCRIPTEN)
109109
else()
110-
add_subdirectory(Third-Party/glfw-3.3.2)
111110
include_directories(Third-Party/glfw-3.3.2/include)
112-
target_link_libraries(BrotBoxEngine glfw ${GLFW_LIBRARIES})
111+
if(NOT BBE_RENDER_MODE STREQUAL "NullRenderer")
112+
add_subdirectory(Third-Party/glfw-3.3.2)
113+
target_link_libraries(BrotBoxEngine glfw ${GLFW_LIBRARIES})
114+
endif()
113115
endif()
114116

115117
target_sources(BrotBoxEngine PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Third-Party/imgui-master/imgui.cpp)

0 commit comments

Comments
 (0)