Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any downsides of moving from GDI+ to OpenGL?

I recently moved the rendering part of a program of mine from GDI+ to OpenGL.

Now I'm wondering: are there any downsides to doing so?

For example, are there any versions of Windows (XP or later) that support GDI+ but not OpenGL?
Or, for example, is it possible for a lack of drivers (or poor drivers), or a lack of a graphics card, etc. to make OpenGL rendering impossible on a system on which GDI+ works fine?

(I understand the OpenGL might need to resort to software rendering on less capable systems, but aside from slowness, I'm wondering if it would ever simply not work correctly in a situation in which GDI+ would.)

like image 355
user541686 Avatar asked Apr 29 '14 10:04

user541686


People also ask

Is OpenGL faster than GDI?

Your program size shouldn't change much as the OpenGL/DirectX libraries are dynamically linked (although of course, you have more code to init them). GDI will be slower than D3D/OpenGL though, as it's indirect rendering.

Is GDI obsolete?

Legacy Graphics: Technologies that are obsolete and should not be used in new applications. This category includes (among others) the following APIs: GDI.


2 Answers

It depends on the OpenGL version/profile you're using. Up to, inclusing Windows XP OpenGL-1.1 is available by default without additional drivers. Since Windows Vista the minimum available OpenGL version is OpenGL-1.4.

However if you need anything more than that, you're relying on the user installing the drivers that come from the GPU vendor; the drivers installed by default in a standard Windows installation don't cover OpenGL (for not perfectly sane reasons).

Programs and libraries that strongly depend on OpenGL-ES have resorted to incorporate fallbacks like ANGLE.

like image 175
datenwolf Avatar answered Oct 18 '22 08:10

datenwolf


There are some idiosyncrasies, as for example: you cannot create a transparent OpenGL window, if transparency is disabled (which means, not at all, under XP). Otherwise, as datenwolf notes, there's ANGLE, but even that does not always work. Another option might be mesa3d compiled for the windows target, with software rendering enabled. This option might be the safest one and faster than the software OpenGL 1.1 implementation from Microsoft.

like image 35
user1095108 Avatar answered Oct 18 '22 07:10

user1095108