OpenGL ES 3.x: Some functions seems missing

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

OpenGL ES 3.x: Some functions seems missing

Tianscar
Hi,

I'm writing an abstract API layer for OpenGL ES 3.x, the layer is fully compatible with Android's OpenGL ES API.
Compared to Android API, functions below seems missing:

OpenGL ES 3.0:

// C function void glGetBufferPointerv ( GLenum target, GLenum pname, GLvoid** params )

/**
 * The {@link java.nio.Buffer} instance returned by this method is guaranteed
 * to be an instance of {@link java.nio.ByteBuffer}.
 */
public static native java.nio.Buffer glGetBufferPointerv(
        int target,
        int pname
);

OpenGL ES 3.2:

// C function void glGetPointerv ( GLenum pname, void **params )

public static native long glGetPointerv(
        int pname
);

// C function void glDebugMessageCallback ( GLDEBUGPROC callback, const void *userParam )

public interface DebugProc {
        void onMessage(int source, int type, int id, int severity, String message);
}

public static native void glDebugMessageCallback(DebugProc callback);


Reply | Threaded
Open this post in threaded view
|

Re: OpenGL ES 3.x: Some functions seems missing

gouessej
Administrator
Maybe look for glGetPointeri_vEXT​.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: OpenGL ES 3.x: Some functions seems missing

Sven Gothel
Administrator
This post was updated on .
In reply to this post by Tianscar
We must track the buffers bound via glBindBuffer() ourselves.
To retrieve the bound buffer you may use getBoundBuffer(..), getBufferStorage(..)
https://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GLBase.html#getBoundBuffer(int)
https://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GLBase.html#getBufferStorage(int)

Yes, its our client side tracking and implementation, hence no 'gl' prefix,
see overview in GLBufferStorage
https://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GLBufferStorage.html

The (NIO) buffers are tracked to ensure their lifecycle matches their OpenGL counterpart (lifecycle/usage).

We could implement glGetBufferPointerv() using the above, but didn't so far but excluded their binding.

Hope that helps a little

Test Case: /jogl/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMapBufferRead01NEWT.java
Reply | Threaded
Open this post in threaded view
|

Re: OpenGL ES 3.x: Some functions seems missing

Sven Gothel
Administrator
In reply to this post by Tianscar
.. further .. re OpenGL debugging.

I also have chosen to divert a little from the OpenGL API,
exposing the driver's debug facility.

See GLDebugListener
https://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GLDebugListener.html

Details on how to enable native GL debugging is described in
https://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GLContext.html#enableGLDebugMessage(boolean)

.. here we also explain how to ensure the context is debug capable via CTX_OPTION_DEBUG
https://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GLContext.html#CTX_OPTION_DEBUG

Test case: /jogl/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug00NEWT.java

+++

Reply | Threaded
Open this post in threaded view
|

Re: OpenGL ES 3.x: Some functions seems missing

Sven Gothel
Administrator