Coder Social home page Coder Social logo

aero-overlay's Introduction

aero-overlay

A transparent window which is located above a target window to have the possibility to draw over it. My initial code can be found in 1.0 branch, development takes place in develop branch. Do not push into the master branch.

Installation

I'm using /MT in release and /MTd in debug as runtime library. So either adjust your project settings to mine or vice versa!

  • Clone the repository into your solution directory (I alway do this in contrib)
  • Right click on your solution
  • Add > Existing Project ... > and select the aero-overlay.vcxproj
  • Right click on your project in your solution
  • Add > Reference... > and select aero-overlay
  • Right click on your project in your solution > Properties
  • C/C++ > General > Additional Include Directories and add the include directory of this repository!

Usage

A basic overlay can be created using the title, process id or window handle.

#include <aero-overlay/overlay.hpp>

std::int32_t main(
    const std::int32_t argc,
    const char**       argv
)
{
    if( argc < 2 ) {
        printf( R"(usage:
    executable.exe "SuperCoolGameTitle"
)" );
        return -1;
    }

    const auto overlay = std::make_unique<aero::overlay>();
    const auto status  = overlay->attach( argv[ 1 ] );

    if( status != aero::api_status::success ) {
        printf( "[>] failed to create overlay: %d\n", status );
        return -1;
    }

    const auto surface = overlay->get_surface();
    const auto font    = surface->add_font( "test", "Verdana", 12.f );

    surface->add_callback([&surface, &font]
    {
        surface->text( 5.f, 5.f, font, 0xFFFFFFFF, "this is an example" );
    } );

    while( overlay->message_loop() ) {
        if( surface->begin_scene() ) {
            surface->end_scene();
        }

        std::this_thread::sleep_for( std::chrono::milliseconds( 2 ) );
    }
};

Callbacks are only executed if the target window is in foreground

Custom rendering support

With overlay::set_surface() you can use your own components. You only need to re-implement the classes font and surface.

This function must be called before attach()!

overlay->set_surface( std::make_share<my_surface>() );

const auto status = overlay->attach( ... );

aero-overlay's People

Contributors

reactiion1337 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

aero-overlay's Issues

Thank you!

Hey ReactiioN1337,

thanks for this awesome library. Before stumbling upon this I've used GDI for my external overlay and even after implementing double buffering it flickered. Including aero into my project and replacing GDI with it was a real ease (somewhere about 30mins - 1hr) due to the well written readme.

image

Missing d3dx9.h

I tried to install vs 2017, sdk 10.0.14393.0, v141 but nothing worked for missing "d3dx9.h"

C2146: syntax error : missing ';' before identifier 'SIZE_T'

Hello,

There is an error in Surface.hpp

Line 13:
static constexpr size_t MAX_RENDER_ELEMENTS = 512;

C2146: syntax error : missing ';' before identifier 'size_t'
C4430: missing type specifier - int assumed. Note: C++ does not support default-int

Building with QT creator -> compiler MSVC 2013 32bit

What's is wrong, I just cant solve it alone ๐Ÿ˜„

Fullscreen handling?

Overlay does not show up when the game (unreal engine 4) switches to fullscreen.
What am I doing wrong?
Somtetimes it seems to work (e.g. when two screens are active)
Starting the thread differently also helped, but then I got tearing in the game.

Any hints on how to do it right fullscreen?

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.