Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Overlay engine, supporting simple UI rendering #10

Closed
justinstenning opened this issue Feb 3, 2014 · 11 comments
Closed

Implement Overlay engine, supporting simple UI rendering #10

justinstenning opened this issue Feb 3, 2014 · 11 comments
Assignees

Comments

@justinstenning
Copy link
Owner

Idea is to finish implementing an Overlay engine that can render for DirectX 9, 10 and 11.

@justinstenning justinstenning self-assigned this Feb 3, 2014
@KristjanLaane
Copy link

Not sure if this would involve being able to overlay native WPF or Windows Forms controls? I have just asked a question regarding it, based on your work http://stackoverflow.com/questions/26611170/embed-button-control-into-existing-direct3d-application

Thanks for sharing!

@KristjanLaane
Copy link

I am trying to understand and finish implementing the ImageElement in your Overlay engine, to draw with Direct3D 11 a 2D red rectangle texture as achieved with Direct3D 9 here thanks to you - #27

However, I am pretty stuck due to my lack of knowledge.

Firstly I edited the ImageElement class like this:

public class ImageElement:Element
{
//        public System.IO.Stream ImageStream { get; set; }
    public string ImageLocation { get; set; }
    public float Alpha { get; set; }
    public System.Drawing.PointF Location { get; set; }

}

Then I instantiated one at https://github.com/spazzarama/Direct3DHook/blob/master/Capture/Hook/DXHookD3D11.cs#L367

                var imageElement = new ImageElement();
                string dir = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
                string filename = dir + @"\gridW1024H768.jpg";
                imageElement.ImageLocation = filename;
                imageElement.Alpha = 1;
                imageElement.Location = new PointF(50, 50);
                overlay.Elements.Add(imageElement);

But how do you then initialize the texture here https://github.com/spazzarama/Direct3DHook/blob/master/Capture/Hook/DX11/DXOverlayEngine.cs#L110

                else if (imageElement != null)
                {
                    // TODO: load image element into texture
                }

And finally how do you actually draw it here https://github.com/spazzarama/Direct3DHook/blob/master/Capture/Hook/DX11/DXOverlayEngine.cs#L147

                else if (imageElement != null)
                {

                }

@justinstenning
Copy link
Owner Author

I think I have written the ImageElement for D3D 11 in another project, I'll see what state it is in and bring across to this project if all good.

EDIT:
There's a few changes I made to the DX11 DXSprite, DXOverlayEngine, and a few additional classes. I'll look to getting these committed in the next week.

@KristjanLaane
Copy link

thanks ahead!

@KristjanLaane
Copy link

these improvements do not exist on any other branch do they?

@KristjanLaane
Copy link

any luck with the commits Justin?

@justinstenning
Copy link
Owner Author

I've mostly finished putting it together from a number of projects here, unfortunately I'm busy for the next week or so, will try to get it sorted after then.

@justinstenning
Copy link
Owner Author

I've got it all together, will try to commit before next week.

@justinstenning
Copy link
Owner Author

Image overlay support for D3D11 has been committed, this also has preliminary support for GPU image resizing. ddb3096

@KristjanLaane
Copy link

thanks ever so much, I'll give it a whirl soon!

justinstenning added a commit that referenced this issue Feb 21, 2018
 * CaptureInterface.DrawOverlay added
 * D3D9 image supports scale and rotation
 * D3D9 image load from memory support added

Fixes #36, #10
@justinstenning
Copy link
Owner Author

Closing as API now added to display overlay. Other improvements to be in new issues.

3bagorion33 pushed a commit to 3bagorion33/Direct3DHook that referenced this issue Aug 27, 2023
3bagorion33 pushed a commit to 3bagorion33/Direct3DHook that referenced this issue Aug 27, 2023
 * CaptureInterface.DrawOverlay added
 * D3D9 image supports scale and rotation
 * D3D9 image load from memory support added

Fixes justinstenning#36, justinstenning#10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants