• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[OTClient Mod] Auto Screenshot and Fast Screenshot

Hi! I'm also trying to implement this amazing feature to our OTC but my problem is that screenshots work good until player changes the geometry of the window - after resizing, entering the fullscreen (leaving fullscreen doesn't fix). Doing any geometry changes causes that some part of the screenshot is going into alpha. Has anyone any idea?

After log in:
97c2d03af5.png



After entering fullscreen mode:
ca66b750bb.png



After leaving fullscreen mode:
f201250120.png
 
Hello!
Is anyone here who implemented it successfully on mehah client?
I'm not sure if openGL context there is somehow different or it differs in terms of threads.

On OtclientV8 I've made it work with full screenshot functionality. Same code on mehah client doesn't work. I added the part to check what's going on. Without my addition (glGetError part) it was creating pictures but totally black.
1728242339556.webp
C++:
void PlatformWindow::makeScreenShot(std::string file) {
    boost::filesystem::path dirPath(file);

    if (!g_resources.directoryExists(dirPath.parent_path().string())) {
        g_logger.error("Unable to find path: " + dirPath.parent_path().string());
        return;
    }
    
    uint arrayLength = 4 * getWidth() * getHeight();
    uint widthLength = getWidth();
    uint heightLength = getHeight();
    uint8_t* pixels = new uint8_t[arrayLength];

    glReadPixels(0, 0, getWidth(), getHeight(), GL_RGBA, GL_UNSIGNED_BYTE, pixels);

    GLenum error = glGetError(); //My check
    if (error != GL_NO_ERROR) {
        g_logger.error("OpenGL error while reading pixels: " + std::to_string(error));
        return;
    }

    boost::thread thread = boost::thread(&PlatformWindow::changeScreenShotOrientation, this, pixels, arrayLength, widthLength, heightLength, file);
}

It results in
ERROR: OpenGL error while reading pixels: 1282

Can someone give me some hint what should be checked / changed in order to make it work on mehah?
 
Hello!
Is anyone here who implemented it successfully on mehah client?
I'm not sure if openGL context there is somehow different or it differs in terms of threads.

...............
Can someone give me some hint what should be checked / changed in order to make it work on mehah?
 
Looks like I've tried to reinvent the wheel. I should have checked repo's pull requests. Thanks a lot!
 
Back
Top