OpenGL 3/4 support in D - d

Is there any lib that provides OpenGL 3 or 4 bindings for the D language? AFAIK, derelict only gives 2.1 capabilities.

derelict2 supports OpenGL 3.1, 3.2, 3.3 and 4.0.
See http://www.dsource.org/projects/derelict/changeset?old=branches%2FDerelict2%2FDerelictGL%2Fderelict%2Fopengl%40523&new=branches%2FDerelict2%2FDerelictGL%2Fderelict%2Fopengl%40523
The link above is not longer working.
Derelict is now version 3 and on Github: https://github.com/aldacron/Derelict3/

Related

Software rendering with Mesa/OpenGL 4.5 on Ubuntu VM on Mac

As part of my studies, I have to be able to compile and run OpenGL 4.5-based programs, and I only have a Mac to do so. I am using Ubuntu in a VM to have a more programming-friendly environment, but my software and hardware (macOS Sierra 10.12.6, Intel HD Graphics 4000) is limited to 3.3 contexts. Here is additional info (ran from the Ubuntu VM) :
$ glxinfo | grep 'OpenGL core'
OpenGL core profile version string: 3.3 (Core Profile) Mesa 18.0.5
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
The assignments use GLFW. I've been trying to get it to use Mesa (which it does, with llvmpipe) with software rendering so that it is independent from the hardware capabilities (if I understand correctly), but the window creation always fails when I try to create a 4.5 context. I looked around and tried using export LIBGL_ALWAYS_SOFTWARE=1 to no avail. The build chain uses CMAKE to build both the assignments and the actual GLFW lib, for what it's worth (I noticed that it uses X11 with the xorg-dev packages).
Does Mesa implement any version of OpenGL 4 ? If it does, can I force software rendering on GLFW's part so that I can create an OpenGL 4.x context ?
Does Mesa implement any version of OpenGL 4 ?
Their Intel & Radeon hardware drivers do.
... can I force software rendering on GLFW's part so that I can create an OpenGL 4.x context ?
Nope, all of Mesa's software renderers (softpipe, llvmpipe, & swr) top out at OpenGL 3.3.
As of Mesa 20.2 llvmpipe supports OpenGL 4.5.

Supported opengl version on lenovo 11e laptop?

I have this laptop:
http://shop.lenovo.com/us/en/laptops/thinkpad/11e-series/11e-3rd-gen-intel/?menu-id=thinkpad_11e_3rd_gen_windows
where I have installed Ubuntu. I am trying to determine what version of opengl is supported on the laptop so I run:
glxinfo|more
which gives:
Extended renderer info (GLX_MESA_query_renderer):
Vendor: Intel Open Source Technology Center (0x8086)
Device: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2) (0x1916)
Version: 12.0.3
Accelerated: yes
Video memory: 3072MB
Unified memory: yes
Preferred profile: core (0x1)
Max core profile version: 4.3
Max compat profile version: 3.0
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.1
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2)
OpenGL core profile version string: 4.3 (Core Profile) Mesa 12.0.3
OpenGL core profile shading language version string: 4.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
GL_3DFX_texture_compression_FXT1, GL_AMD_conservative_depth,
GL_AMD_draw_buffers_blend, GL_AMD_seamless_cubemap_per_texture,
GL_AMD_shader_stencil_export, GL_AMD_shader_trinary_minmax,
From that it looks like the graphics card in the laptop supports opengl version:
Max core profile version: 4.3
But when I run:
glxinfo | grep "OpenGL version"
OpenGL version string: 3.0 Mesa 12.0.3
so maybe only version 3.0?
From this website:
https://learnopengl.com/#!Getting-started/OpenGL
seems some pretty significant architectural changes were introduced in version 3.3 so could be great if I can use that.
What of the above output tells me the correct version and can I use opengl 3.3 on this machine?
Seems I have 4.4:
Don't filter the output via grep, but read it all.
glxinfo reports separately:
the highest OpenGL Core Profile version available (in your case: 4.3)
the highest non-Core / Compatibility / < 3.2 OpenGL version available (in your case: 3.0)
the highest OpenGL ES 1 version available (1.1)
the highest OpenGL ES 2/3 version available (3.1)
The reason why Core and non-Core are reported separately is because drivers are allowed to not implement the Compatibility profile for OpenGL >= 3.2. That's precisely your case: Core gives you 4.3, non-Core only 3.0.
(Basically, OpenGL made a colossal and gigantic mess around the 3.0 and 3.1 versions. Nobody really talks about them. For mental simplicity, you can split the versioning between 3.2+ Core and pre-3.0. See also here).
Similarly, OpenGL ES 1 and 2/3 are not compatible between each other, so you need to query both to figure out what are the respective supported versions. (ES 2 and 3 are compatible between them, so they're in just one line).

Open GL version 2.1 instead of 3.2 on OS X 10.8

I have a late 2009 Macbook http://support.apple.com/kb/SP579
I upgraded the operating system everytime a new one came out, so I'm using 10.8 Mountain Lion now. I was trying to get a program to work when the developer suggested I check my Open GL version with glxinfo.
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce 9400M OpenGL Engine
OpenGL version string: 2.1 NVIDIA-8.12.47 310.40.00.05f01
OpenGL shading language version string: 1.20
OpenGL extensions:
According to this https://developer.apple.com/graphicsimaging/opengl/capabilities/
I should have Open GL version 3.2, but I don't. I've also looked for newer Nvidia drivers, but the nvidia drivers download website doesn't show any for OS X 10.8 (Mountain Lion), GeForce 9400M. The Open GL website says that unlike other operating systems, Open GL is updated along with the other OS X updates.
What do? How do I get OpenGL to 3.2?
I check my Open GL version with glxinfo
glxinfo goes through the X11 server. The OpenGL support of the X11 server which is shipping with OS X is rather limited. You must check with a tool that queries the native OpenGL API of OS X, not the GLX emulation layer.

How to use current version of opengl in cygwin?

I have been using OpenGL with cygwin for a few months to program some 3d applications. I now want to attempt to write some slightly more advanced techniques using things like vertex buffer objects. However, I noticed that I ran into an obstacle: when I use glGetString(GL_VERSION) in my program it spits out 1.4.
I compile my program with these flags: -lGL -lglut -lGLU -lGLEW and have included these headers: freeglut.h glew.h. I have chosen to link against the X11 libraries vs. the windows ones as explained here. My current OpenGL programs build and are able to run (because up until now, I have used older functionality--pre-OpenGL 1.4).
I have a new desktop computer with an ATI FirePro V4800 (FireGL) graphics card that can support up to OpenGL 4.1. I have installed the latest drivers and it passes the tests supplied by the program: OpenGL Extensions Viewer. In addition, the program shows that all the extensions up to and including 4.1 are available for my graphics card.
There is a brief mention here under the last answer saying that cygwin may want to use older dlls (ones that don't support shaders, etc.). Is this a cygwin problem? Will cygwin just not recognize my latest drivers and offer me the cool stuff in OpenGL 4.1? Or am I not linking to the correct libraries?
UPDATE
After getting to know how Cygwin's X Server works I figured I should switch to freeglut's native windows libraries. I grabbed the pre-compiled binaries found here and put the files in appropriate directories to link against them. After recompiling I am able to use all the options found in OpenGL as my graphics card permits (4.1).
When using Cygwin's X-server, start it with -wgl option (current versions do that automatically) then
export LIBGL_USE_WGL=1
On the machine I'm posting from, I get:
$ glxinfo | grep OpenGL
OpenGL vendor string: Intel
OpenGL renderer string: Intel(R) HD Graphics 2500
OpenGL version string: 4.0.0 - Build 9.17.10.3062
OpenGL shading language version string: 4.00 - Build 9.17.10.3062
[...]
Unsetting the environment variable:
$ glxinfo | grep OpenGL
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.4, 256 bits)
OpenGL version string: 3.0 Mesa 10.3.5
OpenGL shading language version string: 1.30
[...]

How can I check my OpenGL version?

when I run glxinfo I get:
...
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
server glx version string: 1.4
...
client glx vendor string: NVIDIA Corporation
client glx version string: 1.4
...
GLX version: 1.4
...
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce 9500M GS/PCI/SSE2
OpenGL version string: 3.2.0 NVIDIA 195.36.24
OpenGL shading language version string: 1.50 NVIDIA via Cg compiler
...
Without polling extension functionality, from what version's functions may I assume supported? Minimum of 1.4 and 3.2 seems incredibly historic, so I assume glx version is not numbered in parallel with OpenGL version...
What GLSL version may I assume? It displays the Cg compiler version, but what's my GLSL version?
GLX is the protocol that transports OpenGL commands in a X11 command stream. The most recent version of GLX is 1.4.
The OpenGL version is told in the "OpenGL version string". And you got 3.2
so I assume glx version is not numbered in parallel with OpenGL version...
No it's not, because they're two different things. GLX transports OpenGL, it doesn't implement it.
OK, basically it turns out that it is just what it says:
GLX version 1.4
OpenGL version 3.2
GLSL version 1.50 via NVIDIA Cg Compiler