Coder Social home page Coder Social logo

OSHGui with CSGO surface flickering about oshgui HOT 8 OPEN

kn4ck3r avatar kn4ck3r commented on September 18, 2024
OSHGui with CSGO surface flickering

from oshgui.

Comments (8)

KN4CK3R avatar KN4CK3R commented on September 18, 2024

Did you try drawing just a square or a line as a test? Does that work?

from oshgui.

papstuc avatar papstuc commented on September 18, 2024

Did you try drawing just a square or a line as a test? Does that work?

Yes I did. Drawing a line, text, rectangle works completely fine.

from oshgui.

KN4CK3R avatar KN4CK3R commented on September 18, 2024

Did you draw these with my renderer or directly from the surface?

from oshgui.

papstuc avatar papstuc commented on September 18, 2024

I tried directly from the surface, which worked.
I sadly can't get it working with your renderer.

Would it be possible for you to evaluate me how you have gotten it working or maybe send me the implementation source code?

from oshgui.

KN4CK3R avatar KN4CK3R commented on September 18, 2024

I use the CSGO renderer only for ESP and other visuals but not for the GUI.
My PaintTraverse hook looks like this:

auto panelName = thisPanel->GetName(panel);
if (panelName == "MatSystemTopPanel")
{
	using namespace OSHGui;
	using namespace OSHGui::Drawing;
	
	static bool once = true;
	if (once)
	{
		once = false;

		auto surface = reinterpret_cast<IMatSystemSurface*>(...);

		module.rendererCSGO = std::make_unique<CSGORenderer>(surface, module.GetEngine());
		module.fontCSGO = std::make_shared<CSGOFont>(surface, _xor_("Arial"), 14);
	}

	module.rendererCSGO->BeginRendering();

	auto geometry = module.rendererCSGO->CreateGeometryBuffer();
	{
		Graphics g(*geometry);

		// draw stuff

		if (module.IsIngame())
		{
			// draw esp
		}
	}
	auto &renderTarget = module.rendererCSGO->GetDefaultRenderTarget();
	renderTarget->Activate();
	renderTarget->Draw(*geometry);
	renderTarget->Deactivate();

	module.rendererCSGO->EndRendering();
}

from oshgui.

papstuc avatar papstuc commented on September 18, 2024

Thanks for the source code!

Well my problem is that the GUI is sometimes randomly crashing due to CSGO's render multi threading, thats why I'm trying to implement it using the surface.

from oshgui.

KN4CK3R avatar KN4CK3R commented on September 18, 2024

I don't use it for the GUI because my GUI uses some textures and I did not implement that in the CSGO renderer. Normal stuff should just work.

from oshgui.

papstuc avatar papstuc commented on September 18, 2024

I'm doing the same right now. Just using OSH for the GUI.
Though it's crashing the same like in #9

from oshgui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.