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

Hi Mr. Jarcho.Can You add the takeScreenshot function? #22

Open
weili0677 opened this issue Dec 29, 2023 · 2 comments
Open

Hi Mr. Jarcho.Can You add the takeScreenshot function? #22

weili0677 opened this issue Dec 29, 2023 · 2 comments

Comments

@weili0677
Copy link

You can see the d2gl's code :

void Context::takeScreenShot()
{
	static uint8_t* data = new GLubyte[App.viewport.size.x * App.viewport.size.y * 4];
	memset(data, 0, App.viewport.size.x * App.viewport.size.y * 4);

	glPixelStorei(GL_PACK_ALIGNMENT, 1);
	glReadPixels(App.viewport.offset.x, App.viewport.offset.y, App.viewport.size.x, App.viewport.size.y, GL_RGBA, GL_UNSIGNED_BYTE, data);

	std::string file_name = helpers::saveScreenShot(data, App.viewport.size.x, App.viewport.size.y);
}

and the memory address is:

helpers::getProcOffset(helpers::getVersionOffset({ "d2win.dll" }, { -10168 }, { -10168 }, { -10205 }, { -10014 }, { -10196 }, { -10187 }, { -10107 }, { 0xFA7A0 }))
d2versions:    109d,110,111,111b,112,113c,113d,114d

@Jarcho
Copy link
Owner

Jarcho commented Jan 8, 2024

I'm unlikely to get to this any time soon, but I will keep it in mind.

@weili0677
Copy link
Author

weili0677 commented Jan 8, 2024

I'm unlikely to get to this any time soon, but I will keep it in mind.

OK.Take it easy.Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants