intermediate commit
parent
e1f5b0fa0f
commit
0f15059ab5
|
@ -19,9 +19,9 @@ include(CheckCXXCompilerFlag)
|
||||||
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
||||||
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
|
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
|
||||||
if(COMPILER_SUPPORTS_CXX11)
|
if(COMPILER_SUPPORTS_CXX11)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC")
|
||||||
elseif(COMPILER_SUPPORTS_CXX0X)
|
elseif(COMPILER_SUPPORTS_CXX0X)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -fPIC")
|
||||||
else()
|
else()
|
||||||
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
|
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
|
||||||
endif()
|
endif()
|
||||||
|
@ -29,6 +29,9 @@ endif()
|
||||||
# enable strings in GDB
|
# enable strings in GDB
|
||||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_DEBUG")
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_DEBUG")
|
||||||
|
|
||||||
|
message(STATUS "Using compiler flags ${CMAKE_CXX_FLAGS}")
|
||||||
|
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES (
|
INCLUDE_DIRECTORIES (
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
@ -49,7 +52,7 @@ INCLUDE_DIRECTORIES (
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/src
|
${CMAKE_CURRENT_BINARY_DIR}/src
|
||||||
|
|
||||||
3rdparty/imgui
|
3rdparty/imgui
|
||||||
3rdparty/imgui/examples/opengl3_example
|
3rdparty/imgui/examples/
|
||||||
3rdparty/imgui/examples/libs/gl3w
|
3rdparty/imgui/examples/libs/gl3w
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -71,9 +74,11 @@ SET ( protot_SRCS
|
||||||
|
|
||||||
3rdparty/imgui/imgui.cpp
|
3rdparty/imgui/imgui.cpp
|
||||||
3rdparty/imgui/imgui_draw.cpp
|
3rdparty/imgui/imgui_draw.cpp
|
||||||
|
3rdparty/imgui/imgui_widgets.cpp
|
||||||
3rdparty/imgui/imgui_demo.cpp
|
3rdparty/imgui/imgui_demo.cpp
|
||||||
3rdparty/imgui/examples/libs/gl3w/GL/gl3w.c
|
3rdparty/imgui/examples/libs/gl3w/GL/gl3w.c
|
||||||
3rdparty/imgui/examples/opengl3_example/imgui_impl_glfw_gl3.cpp
|
3rdparty/imgui/examples/imgui_impl_glfw.cpp
|
||||||
|
3rdparty/imgui/examples/imgui_impl_opengl3.cpp
|
||||||
|
|
||||||
3rdparty/imgui_dock_lumix/imgui_dock.cpp
|
3rdparty/imgui_dock_lumix/imgui_dock.cpp
|
||||||
)
|
)
|
||||||
|
|
16
src/main.cc
16
src/main.cc
|
@ -16,7 +16,8 @@
|
||||||
#include "RuntimeModuleManager.h"
|
#include "RuntimeModuleManager.h"
|
||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
#include "imgui_dock.h"
|
#include "imgui_dock.h"
|
||||||
#include "imgui_impl_glfw_gl3.h"
|
#include "imgui_impl_glfw.h"
|
||||||
|
#include "imgui_impl_opengl3.h"
|
||||||
|
|
||||||
#include "FileModificationObserver.h"
|
#include "FileModificationObserver.h"
|
||||||
#include "Serializer.h"
|
#include "Serializer.h"
|
||||||
|
@ -109,6 +110,7 @@ int main(void)
|
||||||
glfwSetErrorCallback(error_callback);
|
glfwSetErrorCallback(error_callback);
|
||||||
glfwInit();
|
glfwInit();
|
||||||
|
|
||||||
|
const char* glsl_version = "#version 150";
|
||||||
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API);
|
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API);
|
||||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
|
||||||
|
@ -142,8 +144,8 @@ int main(void)
|
||||||
ImGuiIO& io = ImGui::GetIO(); (void)io;
|
ImGuiIO& io = ImGui::GetIO(); (void)io;
|
||||||
GuiInputState gui_input_state;
|
GuiInputState gui_input_state;
|
||||||
gGuiInputState = &gui_input_state;
|
gGuiInputState = &gui_input_state;
|
||||||
ImGui_ImplGlfwGL3_Init(gWindow, true);
|
ImGui_ImplGlfw_InitForOpenGL(gWindow, true);
|
||||||
ImGui::LoadDock();
|
ImGui_ImplOpenGL3_Init(glsl_version);
|
||||||
|
|
||||||
// FileModificationObserver
|
// FileModificationObserver
|
||||||
FileModificationObserver file_modification_observer;
|
FileModificationObserver file_modification_observer;
|
||||||
|
@ -185,7 +187,8 @@ int main(void)
|
||||||
glViewport(0, 0, width, height);
|
glViewport(0, 0, width, height);
|
||||||
|
|
||||||
glfwPollEvents();
|
glfwPollEvents();
|
||||||
ImGui_ImplGlfwGL3_NewFrame();
|
ImGui_ImplOpenGL3_NewFrame();
|
||||||
|
ImGui_ImplGlfw_NewFrame();
|
||||||
|
|
||||||
if (module_manager.CheckModulesChanged()) {
|
if (module_manager.CheckModulesChanged()) {
|
||||||
gLog("Detected module update at frame %d. Unloading all modules.", frame_counter);
|
gLog("Detected module update at frame %d. Unloading all modules.", frame_counter);
|
||||||
|
@ -229,7 +232,7 @@ int main(void)
|
||||||
|
|
||||||
module_manager.Update(gTimer->mDeltaTime);
|
module_manager.Update(gTimer->mDeltaTime);
|
||||||
|
|
||||||
ImGui::Render();
|
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
|
||||||
|
|
||||||
// Send the application to sleep if we have some time left for this frame
|
// Send the application to sleep if we have some time left for this frame
|
||||||
double frame_target_time = 1.0 / module_manager.mTargetFPS;
|
double frame_target_time = 1.0 / module_manager.mTargetFPS;
|
||||||
|
@ -251,7 +254,8 @@ int main(void)
|
||||||
|
|
||||||
ImGui::ShutdownDock();
|
ImGui::ShutdownDock();
|
||||||
|
|
||||||
ImGui_ImplGlfwGL3_Shutdown();
|
ImGui_ImplOpenGL3_Shutdown();
|
||||||
|
ImGui_ImplGlfw_Shutdown();
|
||||||
ImGui::DestroyContext();
|
ImGui::DestroyContext();
|
||||||
glfwTerminate();
|
glfwTerminate();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,9 +7,8 @@
|
||||||
|
|
||||||
#include "math_types.h"
|
#include "math_types.h"
|
||||||
|
|
||||||
#include <GL/gl3w.h> // This example is using gl3w to access OpenGL functions (because it is small). You may use glew/glad/glLoadGen/etc. whatever already works for you.
|
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
#include "imgui_impl_glfw_gl3.h"
|
#include "imgui_impl_opengl3.h"
|
||||||
|
|
||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
#include "RenderUtils.h"
|
#include "RenderUtils.h"
|
||||||
|
|
Loading…
Reference in New Issue