Force Unreal Engine to use opengl on windows executable - opengl

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.

Related

How to set up mac for graphics programming to use openGL?

I am a new to programming and also to this platform so i apologize if
my question is not proper or seems stupid but i need help .None of the
resources on internet have been useful to me . If possible please
provide step by step instrction to set up mac for graphics
programming. thank you in advance.
I am a new to programming and i am trying to learn graphics programming .Till now i write c/c++ code in a text editor and compile and execute them to see the output in shell . I searched the web for setting up mac for opengl projects but none of them come close to clearing my doubts . Here are the doubts/questions :
my computer: macOS-Mojave :macbook pro mid 2012 (intel hd graphics 4000) supports openGL 4.1 according to apple website
1. do i have to download some files to use openGL ? or is it just a an api implemented by the computer hardware manufacturer(here apple in my case ).
2. according to recent news apple deprecated openGL. And i don't know which version of openGL is on my macbook . is there a way to find out ?None of the answers listed have worked for me.
3.Can i compile openGL code through terminal like i have been doing till now or do i have to use xcode ?
1. do i have to download some files to use openGL?
So far, not yet. Everything required ships with the compilers by default. You just add -framework OpenGL to your compiler invocations and are good to go.
2. according to recent news apple deprecated OpenGL. And i don't know which version of openGL is on my macbook. is there a way to find out? None of the answers listed have worked for me.
You're mixing two different concepts here:
The deprecation of OpenGL in the macOS platform means, that OpenGL will disappear from that OS altogether, irrespective of what OpenGL version actually is supported. Eventually you'll have to either move to Metal, or use some wrapper like MoltenGL (which implements OpenGL on top of Metal) or MoltenVK (which implements Vulkan on top of Metal).
With macOS the highest OpenGL version supported is determined entirely by the version of macOS installed. That is different from other OS, where a mere driver update may give you a higher OpenGL version, as long as the installed graphics hardware meets the requirements of that higher OpenGL version.
3. Can i compile openGL code through terminal like i have been doing till now or do i have to use xcode?
Yes. And there's no difference between compiling from the command line, and through Xcode, because Xcode is just doing the very same command calls as you'd do through the terminal.

Is there a built-in OpenGL GUI windowing library in XCode 6 (OS X 10.10)?

I am trying to develop a C++ application that uses OpenGL. I set up everything in XCode 6.4 (running on OS X 10.10.5) and I was able to get the OpenGL framework working. However, I can't figure out how to draw the graphics to a GUI window.
I know that GLUT is available, but it is deprecated and I'd rather avoid using it. Instead, is there a way of using some of Apple's native windowing systems (I assume there should be something available in the Cocoa API)?
I would rather avoid downloading additional libraries like SDL or Qt since I do not have root access on this machine and maintaining third-party libraries those may be challenging.

Setting up modern OpenGL with Visual Studio 2013

I have been coding OpenGL for a while now using Java and LWJGL. However recently I decided that I would switch from Java to C++.
I managed to set up OpenGL with Visual Studio 2013, and had some fun with that. However I am used to using modern OpenGL (shaders, vbo's, vao's etc...), and I believe what I am looking for is OpenGL ES.
I have been using the GLFW library to create a window with OpenGL context, so how do I do this with OpenGL ES.
I tried adding the #define GLFW_INCLUDE_ES31 line to above the glfw3.h include, however then it cannot find the GLES3/gl31.h header file. I don't know how to obtain this file on my computer, because the GL/gl.h file was just on my computer by default.
Am I supposed to download it?
Apparently OpenGL ES is aimed at smartphones or less powerful devices, so I was wrong in thinking I wanted to use OpenGL ES. In that case, how can I use these newer functions within Visual Studio, and C++. At the moment I only seem to have access to OpenGL 1.1 functions.
You are lacking a loader (GLEW for example)
"just" add it to your project and you will be able to use the GL_ functions again

Qt C++ Library for Windows and OpenGL

I am trying to experiment with the Qt library on Windows. On their downloads page, I notice that the binaries built using VS2012 are available in two forms, with and without OpenGL. What exactly is the difference between the two? In the OpenGL version, do they have some special API implemented using OpenGL or does all of Qt rendering depend on OpenGL? Also, is there a version of Qt that uses DirectX?
#Raman: The opengl variant is using the desktop opengl version just like with Qt4.
The non-opengl variant is using angle, and you need to have that installed alongside the DirectX SDK to get it working. Angle is an adapter between the directx and the opengles API. Only the latter is support directly by Qt, but unfortunately directx drivers tend to work better on Windows than the opengl(es) ones. There are no plans to support a directx backend inside Qt, so we leave with Google's Angle work in that regard.
As for providing some extra bit, there was a discussion about it recently on the mailing list, that this decision should not be build time, but more like run time. However, no one has stood up just yet to make that work. Hopefully, that will change soon. It is causing confusion for the end users just like, so do not feel alone. ;-)
Hope this explanation helps.
DirectX is supported via the ANGLE based library.
Note that this has changed and as of Qt 5.5 the prebuilt binaries you can download from the Qt website are configured with the -opengl dynamic option. This is what #lpapp above was talking about. Qt defaults to choosing either native OpenGL drivers or ANGLE at run time now.
Qt internally uses OpenGL to render unless you specify otherwise now. You can also render custom OpenGL content using Qt's QOpenGLxxx functions and classes.
For a simple introduction to Qt and OpenGL that covers this and more click here.

Compiling/Running C++ code on iPhone

I have recently created an Asteroids game/app for one of my CS classes with openGL, GLU and C++ for Linux. The teacher told me that if I get it to run on the iPhone he would give me extra credit. I have been looking around and I think I have to develop/port it to Objective C using the iPhone Development Kit. My questions are:
Would this be easy to port?
Can I install the Development Kit on Windows, or Linux (I do not have a Mac).
Is there an alternative way (shortcut) to maybe emulate Linux binaries on the iPhone?
I have not tried anything yet, because I would like to know first what you guys think. You do not have to tell me exactly what to do, but I would highly appreciate if you would point me in the right direction.
Thanks.
Well, if you don't want to port your program into another language. You CAN use SDL2, it seems pretty stable and it works on iOS (iPhone/iPad/iPod Touch). All you would have to do is change your code and then play around with the controls. You'll have to clone the Mercurial repo from http://hg.libsdl.org/. It will come with a README.iOS file, in which describes how the port works and some other details. I am not sure if it has multi-touch support yet, I have not tested it.
Also, you can use immediate mode on the iPhone, you just can't use OpenGL ES 2 if you do that. All you have to do is make a context for OpenGL ES 1.1.
And you WILL need a Mac, or perhaps you could get a Hackintosh to compile your code and then run it with a jailbroken iPod/iPhone/iPad.
NOTE:
I believe I have heard of some people compiling their code on a Hackintosh and then submitting it to the app store from a Mac within an Apple store.