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">
<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">

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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();
}

View File

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