Skip to content
Permalink
Browse files

remove glew if using imgui drawing

  • Loading branch information
TotallyNotElite committed Mar 1, 2020
1 parent d90a2bc commit 6d1d8857fc088de4c463cdd2ceb83e9745a38a02
Showing with 7 additions and 5 deletions.
  1. +4 −2 CMakeLists.txt
  2. +1 −1 src/visual/drawing.cpp
  3. +2 −2 src/visual/imgui/imgui_impl.cpp
@@ -137,7 +137,6 @@ if(EnableVisuals)
endif()
target_include_directories(cathook PRIVATE include/visual)
find_package(SDL2 REQUIRED)
find_package(GLEW REQUIRED)
if(ExternalDrawing)
add_subdirectory(external/libxoverlay)
target_link_libraries(cathook xoverlay)
@@ -147,7 +146,10 @@ if(EnableVisuals)
if (EnableGlezDrawing)
target_link_libraries(cathook glez)
endif()
target_link_libraries(cathook ${GLEW_LIBRARIES})
if (EnableGlezDrawing)
find_package(GLEW REQUIRED)
target_link_libraries(cathook ${GLEW_LIBRARIES})
endif()
endif()

configure_file(include/config.h.in ${CMAKE_SOURCE_DIR}/include/config.h @ONLY)
@@ -572,7 +572,7 @@ void InitGL()
xoverlay_draw_end();
#else
#if ENABLE_IMGUI_DRAWING
glewInit();
// glewInit();
im_renderer::init();
#elif ENABLE_GLEZ_DRAWING || ENABLE_IMGUI_DRAWING
glClearColor(1.0, 0.0, 0.0, 0.5);
@@ -1,5 +1,5 @@

#include <GL/glew.h>
//#include <GL/glew.h>
#include "visual/imgui/imgui_impl.h"
#include "visual/drawing.hpp"
#include "visual/imgui/imgui.h"
@@ -38,7 +38,7 @@ void ImGui_Impl_Render(ImDrawData *draw_data)
glPushAttrib(GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT | GL_TRANSFORM_BIT);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);
// glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);
glDisable(GL_CULL_FACE);
glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING);

0 comments on commit 6d1d885

Please sign in to comment.
You can’t perform that action at this time.