Skip to content

Instantly share code, notes, and snippets.

@maksw2
Created September 21, 2024 07:02
Show Gist options
  • Save maksw2/e58fcb0e7a98dc9343f20b4c8969cd9f to your computer and use it in GitHub Desktop.
Save maksw2/e58fcb0e7a98dc9343f20b4c8969cd9f to your computer and use it in GitHub Desktop.
how 2 imgui in source engine
  1. https://github.com/Source-SDK-Resources/source-2013-imgui get this

  2. get imgui source code
    the path must look like this:
    imgui/thirdparty/imgui
    imgui/imgui
    2.1 include the vpc in client_base.vpc
    like this:
    $include "$SRCDIR\imgui\imgui\imgui_system.vpc"

  3. comment out these lines in imconfig_source.h:

#include "mathlib/vector2d.h"
#include "mathlib/vector4d.h"
#define IM_VEC2_CLASS_EXTRA												\
	ImVec2( const Vector2D& f ) : x( f.x ), y( f.y ) {}		\
	operator Vector2D() const { return Vector2D( x, y ); }

#define IM_VEC4_CLASS_EXTRA																\
	ImVec4( const Vector4D& f ) : x( f.x ), y( f.y ), z( f.z ), w( f.w ) {}	\
	operator Vector4D() const { return Vector4D( x, y, z, w ); }
  
  ...
  #define IMGUI_DISABLE_OBSOLETE_KEYIO
  1. use visual studio 2022 to compile, not the 2013 one
    4.1: mapbase: in vpc_scripts/newer_vs_toolsets.vpc set VS2022 to 1
    4.2: others: idk

  2. imgui_toggle_menu in console

  3. imgui_show_demo in console

if it wont work comment and ill try to remember how to fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment