Commit Graph

5 Commits (859df9f43d5bb92a472ab71bc22d802d5eb29429)

Author SHA1 Message Date
whitequark e9b9dca2ca Win32: use native OpenGL drivers, if available.
After this commit, if the target system does have modern OpenGL
drivers installed, ANGLE is configured to use them, bypassing most
translation (shaders still have to be translated from ESSL to GLSL).

If there are no OpenGL drivers, such as if the graphics drivers were
installed via Windows Update, DirectX translation is still used. This
results in a very noticeable startup delay and minor performance
degradation.

In addition it is no longer necessary to build with -DOPENGL=1 to be
able to run the binary in wine; everything works out of the box.
Before, wine's incomplete HLSL translator would crash.

This change required renaming the variable `texture` in shaders,
since it shadows the Core GLSL function with the same name, and ANGLE
translates texture2D() calls to texture() calls.
2019-05-23 10:58:31 +00:00
whitequark 2b4c484dcb Discard fragments with zero texture alpha in imesh_tex.frag.
This makes image requests that have an image with a hole in it
actually transparent, since otherwise the depth test would prevent
any geometry behind the request from being drawn.
2018-07-28 12:33:32 +00:00
whitequark 6b67cfe63f Except when using OpenGL ES 2, use OpenGL 3.2+ Core profile.
This is primarily done to lower the GTK version dependency below
GTK 3.22, since GTK 3.22 is unlikely to be widely availale any
time soon.
2017-01-13 23:43:02 +00:00
whitequark c8ff17f4a2 Add OpenGL 2 support on Windows using ANGLE.
This commit performs two main changes:
  * Alters the shaders to use only strictly conformant GLSL 2.0.
  * Alters the Windows UI to use ANGLE via GL ES 2.0 and EGL 1.4.

This commit also drops official support for Windows XP, since ANGLE
requires a non-XP toolset to build. It is still possible to build
SolveSpace for Windows XP using:

  cmake -T v120_xp -DOPENGL=1
2016-11-18 11:38:45 +00:00
EvilSpirit 6d2c2aecff Implement an OpenGL 2 renderer.
There are two main reasons to desire an OpenGL 2 renderer:
 1. Compatibility. The compatibility profile, ironically, does not
    offer a lot of compatibility, and our OpenGL 1 renderer will not
    run on Android, iOS, or WebGL.
 2. Performance. The immediate mode does not scale, and in fact
    becomes very slow with only a moderate amount of lines on screen,
    and only a somewhat large amount of triangles.

This commit implements a basic OpenGL 2 renderer that uses only
features from the (OpenGL 3.2) core profile. It is not yet faster
than the OpenGL 1 renderer, primarily because it uses a lot of small
draw calls.

This commit uses OpenGL 2 on Linux and Mac OS X directly (i.e. links
to the GL symbols from version 2+); on Windows this is impossible
with the default drivers, so for now OpenGL 1 is still used there.
2016-11-18 04:04:29 +00:00