_=Gigant=_
Well-known member
- Joined
- Mar 21, 2017
- Messages
- 353
- Reaction score
- 16
// ImGui Rendering in s0beit tutorial
1. add files down below into your sobeit
- imconig.h
- imgui.cpp
- imgui.h
- imgui_demo.cpp
- imgui_draw.cpp
- imgui_impl_dx9.cpp
- imgui_impl_dx9.h
- imgui_impl_win32.cpp
- imgui_impl_win32.h
- imgui_internal.h
- imgui_widgets.cpp
- imstb_rectpack.h
- imstb_textedit.h
- imstb_truetype.h
you can download them from here http://www.mediafire.com/file/lsxh8n08jn3z81a/imgui.rar/file
2. and include this in your main.h
#include "imgui.h"
#include "imgui_impl_dx9.h"
#include "imgui_impl_win32.h"
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
#include <tchar.h>
#include <d3d9.h>
extern LRESULT ImGui_ImplWin32_WndProcHandler(HWND wnd, UINT umsg, WPARAM wparam, LPARAM lparam);
3. Rendering: after you include everything in your project now you can start to initialize imgui
go to proxyIDirect3DDevice9.cpp and in there first find void proxyID3DDevice9_UnInitOurShit(void)
in there put ImGui_ImplDX9_InvalidateDeviceObjects(); after render->Invalidate();
now find renderHandler(); and in there put
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
ImGuiStyle& style = ImGui::GetStyle();
io.IniFilename = NULL;
io.DeltaTime = 1.0f / 60.0f;
ImFont* pFont = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\framd.ttf", 15);
SetCursor(io.MouseDrawCursor ? NULL : LoadCursor(NULL, IDC_ARROW));
io.Fonts->AddFontDefault();
style.AntiAliasedLines = false;
style.AntiAliasedFill = false;
style.WindowBorderSize = 0.0f;
ImGui_ImplWin32_Init(GetActiveWindow());
ImGui_ImplDX9_Init(pPresentParam.hDeviceWindow, origIDirect3DDevice9);
before proxyIDirect3DDevice9_init = 1;
then go to keyhook.cpp and find
static LRESULT CALLBACK wnd_proc(HWND wnd, UINT umsg, WPARAM wparam, LPARAM lparam)
there put ImGui_ImplWin32_WndProcHandler(wnd, umsg, wparam, lparam);
4. after you initialized your imgui into sobeit now lets draw menu
after you put this code into your project now lets include it
go to renderHandler again and put RenderImgui(); under renderSamp();
and put Theme(); before proxyIDirect3DDevice9_init = 1;
5. now compile and test in game, since sobeit menu is kinda old you can create awesome looking cheats with imgui without using some hooks and defining all again sobeit has everything
preview
1. add files down below into your sobeit
- imconig.h
- imgui.cpp
- imgui.h
- imgui_demo.cpp
- imgui_draw.cpp
- imgui_impl_dx9.cpp
- imgui_impl_dx9.h
- imgui_impl_win32.cpp
- imgui_impl_win32.h
- imgui_internal.h
- imgui_widgets.cpp
- imstb_rectpack.h
- imstb_textedit.h
- imstb_truetype.h
you can download them from here http://www.mediafire.com/file/lsxh8n08jn3z81a/imgui.rar/file
2. and include this in your main.h
#include "imgui.h"
#include "imgui_impl_dx9.h"
#include "imgui_impl_win32.h"
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
#include <tchar.h>
#include <d3d9.h>
extern LRESULT ImGui_ImplWin32_WndProcHandler(HWND wnd, UINT umsg, WPARAM wparam, LPARAM lparam);
3. Rendering: after you include everything in your project now you can start to initialize imgui
go to proxyIDirect3DDevice9.cpp and in there first find void proxyID3DDevice9_UnInitOurShit(void)
in there put ImGui_ImplDX9_InvalidateDeviceObjects(); after render->Invalidate();
now find renderHandler(); and in there put
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
ImGuiStyle& style = ImGui::GetStyle();
io.IniFilename = NULL;
io.DeltaTime = 1.0f / 60.0f;
ImFont* pFont = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\framd.ttf", 15);
SetCursor(io.MouseDrawCursor ? NULL : LoadCursor(NULL, IDC_ARROW));
io.Fonts->AddFontDefault();
style.AntiAliasedLines = false;
style.AntiAliasedFill = false;
style.WindowBorderSize = 0.0f;
ImGui_ImplWin32_Init(GetActiveWindow());
ImGui_ImplDX9_Init(pPresentParam.hDeviceWindow, origIDirect3DDevice9);
before proxyIDirect3DDevice9_init = 1;
then go to keyhook.cpp and find
static LRESULT CALLBACK wnd_proc(HWND wnd, UINT umsg, WPARAM wparam, LPARAM lparam)
there put ImGui_ImplWin32_WndProcHandler(wnd, umsg, wparam, lparam);
4. after you initialized your imgui into sobeit now lets draw menu
C++:
void Theme() // this is my custom theme you can put yours
{
ImGuiStyle& style = ImGui::GetStyle();
ImVec4* colors = ImGui::GetStyle().Colors;
style.WindowTitleAlign = ImVec2(0.5f, 0.5f);
colors[ImGuiCol_Text] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
colors[ImGuiCol_TextDisabled] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f);
colors[ImGuiCol_WindowBg] = ImColor(24, 24, 24);
colors[ImGuiCol_ChildBg] = ImVec4(1.00f, 1.00f, 1.00f, 0.00f);
colors[ImGuiCol_PopupBg] = ImVec4(0.08f, 0.08f, 0.08f, 0.94f);
colors[ImGuiCol_Border] = ImColor(0, 0, 0);
colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
colors[ImGuiCol_FrameBg] = ImVec4(0.16f, 0.29f, 0.48f, 0.54f);
colors[ImGuiCol_FrameBgHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.40f);
colors[ImGuiCol_FrameBgActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f);
colors[ImGuiCol_TitleBg] = ImColor(0, 0, 0);
colors[ImGuiCol_TitleBgActive] = ImColor(0, 0, 0);
colors[ImGuiCol_TitleBgCollapsed] = ImColor(0, 0, 0);
colors[ImGuiCol_MenuBarBg] = ImVec4(0.14f, 0.14f, 0.14f, 1.00f);
colors[ImGuiCol_ScrollbarBg] = ImVec4(0.02f, 0.02f, 0.02f, 0.53f);
colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.31f, 0.31f, 0.31f, 1.00f);
colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.41f, 0.41f, 0.41f, 1.00f);
colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.51f, 0.51f, 0.51f, 1.00f);
colors[ImGuiCol_CheckMark] = ImColor(10, 188, 7);
colors[ImGuiCol_SliderGrab] = ImColor(25, 165, 6);
colors[ImGuiCol_SliderGrabActive] = ImColor(25, 165, 6);
colors[ImGuiCol_Button] = ImColor(196, 54, 7);
colors[ImGuiCol_ButtonHovered] = ImColor(193, 9, 9);
colors[ImGuiCol_ButtonActive] = ImColor(193, 135, 0);
colors[ImGuiCol_Header] = ImColor(41, 2, 2);
colors[ImGuiCol_HeaderHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.80f);
colors[ImGuiCol_HeaderActive] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
colors[ImGuiCol_Separator] = ImColor(0, 0, 0);
colors[ImGuiCol_SeparatorHovered] = ImColor(0, 0, 0);
colors[ImGuiCol_SeparatorActive] = ImColor(0, 0, 0);
colors[ImGuiCol_ResizeGrip] = ImColor(0, 0, 0);
colors[ImGuiCol_ResizeGripHovered] = ImColor(0, 0, 0);
colors[ImGuiCol_ResizeGripActive] = ImColor(0, 0, 0);
colors[ImGuiCol_PlotLines] = ImVec4(0.61f, 0.61f, 0.61f, 1.00f);
colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.43f, 0.35f, 1.00f);
colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f);
colors[ImGuiCol_TextSelectedBg] = ImVec4(0.26f, 0.59f, 0.98f, 0.35f);
colors[ImGuiCol_DragDropTarget] = ImVec4(1.00f, 1.00f, 0.00f, 0.90f);
colors[ImGuiCol_NavHighlight] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f);
colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.20f);
colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.35f);
style.WindowPadding = ImVec2(15, 15);
style.WindowRounding = 5.0f;
style.ItemSpacing = ImVec2(12, 8);
style.ItemInnerSpacing = ImVec2(8, 6);
style.IndentSpacing = 25.0f;
style.ScrollbarSize = 15.0f;
style.ScrollbarRounding = 9.0f;
}
void RenderImgui()
{
static bool activew = true;
static bool bDemo = false;
static bool bFunction1 = false;
static bool bFunction2 = false;
static bool bFunction3 = false;
ImGui_ImplDX9_NewFrame();
ImGui_ImplWin32_NewFrame();
if (activew)
{
ImGui::SetNextWindowSize(ImVec2(700, 400));
ImGui::Begin("ImGui меню", &activew, ImVec2(305, 160), 0.8f, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoResize);
{
ImGui::Checkbox("Show Imgui Demo Window", &bDemo);
if(bDemo)
{
ImGui::ShowDemoWindow();
}
ImGui::Checkbox("My Cheat 1", &bFunction1);
ImGui::Checkbox("My Cheat 2", &bFunction2);
ImGui::Checkbox("My Cheat 3", &bFunction3);
}
ImGui::End();
}
ImGui::EndFrame();
ImGui::Render();
ImGui_ImplDX9_RenderDrawLists(ImGui::GetDrawData());
}
after you put this code into your project now lets include it
go to renderHandler again and put RenderImgui(); under renderSamp();
and put Theme(); before proxyIDirect3DDevice9_init = 1;
5. now compile and test in game, since sobeit menu is kinda old you can create awesome looking cheats with imgui without using some hooks and defining all again sobeit has everything
preview
Attachments
Last edited: