I am planning to use Ubuntu with QT Creator to study and develop OpenGL ES 2.x applications. it is obvious that OpenGL ES 2.x is not easy to be configured in desktop environment, and OpenGL ES is sub-specification of OpenGL.
So I want to know if it is possible to develop the core part of OpenGL ES 2.x application in OpenGL environment and move my code to android or iOS to develop GUI later?
Not easy to configure? I beg to differ. Just get an emulator like the one Mali has, and let your program use their libraries instead of system ones directly.
Then you can be pretty sure that the GL code should be fine, as long, of course, as you will manage to run it on iOS(Obj-C++?) or Android(NDK?).
Qt5 is built with OpenGL ES 2.0 by default, so if you use current Qt you will have it out of the box, also Qt developers tell that they will support both android and iPhone in 5.2 version.
Mesa implements both regular OpenGL and OpenGL ES: http://www.mesa3d.org/opengles.html.
OpenGL ES 3.0 is supported on select GPUs too, AFAIK.
There's also cross-API compatibility built into most OpenGL libraries, so you can compile and run OpenGL ES code with no or minimal changes. You do need to work out platform specifics like setting up a render context, framebuffers and doing the actual drawing. But this is not GL/GLES specific.
ES API compatibility has been around since OpenGL 3.2 with most calls supported. The remaining ones were added by the ARB_ES2_compatibility extension, which is part of OpenGL 4.1. OpenGL 4.2 adds full OpenGL ES 3.0 support.
And yes, it works well. I've been running the same ES code on both Android, Linux, Mac OS X and iOS myself. It just needs a little bit more work than single platform support.
I've a own engine which implements ES 2.0 on iOS and Windows, so its working on both systems. You just have to care about unsupported formats and methods ( like pvrtc which is not supported on windows, so i wrote a converter ).
To make it easy i first implement everything on iOS so i know its working, after that i porting it to windows. Currently i've just around 1000 Lines of code which differ on each platform ( But i'm using Xamarin ).
Related
I'm attempting to make a video game in Unreal Engine 4.9. I'm building it for Windows, but I'd like to have it use opengl instead of directx in the executable. However, I've found no options that let you do this. Unreal Engine uses OpenGL when it creates executables for Linux and Mac, but there seems to be no way to use OpenGL with Windows.
Am I missing something? Is there some way to force Unreal Engine to use OpenGL in Windows executables?
EDIT: The reason I want to use OpenGL is because I want this game to run without having to install anything on the end user's computer (DirectX has to be installed to work)
Microsoft doesn't really support OpenGL, they typically go out of their way to make it very difficult to use OpenGL on Windows and strongly encourage people to use DirectX instead.
The simplest way to get a working OpenGL context in windows is sometimes to use ANGLE which is a compatibility layer which translates OpenGL calls to DirectX calls. This is what Chrome and Firefox use to support WebGL on windows. I doubt that Unreal Engine is integrated with this, so you might have a hard time.
Edit:
EDIT: The reason I want to use OpenGL is because I want this game to run without having to install anything on the end user's computer (DirectX has to be installed to work)
One thing you could do is cross-compile the Mesa3D drivers, as described here: https://wiki.qt.io/Cross_compiling_Mesa_for_Windows
But then you won't get hardware acceleration.
I want to use latest OpenGL features on Ubuntu. And I have installed mesa-common-dev but as far as I understand mesa does not support OpenGL 4.5 features. Also how can I use OpenGL via hardware without any API ?
Note :
glxinfo | grep "OpenGL version"
OpenGL version string: 4.5.13397 Compatibility Profile Context 15.20.1046
I want to use latest OpenGL features on Ubuntu. And I have installed mesa-common-dev but as far as I understand mesa does not support OpenGL 4.5 features.
All that matters is, that your actual OpenGL implementation supports the profile you want. The Linux ABI on OpenGL is pinned to OpenGL-1.2 (LSB5 has been released recently, so expect upcoming distribution releases to follow it, which bumped it to OpenGL-2.1).
Anything that goes beyond the ABI requirements is done through the extension mechanism. I.e. use load function pointers through …GetProcAddress and introduce new tokens with a glext.h. This processes has been repacked into OpenGL extension wrapper-loader libraries like GLEW.
The stuff mesa-common-dev provides is what's written down in the Linux LSB ABI specs… in a vendor neutral way, so you can compile your program using mesa-common-dev stuff, but it will work with the NVidia or AMD/ATI drivers as well.
Also how can I use OpenGL via hardware without any API ?
By definition you can't. OpenGL is an API. If you remove the API you remove OpenGL. If your intention is working the naked GPU on the bare metal, well, that would boil down to writing a full driver. In a few weeks/months Vulkan will be released and this gets you much closer to the GPU than OpenGL.
I am trying to use Cairo library in a C++ application utilizing its GL acceleration in Mac. (I made same tests with its Quartz backend but the performance was disappointing.) It says it supports EGL and GLX. Use of GLX requires (externally installed) XQuartz and opens an XWindow so I lean towards EGL:
Apple's programming guide pages tell to use NSOpenGL*, which this page and others say it uses CGL.
This (2012) page says Mac has EAGL and it is only similar to EGL (I suppose it refers to IOS, not MAC as its EAGL reference links to IOS help pages).
Angle says it supports EGL but it is for Direct3D in windows, as I understand(?)
GLFW v3 is also said to support (in future releases?) but via GLX, it is said (?).
Mali says it has a simulator for Mac but I don't know if it is accelerated or is only for its hardware (it also says it only supports a subset of EGL on different platforms).
Most of the links refer to mobile when EGL is used. I am using Mac OS 10.8 and XCode 4.6. What is the current situation / How can I (if I can) use EGL in Mac (now)?
Here it is
https://github.com/SRA-SiliconValley/cairogles/
clone cairo, checkout branch nsgl. This cairo is our fork of cairo 1.12.14 that has the following enhancement vs the upstream cairo
support OpenGL ES 3.0, and support OpenGL ES 2.0 angle MSAA extension
new convex tessellator for fill circle for msaa compositor
new cairo API - cairo_rounded_rectangle() - it is optimized for MSAA compositor
support gaussian blur for four backends: GL/GLES, quartz, xcb and image
support drop shadow and inset for four backends: GL/GLES, quartz, xcv and image with shaow cache
support faster stroke when stroke width = 1 - we call hairline stroke
add integration for NSOpenGL
various bug fixes and optimization.
On Mac OSX, you have two choices: GLX or NSOpenGL - they are mutually exclusive. You can get mesa glx from macport.
1. To compile for NSOpenGL - ./configure --prefix=your_install_location --enable-gl=yes --enable-nsgl=yes --enable-glx=no --enable-egl=no
To compile for GLX - ./configure --prefix=your_install_location --enable-gl=yes --enable-glx=yes --enable-nsgl=no --enable-egl=no.
If you are interested in egl (no available on mac, but mesa 9.1+ on linux and various embedded platform form has egl) do
./configure --prefix=your_install_location --enable-gl=no --enable-egl=yes --enable-glesv2=yes --enable-glesv3= no ===== this compiles for gles2 drivers.
./confgure --prefix=your_install_location --enable-gl=no --enable-egl=yes --enable-glesv2=no --enable-glesv3=yes ==== this compiles for glesv3 driver (mesa 9.1+ has glesv3)
you can have CFLAGS="-g" for debug or CFLAGS="-O2" for optimization.
cairo gl/gles has 3 GL compositors (rendering paths for GL/GLES backend). The default one is span compositor which is software simulation of AA and is slow. If your driver supports MSAA, use msaa compositor. To use MSAA compositor, you can export CAIRO_GL_COMPOSITOR=msaa in terminal, or you can setenv() in your program.
I have sample code to show cairo for quartz, xcv, image, glx, gel or nsgl. If you are interested, I can send you.
Any bug reports/patches are welcome. I have not have time to get wgl (MS windows) to work yet. Additional, it would be nice to have a d3d backend for cairo, I just don't have time to do that - on the todo list.
Enjoy
yes. cairo has been ported to use nsopengl. I will show you howto. amd sample code if you are interested. performance is much faster than quaetz gl.
You definitely can use angle:
#define GL_GLEXT_PROTOTYPES
#include <GLES2/gl2.h>
#include <EGL/egl.h>
I would like to build a cross platform OpenGL program using 3.3 on windows and linux.
I would also like to port it to android, although I'm not sure which ES version is most compatible with 3.
With my experience it's OpenGL ES 2.0.
Only one thing, I wrote small shader parser which is doing transformation shaders from GLSL 1.1 to 1.5.
I have heavy app which is runs on Mac, iOS and Android.
But maybe better for you to use some small engine.
This is a very specific questions about the steps necessary to Build a simple OpenGL ES 2.0 program on the Windows platform. The environment is Visual Studio with unmanaged C++.
I go to the Khronos.org site and, frankly, find it a bit opaque because it reads like something written by a standards body. I don't want to download a "reference" or a "specification", etc.
All I'm looking for are the links and steps to get me from A to B. In other words, "Download these files or run this setup at this URL. Create a new Visual studio project with references to these libraries. Include this header file."
Again, I'm interested in ES 2.0.
I have been using googles Angle Project. It converts opengles 2.0 to DirectX 9 calls for win32. It works fairly well and even has quite a few examples. Its also the BSD licence so anything you make you can use the source for your own projects.
After alot of digging around for the same thing. I found an emulator for openGL es 2 from PowerVR: http://www.imgtec.com/powervr/insider/sdkdownloads/index.asp
The AMD one linked above is no longer available or supported.
AMD bundle OpenGL ES with their normal Catalyst drivers (for Win & Lin).
You just need to use EGL to get OpenGL ES context! (And have to use headers/includes from AMD OpenGL ES SDK).
AMD users already have everything they need to run your app.
Every doc about EGL and OGL ES is valid.
It work on AMD only.
PS Yes it is different from OLD/DEPRECATED OpenGL ES emulator. Because it is native!!!
AMD now ship a desktop OpenGL ES 2.0 version with EGL library
http://developer.amd.com/tools/graphics-development/amd-opengl-es-sdk/
You can have a look at Angle Project which brings OpenGL ES to desktops. It works pretty good and not that hard to setup: http://code.google.com/p/angleproject/
OpenGL ES is not generally available for Desktop machines. It is intended for embedded systems, hence the name - ES: Embedded Systems.
There isn't a native implementation available (the ES stands for Embedded Systems after all), but you could try ATI's OpenGL ES Emulator.
edit: 3/3/12 It looks like AMD has discontinued their support of the simulator.