简体   繁体   English

如何在GPU而不是CPU上渲染? -Java-

[英]How to render on the GPU instead of CPU? -Java-

In a game I am writing in Java, I am constantly (100 times a second) calling a function called render(Graphics g) 在我用Java编写的游戏中,我经常(每秒100次)调用一个称为render(Graphics g)的函数。

Clearly, this takes a parameter, of Graphics g, and I was wondering how to push all rendering (the render() function) to the GPU in my system, and the updating of the game would be left to my CPU. 显然,这需要Graphics g的参数,我想知道如何将所有渲染(render()函数)推送到系统中的GPU,而游戏的更新将留给我的CPU。

Is this very difficult? 这很难吗? I would assume it could be. 我认为可能是这样。

使用现有的JOCLJCUDA库执行此任务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM