dtech
dtech

Reputation: 49289

Cross platform hardware-native OpenGL library, possibly with multimedia?

I am looking for the ability to open OpenGL contexts and draw native OpenGL in windows, macOS, linux distros with X, android and iOS

I don't want to rely on the "native" device framework for the actual UI, I don't need to use native components, all I want is an OpenGL context to natively draw in OpenGL. Many of the cross platform SDKs like Marmalade and MoSync focus on making use of the native UI components and stuff like that, all I need is an OpenGl context to draw as I intend to, absolutely no native UI functionality is required, however, access to native hardware features like microphone, camera and other sensors is desired if possible, as well as access to audio/video/network.

I don't want to use QT, I want to do something that is closer to the hardware to work on the low level. The general idea is to make a lightweight cross platform hardware accelerated GUI, written on a level low enough to be truly hardware native, without relying on any native software framework. I know for android I may have to use a java wrapper to launch the native code, but the idea is to have this wrapper minimized, with very little modifications needed to deploy the low level and thus hopefully TRULY cross-platform code, that is only dependent on OpenGL hardware and OpenGL context for it to work wit.h

So I need a bare minimum solution to avoid using non-cross platform features as much as possible.

At the time the only library that comes to my mind is SDL, but I am not sure it supports android and iOS property, so besides library recommendations, more information on how SDL handles android and iOS devices and their hardware is welcomed too.

Upvotes: 2

Views: 1185

Answers (2)

rubenvb
rubenvb

Reputation: 76579

What you want is nothing more than a platform-specific OpenGL context setup (which is quite simple and well documented: the NeHe OpenGL tutorial provides code for many environments that does just this here (the explanation is Windows specific, scroll down for the code on different OSes).

Once you have the OpenGL context, nothing prevents you from creating a full GUI with all OpenGL elements.

If you want, you could use Qt to only set up an OpenGL context (ie don't use any QWidgets or anything, other than the window showing you your OpenGL scene). It takes care of the whole setup process, but for only that, Qt becomes a huge dependency, as it only really replaces at most 100 lines of code per platform.

With regards to SDL+Android, have you checked the README?

And for iOS check the same file here.

Upvotes: 3

datenwolf
datenwolf

Reputation: 162194

How about:

  • GLFW
  • SDL
  • GLUT (FreeGLUT or OpenGLUT)
  • Blender's GHOST framework?

Essentially they open a window, create a OpenGL context on it, deliver you the input events and leave the rest up to you.

Upvotes: 4

Related Questions