Hello Guest

Screenshots using GPU.

  • 1 Replies
  • 3963 Views
Screenshots using GPU.
« on: May 28, 2020, 16:41:14 »
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!

*

Offline abcdef

  • ****
  • 336
Re: Screenshots using GPU.
« Reply #1 on: June 09, 2020, 12:38:02 »
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.