1
votes

Currently I use GR32 functions for my project, where I have lots of blending, image operations such as saturation, contrast, blur etc. Also custom image operations.

Basically I would like to replace GR32 (or GDI, no difference) with graphic card instructions, in order to use graphics card for processing instead of CPU.

I don't need OpenGL unit, I don't want to make any 3D operations, I just want to use graphics card calculations instead of CPU instructions.

My questions are >

  1. What is the best way to use GPU?
  2. Is there any libs written for these purposes?
1
You can take a look at SDL or SFML if you want to do 2D things with a simpler API than OpenGL or DirectX.Jerem
GLScene is also a possibility. Also, if you're not really seeking the best performance, but something easy, take a look at the FireMonkey side of the newer XE Delphis. They are quite easy to work with, though has their annoyances as well. You can have 2D and 3D on the same form for example. XE5-7 versions are quite usable, earlier version have a lot of bugs.kgz
FireMonkey! It uses Direct2D (a 2D layer in DirectX) on Windows, and OpenGL on other platforms. Use 'effects', which are implemented via shaders, to blur, saturate, etc.David

1 Answers

4
votes

Use OpenGL or Direct3D. These are the APIs for talking to the GPU.

Also neither OpenGL nor Direct3D operate on 3D scenes. All they do is drawing points, lines or triangles to a pixel framebuffer, applying programmable shaders and fixed function blending operations. In other words they do exactly what you want.

The only thing that is "3D" about OpenGL and Direct3D is, that the coordinates for the points, lines or triangles have more than 2 dimensions, but ultimately these coordinates are projected into 2D window coordinates. And the points, lines and triangles are then rasterized as flat, 2 dimensional shapes in window coordinate space.