16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 16:19:19 +02:00

build 180918. imgui implementation upgraded to opengl3, opengl version requirement raised to 3.0

This commit is contained in:
tmj-fstate
2018-09-18 05:04:15 +02:00
parent 40afc461fa
commit 496a680e44
5 changed files with 20 additions and 19 deletions

View File

@@ -315,9 +315,6 @@
<ClCompile Include="ref\imgui\imgui_draw.cpp"> <ClCompile Include="ref\imgui\imgui_draw.cpp">
<Filter>Source Files\imgui</Filter> <Filter>Source Files\imgui</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="ref\imgui\examples\imgui_impl_opengl2.cpp">
<Filter>Source Files\imgui</Filter>
</ClCompile>
<ClCompile Include="ref\imgui\examples\imgui_impl_glfw.cpp"> <ClCompile Include="ref\imgui\examples\imgui_impl_glfw.cpp">
<Filter>Source Files\imgui</Filter> <Filter>Source Files\imgui</Filter>
</ClCompile> </ClCompile>
@@ -327,6 +324,12 @@
<ClCompile Include="editoruipanels.cpp"> <ClCompile Include="editoruipanels.cpp">
<Filter>Source Files\application\mode_editor</Filter> <Filter>Source Files\application\mode_editor</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="ref\imgui\examples\imgui_impl_opengl3.cpp">
<Filter>Source Files\imgui</Filter>
</ClCompile>
<ClCompile Include="ref\imgui\imgui_widgets.cpp">
<Filter>Source Files\imgui</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="Globals.h"> <ClInclude Include="Globals.h">

View File

@@ -3722,8 +3722,8 @@ opengl_renderer::Init_caps() {
+ " Vendor: " + std::string( (char *)glGetString( GL_VENDOR ) ) + " Vendor: " + std::string( (char *)glGetString( GL_VENDOR ) )
+ " OpenGL Version: " + oglversion ); + " OpenGL Version: " + oglversion );
if( !GLEW_VERSION_1_5 ) { if( !GLEW_VERSION_3_0 ) {
ErrorLog( "Requires openGL >= 1.5" ); ErrorLog( "Requires openGL >= 3.0" ); // technically 1.5 for now, but imgui wants more
return false; return false;
} }

View File

@@ -106,14 +106,11 @@
#include "openglmatrixstack.h" #include "openglmatrixstack.h"
// imgui.h comes with its own operator new which gets wrecked by dbg_new, so we temporarily disable the latter // imgui.h comes with its own operator new which gets wrecked by dbg_new, so we temporarily disable the latter
#ifdef _MSC_VER #ifdef DBG_NEW
#ifdef _DEBUG #pragma push_macro("new")
#undef new #undef new
#endif // _DEBUG
#endif
#include "imgui.h" #include "imgui.h"
#ifdef _MSC_VER #pragma pop_macro("new")
#ifdef _DEBUG #else
#define new DBG_NEW #include "imgui.h"
#endif // _DEBUG
#endif #endif

View File

@@ -14,7 +14,7 @@ http://mozilla.org/MPL/2.0/.
#include "renderer.h" #include "renderer.h"
#include "imgui_impl_glfw.h" #include "imgui_impl_glfw.h"
#include "imgui_impl_opengl2.h" #include "imgui_impl_opengl3.h"
extern "C" extern "C"
{ {
@@ -74,7 +74,8 @@ ui_layer::init( GLFWwindow *Window ) {
// m_imguiio->Fonts->AddFontFromFileTTF( "c:/windows/fonts/lucon.ttf", 13.0f ); // m_imguiio->Fonts->AddFontFromFileTTF( "c:/windows/fonts/lucon.ttf", 13.0f );
ImGui_ImplGlfw_InitForOpenGL( m_window, false ); ImGui_ImplGlfw_InitForOpenGL( m_window, false );
ImGui_ImplOpenGL2_Init(); // ImGui_ImplOpenGL3_Init( "#version 140" );
ImGui_ImplOpenGL3_Init();
init_colors(); init_colors();
@@ -118,7 +119,7 @@ ui_layer::init_colors() {
void void
ui_layer::shutdown() { ui_layer::shutdown() {
ImGui_ImplOpenGL2_Shutdown(); ImGui_ImplOpenGL3_Shutdown();
ImGui_ImplGlfw_Shutdown(); ImGui_ImplGlfw_Shutdown();
ImGui::DestroyContext(); ImGui::DestroyContext();
} }
@@ -188,7 +189,7 @@ ui_layer::render() {
::glClientActiveTexture( m_textureunit ); ::glClientActiveTexture( m_textureunit );
::glBindBuffer( GL_ARRAY_BUFFER, 0 ); ::glBindBuffer( GL_ARRAY_BUFFER, 0 );
ImGui_ImplOpenGL2_NewFrame(); ImGui_ImplOpenGL3_NewFrame();
ImGui_ImplGlfw_NewFrame(); ImGui_ImplGlfw_NewFrame();
ImGui::NewFrame(); ImGui::NewFrame();
@@ -198,7 +199,7 @@ ui_layer::render() {
render_(); render_();
ImGui::Render(); ImGui::Render();
ImGui_ImplOpenGL2_RenderDrawData( ImGui::GetDrawData() ); ImGui_ImplOpenGL3_RenderDrawData( ImGui::GetDrawData() );
::glPopClientAttrib(); ::glPopClientAttrib();
} }

View File

@@ -1,5 +1,5 @@
#pragma once #pragma once
#define VERSION_MAJOR 18 #define VERSION_MAJOR 18
#define VERSION_MINOR 911 #define VERSION_MINOR 918
#define VERSION_REVISION 0 #define VERSION_REVISION 0