Hi, I am trying to port my Lua code to C++ to improve perfomance.
In my visual studio project I have included GMod Lua headers (https://github.com/garrynewman/gmod-module-base) and Source SDK 2007 headers and libraries. Everything compiles fine, but when this line executes the game crashes.
g_pVGuiSurface->DrawTexturedRect(x, y, x + w, y + h);
As I found out every call to “g_pVGuiSurface” (or “vgui::surface()”) makes game to crash.
Other functions like “Msg()” work fine, so I just don’t know what goes wrong.
The crash memory dump file information:
Process Name: hl2.exe : D:\Program Files (x86)\Steam\steamapps\common\GarrysMod\hl2.exe Process Architecture: x86 Exception Code: 0xC0000005 Exception Information: The thread tried to read from or write to a virtual address for which it does not have the appropriate access. Heap Information: Not Present
I guess that the headers from Source SDK 2007 may not be suitable for Garrys Mod, but these are the only headers that I’ve got.