mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
build 180918. imgui implementation upgraded to opengl3, opengl version requirement raised to 3.0
This commit is contained in:
@@ -315,9 +315,6 @@
|
||||
<ClCompile Include="ref\imgui\imgui_draw.cpp">
|
||||
<Filter>Source Files\imgui</Filter>
|
||||
</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">
|
||||
<Filter>Source Files\imgui</Filter>
|
||||
</ClCompile>
|
||||
@@ -327,6 +324,12 @@
|
||||
<ClCompile Include="editoruipanels.cpp">
|
||||
<Filter>Source Files\application\mode_editor</Filter>
|
||||
</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>
|
||||
<ClInclude Include="Globals.h">
|
||||
|
||||
@@ -3722,8 +3722,8 @@ opengl_renderer::Init_caps() {
|
||||
+ " Vendor: " + std::string( (char *)glGetString( GL_VENDOR ) )
|
||||
+ " OpenGL Version: " + oglversion );
|
||||
|
||||
if( !GLEW_VERSION_1_5 ) {
|
||||
ErrorLog( "Requires openGL >= 1.5" );
|
||||
if( !GLEW_VERSION_3_0 ) {
|
||||
ErrorLog( "Requires openGL >= 3.0" ); // technically 1.5 for now, but imgui wants more
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
13
stdafx.h
13
stdafx.h
@@ -106,14 +106,11 @@
|
||||
#include "openglmatrixstack.h"
|
||||
|
||||
// imgui.h comes with its own operator new which gets wrecked by dbg_new, so we temporarily disable the latter
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _DEBUG
|
||||
#ifdef DBG_NEW
|
||||
#pragma push_macro("new")
|
||||
#undef new
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
#include "imgui.h"
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _DEBUG
|
||||
#define new DBG_NEW
|
||||
#endif // _DEBUG
|
||||
#pragma pop_macro("new")
|
||||
#else
|
||||
#include "imgui.h"
|
||||
#endif
|
||||
|
||||
11
uilayer.cpp
11
uilayer.cpp
@@ -14,7 +14,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "renderer.h"
|
||||
|
||||
#include "imgui_impl_glfw.h"
|
||||
#include "imgui_impl_opengl2.h"
|
||||
#include "imgui_impl_opengl3.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
@@ -74,7 +74,8 @@ ui_layer::init( GLFWwindow *Window ) {
|
||||
// m_imguiio->Fonts->AddFontFromFileTTF( "c:/windows/fonts/lucon.ttf", 13.0f );
|
||||
|
||||
ImGui_ImplGlfw_InitForOpenGL( m_window, false );
|
||||
ImGui_ImplOpenGL2_Init();
|
||||
// ImGui_ImplOpenGL3_Init( "#version 140" );
|
||||
ImGui_ImplOpenGL3_Init();
|
||||
|
||||
init_colors();
|
||||
|
||||
@@ -118,7 +119,7 @@ ui_layer::init_colors() {
|
||||
void
|
||||
ui_layer::shutdown() {
|
||||
|
||||
ImGui_ImplOpenGL2_Shutdown();
|
||||
ImGui_ImplOpenGL3_Shutdown();
|
||||
ImGui_ImplGlfw_Shutdown();
|
||||
ImGui::DestroyContext();
|
||||
}
|
||||
@@ -188,7 +189,7 @@ ui_layer::render() {
|
||||
::glClientActiveTexture( m_textureunit );
|
||||
::glBindBuffer( GL_ARRAY_BUFFER, 0 );
|
||||
|
||||
ImGui_ImplOpenGL2_NewFrame();
|
||||
ImGui_ImplOpenGL3_NewFrame();
|
||||
ImGui_ImplGlfw_NewFrame();
|
||||
ImGui::NewFrame();
|
||||
|
||||
@@ -198,7 +199,7 @@ ui_layer::render() {
|
||||
render_();
|
||||
|
||||
ImGui::Render();
|
||||
ImGui_ImplOpenGL2_RenderDrawData( ImGui::GetDrawData() );
|
||||
ImGui_ImplOpenGL3_RenderDrawData( ImGui::GetDrawData() );
|
||||
|
||||
::glPopClientAttrib();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user