How to enable GPU acceleration when calling the wxWidgets library on a Linux system.

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
daixiaohua
In need of some credit
In need of some credit
Posts: 5
Joined: Tue Nov 14, 2023 2:32 pm

How to enable GPU acceleration when calling the wxWidgets library on a Linux system.

Post by daixiaohua »

Question Description:
Due to the application not utilizing GPU acceleration and instead relying on the CPU for graphics rendering, Xorg utilization and CPU usage are high.

Question Analysis and Expected Solution Direction:
The software is developed using wxWidgets as the underlying framework and only requires 2D graphics rendering. Without wanting to make significant changes to the application, the desired solution direction is to enable hardware acceleration through simple modifications to the wxWidgets code, setting environment variables, changing configurations, installing plugins, or drivers.
There is a lack of direction on how to enable hardware acceleration in the wxWidgets code on a Linux system. Seeking guidance from experts in this matter.
User avatar
doublemax
Moderator
Moderator
Posts: 19158
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: How to enable GPU acceleration when calling the wxWidgets library on a Linux system.

Post by doublemax »

wxWidgets just uses the underlying graphics api on the particular platform, that would be Cairo under GTK. There is nothing inside wxWidgets that controls whether hardware acceleration is used.

Depending on what you need to render, using OpenGL might give you a better chance to get hardware acceleration. But unfortunately you'd have to rewrite your whole rendering code for that.
Use the source, Luke!
Post Reply