Using libGdx desktop port as emulator of Android GLES20 - java

My Android OpenGL-ES 2.0 project don't even run on Android emulator (GPU host) or virtual machines (Androidx86.iso + VirtualBox), but no problem with physical android devices.
so, can i use libGdx desktop port for emulation of Android GLES20 without integrating other libGdx stuff in my android project?
if yes, then how to load shaders from android's RAW folder without libGdx framework?!
beside libGdx, i find a working wrapper
but if i have to maintain a wrapper by myself, then NDK+GLUT isn't faster option?

You can do something like that. It is what libgdx wiki says:
Clearly there's no OpenGL ES implementation on the desktop useable via
Java. Well, there is now. Libgdx emulates OpenGL ES via the standard
OpenGL API on Windows and Linux. Nearly all features are supported
such as fixed point math and so on. The only feature missing at the
moment is support for fixed point vertex buffer objects and some minor
getter methods.
Here is tutorial how you can use libgdx with lwjgl backend.
Here is how shader programs are initialized.
You can see from the link above how shaders are loaded from resources.
Here is what ShaderProgram does under the hood.
You can see what it calls some functions of gl object which contains methods emulating opengl es 2.0.

Related

Rendering Java Android OpenGL ES on Windows

Background :
I'm currently making an Android Native game only using Java and OpenGL ES 3.0 and I wanted to make a simple Game Engine without copying my full Java project in C++ so I could have the same project on my Windows PC.
I would like to use some of my existing Java files my Android Studio Project is using, and to run them on a different window context on my PC. I would certainly make some separate Classes to set a OpenGL window and to have a main function.
My questions are :
What API should I use to create an OpenGL context in Java?
Will the included libraries in my Android Project Files (like android.opengl.GLES30) be found if I used a different IDE (like IntelliJ)?

Android Open GL interfaces

I'm working in a AR (augmented reality) Android app with android studio and I wonder if there is any framework to create Open GL user interfaces, like dialogs, buttons, image and video containers and so on... Any Ideas?
Have you considered using Viro?
https://viromedia.com/viroar/
We offer both a React-Native (ViroReact) and a native Java API (ViroCore).
You won't be coding in OpenGL yourself (we write the renderer), but you get an easy-to-use scene-graph API. ViroCore is analogous to SceneKit, but for Android.
It's free to use and distribute!
Check out our:
Docs: https://virocore.viromedia.com/docs/getting-started
Samples: https://github.com/viromedia/virocore
Let us know if you have any questions!
Disclaimer: I do work at Viro, if that wasn't obvious :)

OpenGL not supported by video driver

I installed libGDX and wrote a simple code to display a window. But when I run it, I get an exception that says : OpenGL is not supported by video driver. Then I installed GLEW (OPENGL EXTENSION WRANGLER LIBRARY). Then I went to the installation folder, unzipped the contents to a new folder, went to the new folder, clicked on bin, release, win32, and finally glewinfo. It opened a notepad file that showed me that name of my video card and said that it supported OpenGL 2.1. But in eclipse (mars) and libgdx (gdx-setup tool) i cant get my program to run even if i set config.useGL30 = false. Pleaee help!
There is a difference between OpenGL ES and OpenGL.
OpenGL is the desktop version.
OpenGL ES is the mobile version.
libGDX uses OpenGL ES since it runs on mobile and desktop.
To run OpenGL ES 2.0 you need OpenGL 4.1 on a desktop.
To run OpenGL ES 3.0 you need OpenGL 4.3 on a desktop.
EDIT according to derhass
Note that this are only the specifications and actual implementations can provide full support for OpenGL ES 2.0/3.0 prior to these versions.
But this seems not to be the case for your setup.

How to run libGDX headless, without GPU, but still rendering frames?

I'm looking into running libGDX based app on a Ubuntu Server. The server has no GPU. The purpose is to render animations defined as libGDX "games". The perfect setup would pipe frames out to standard output. I'm OK with some kind of software-simulated GPU.
I'm aware of libGDX headless mode, but as far as I understand it will not render any graphics.
LibGDX on Linux depends upon the LWJGL library for setting up rendering support. So, what you want to find out is if/how LWJGL can run without a GPU. Both LibGDX and LWJGL expose fairly low-level OpenGL commands, so I think what you need is the Mesa library (it exposes OpenGL support, but does everything in software).
From this question:
Does LWJGL (bare) use software or hardware rendering? it looks like you can ask LWJGL to not require hardware support. But, I think you still need some software-support enabled (and I believe that would be Mesa).
If you get this stack working, I think the next step is to have your "game" render to a FrameBuffer and then use Libgdx to render the FrameBuffer to file inside libgdx or OpenGL. (There may be ways to get lower layers of the stack to render to a file, too.)

OpenGL - OS X using GL11

I was developing a game in Java & OpenGL on Windows and yesterday I got a new Macbook Pro.
When I moved my code from the Windows machine to the OS X machine I got an error that said couldn't compile shaders. I read on the internet that it's because in OS X you have to turn ProfileCore to true which is only supported in OpenGL 3.2 + . Here is my problem: For my GUI and my Text I use GL10 functions and I use the Slick2D library. When-ever I set my OpenGL version to be 3.2 with core profile the game runs fine but I get an error on Slick2D code.
I wanted to know if there was a way to run OpenGL with core profile but not 3.2
Is there a library for text like Slick2D that supports OpenGL 3.2 or will I have to create my own support of texture atlases and stuff for the text.
I do not have enough reputation to comment, so I must write this as an answer.
The core profile is a configuration in OSX which sets the used OpenGL version.
https:// developer.apple.com/graphicsimaging/opengl/capabilities/
Slick2D should support lower OpenGL Versions. I have used it with OpenGL version 2.1 on Linux and Windows. My Application also ran in OSX.
Try out core profile version 2.1. This is the version that was most compatible to PCs (and Macs) in my testing.
I do not fully understand your second question. Are you looking for an alternative engine?
I can recommend libGDX for cross-platform game development with Java. (http://libgdx.badlogicgames.com/)
If you are open to non-Java Game Engines, you can use Unity3D of course. (http://unity3d.com/)

Categories