Coder Social home page Coder Social logo

oshgui's People

Contributors

drp3pp3r avatar jeoni avatar kn4ck3r avatar thejeon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

oshgui's Issues

OSHGui with CSGO surface flickering

So I'm currently trying to implement OSHGui using CSGO's surface.
I found your implemenation from some years ago.
However my menu is just flickering when enabled, here is a video to show it better.

I'm initializing OSHGui like so:

std::vector<OSHGui::Drawing::FontPtr> m_fonts;

OSHGui::Application::Initialize(std::make_unique<CSGORenderer>(interfaces::surface, interfaces::engine));
this->m_fonts.resize(renderer_fonts::FONT_MAX);
this->m_fonts[verdana_7] = std::make_unique<CSGOFont>(interfaces::surface, "Verdana", 7);

To draw the GUI I hook PaintTraverse and call it in MatSystemTopPanel.

void renderer::draw()
{
	this->m_render_target = this->get_renderer().GetDefaultRenderTarget();

	if (!this->m_render_target)
	{
		return;
	}

	this->m_geometry = this->get_renderer().CreateGeometryBuffer();

	if (!this->m_geometry)
	{
		return;
	}

	this->m_render_target->Draw(*this->m_geometry);
}

I'm probably doing something wrong here and I would really appreciate help.

Kind regards.

unresolved external symbol for Drawing::Direct3D9Renderer

I'm new to OSHGui. I'm trying to follow the examples in your website.
I first compiled all external dependencies. Then I compiled the static library.
Then I included the source files and linked the library to my project.

Some class and function names seem to be changed with current lib, compared to the examples on your website. I've (hopefully) fixed these correctly. All compiler errors are gone in Visual Studio. However I still can't compile, im getting this linker error.

Screenshot_2

Screenshot_1

Thanks in advance

Can't set viewports

Hi!
I ran into an issue when using the current OSHGui renderer. I'm currently calling SetViewport( ) to try and clip an area, but it seems not to work.
The renderer I'm using can be found here: https://github.com/EternityX/DEADCELL-CSGO/blob/master/deadcell/oshgui/renderer.cpp
My only addition to that renderer is the get_device( ) function that simply returns the device.

Here is my code:

//	store original viewport to restore later
D3DVIEWPORT9 original_viewport;
g_renderer.get_device( )->GetViewport( &original_viewport );

//	clip at position (100, 100), with size (50, 50) 
D3DVIEWPORT9 clip = { 100, 100, 50, 50 };
g_renderer.get_device( )->SetViewport( &clip );

g_renderer.filled_rect( OSHGui::Drawing::Color::White( ), 100, 100, 500, 500 );

//	restore
g_renderer.get_device( )->SetViewport( &original_viewport );

Here is the outcome:
image

Is there any way anyone could point me into the right direction, on how I could/should go about this?
Thanks ๐Ÿ‘

OSHGui for DirectX 7?

So i'm currently working on a menu for the game "Gothic 1", which is relying on DirectX 7 for drawing.

Unfortunately, other UI librarys such as ImGui or nuklear do not support rendering using DirectX7.
However, by simply looking at this UI, it should (Direct3D7Renderer).

So i simply downloaded the main branch, compiled the /Dependencies and attempted to rewrite the OSHGui Hook Dll with DirectX7 Support.

However, that does not quite work.

For some reason this code:

	// 1. create our renderer, Direct3D9 in this case
	-> auto renderer = std::make_unique<Direct3D7Renderer>(device);
	
	// 2. and initialize the OSHGui with it
	Application::Initialize(std::move(renderer));

breaks every single time. It won't let me compile the code with the following error message:

"Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol "public: __thiscall OSHGui::Drawing::Direct3D7Renderer::Direct3D7Renderer(struct IDirect3DDevice7 *)" (??0Direct3D7Renderer@Drawing@OSHGui@@QAE@PAUIDirect3DDevice7@@@z) OSHGui Hook DLL C:\Users\XXXX\Desktop\OSHgui\OSHGui-master\Projects\VS2019\OSHGui_Hook_Sample.obj 1
"

Would you be able to provide me a solution for using the Direct3D7Renderer?
I really would like to use a UI that i can make work internally.
I am trying the hardest to avoid external and also using the GDI Implementation of ImGUI, as it is eating performance alot.

Thanks.

DDS Image Support

As far as I know, we can use BMP, JPEG, GIF, PNG, TGA, ICO image files with OSHGui.
* Loads an image from a file. (BMP, JPEG, GIF, PNG, TGA, ICO)

I have already been using jpeg/png without any issues.
Is it possible to load an image in .dds format somehow?

.exe app

Can I use oshgui for exe app? Something like cheat loader? Thanks for answer!

No such interface supported error from D3DX11CreateEffectFromMemory

