Screenshots using GPU.

Started by sblantipodi, May 28, 2020, 16:41:14

Previous topic - Next topic

sblantipodi

Hi,
I have created a PC Ambilight project.

This project basically capture the screen image, and sends an encoded version of the "screen colors" to a microcontroller that display that colors to a led strip.

This are the project involved for the purpose
https://github.com/sblantipodi/pc_ambilight
https://github.com/sblantipodi/JavaFastScreenCapture

and this the result:
https://www.youtube.com/watch?v=68pnR5HMCTU

As you can see I use the AWT Robot Java class to capture the screen, it works well and with the right numbers of threads it works even fast.
The problem is that the robot class creates "some stutter" on slow CPUs and it's really CPU intensive if pushed that hard with threads.

Is there a way to get a simple screenshot using LWJGL and the GPU and put that screenshot in a BufferedImage?

THANKS!

abcdef

Sounds like a fun project!

LWJGL needs you to create a window (using GLFW) and that is the window context you have access to. I don't believe you can get access to the screen as a whole.