So, i have added some debug messages to understand what goes wrong when injecting the DLL

Direct3D11Renderer.cpp:

HRESULT hr = D3DX11CompileFromMemory(shaderSource, sizeof(shaderSource), nullptr, nullptr, nullptr, nullptr, "fx_5_0", 0, 0, nullptr, &blob, &errors, nullptr);
    if (FAILED(hr))
    {
        std::string msg = "D3DX11CompileFromMemory failed: ";
        if (errors)
        {
            msg += static_cast<const char*>(errors->GetBufferPointer());
            errors->Release();
        }
        else
        {
            msg += "Unknown error";
        }
        throw Misc::Exception(msg);
    }

    hr = D3DX11CreateEffectFromMemory(blob->GetBufferPointer(), blob->GetBufferSize(), 0, device.Device, &effect);
    if (FAILED(hr))
    {
        std::string msg = "D3DX11CreateEffectFromMemory failed: ";
        LPVOID lpMsgBuf;
        FormatMessage(
            FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
            NULL,
            hr,
            MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
            (LPTSTR)&lpMsgBuf,
            0, NULL );

        msg += (char*)lpMsgBuf;
        LocalFree(lpMsgBuf);
        
        throw Misc::Exception(msg);
    }

Getting message with "No such interface supported" error. What can be the issue?

IDE: VS2019
DXSDK: Microsoft DirectX SDK (June 2010)
Platform: Win11x64

Style issues

If I set DefaultColor.BackColor(Drawing::Color(255, 245, 208, 255)), It will give me a white window.
Any ideas to fix ๐Ÿ˜ญ
image

auto form = std::make_shared<OSHGui::Form>();

form->SetName("form1");
form->SetText("Form1");

Drawing::Style theme;
theme.DefaultColor.ForeColor = Drawing::Color(255, 31, 97, 106);
theme.DefaultColor.BackColor = Drawing::Color(255, 245, 208, 255);
#define MakeTheme(control, color1, color2) theme.SetControlColorTheme(control, Drawing::Theme::ControlTheme(color1, color2))

form->ApplyStyle(theme);

[SUGGESTION] Support dynamic resizing

Hello,

First of all, thank you this great library, I have keep track of your project since 2011 and this is near perfect for my needs.

I just wanted to say that it would be nice to implement a way to dynamically resize windows, and elements (such as groupboxes).

We would just click and drag on lower right / lower left corner to resize.

Compiling Sample Project (to test)

Error LNK1181 cannot open input file 'jsoncpp.lib' OSHGui DLL
Error LNK1181 cannot open input file 'jsoncpp.lib' OSHGui Static Library
Error LNK1181 cannot open input file 'oshgui.lib' OSHGui Sample

im getting these errors when compiling solution any help?

Crashing when trying to draw a text

So every time I try to draw a font with the geometry buffer and using "DrawString" I'm just crashing an getting an exception.
I was able to track it down to here

The function is referenced here

When the renderer tries to create a texture (in my case a font) I'm crashing at the if condition.
The weird thing is that every paramter I pass into "D3DXCreateTexture" is valid and all other things work, like trying to draw a rectangle or the menu without any font.

I'm creating fonts like so:
this->m_fonts.push_back(OSHGui::Drawing::FontManager::LoadFont("Verdana", 12.f, true));
and I draw the text like so:

OSHGui::Drawing::Graphics graphics(*this->m_geometry);
graphics.DrawString(buf, font, shadow_color, x, y);

I'm pretty I'm missing something (probably with FreeType) but I just can't find a solution for this.

Any help, or push in the right direction would be very much appreicated.

Dynamically 'anchoring' elements is broken due to mistake in the code

Take a look at this these lines of code (line ~160-180 in Control.cpp, Control::SetSize):

	size_ = size;
	
	OnSizeChanged();

	Invalidate();

	const auto offset = size_ - GetSize();
	for (auto &control : controls_)
	{
		const auto anchor = control->GetAnchor();

		if (anchor != (AnchorStyles::Top | AnchorStyles::Left))

It changes the member variable size_ and then calculates offset, which is obviously going to be {0, 0}. This breaks dynamic resizing of the parent controls, as the children will not be correctly placed after the resize.

EDIT: fixing this would be as simple as doing size - GetSize() instead of size_ - GetSize()

Can't remove controls

I have a basic form, consisting of few pictureboxes and labels. I added a button and I'm doing this in it's click handler:

this->RemoveControl(label_CurrentPage);

The code is being executed, however, the label is not removed. No error, nothing.
After removing, I'm also iterating over GetControls() to check the current controls and it's still there.

OSHGui Externally?

I plan on using OSHGui in one of my upcoming projects. Is OSHGui viable externally? Even outside of cheat development? It's beautifully written but I have no idea where to start as everyone is using it internally for CSGO.

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.