GLExt crashing

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

GLExt crashing

Ryan Joseph
Functions like glBlendEquation from GLExt are crashing (access violation) compiling on Mac with ppc386. The functions didn’t get loaded I think for some reason.

Is this is known problem on Mac with a work around perhaps?

Thanks.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: GLExt crashing

Michalis Kamburelis-3
Ryan Joseph wrote:
> Functions like glBlendEquation from GLExt are crashing (access violation) compiling on Mac with ppc386. The functions didn’t get loaded I think for some reason.
>
> Is this is known problem on Mac with a work around perhaps?
>

GLExt works fine on Mac (and other platforms) in my experience. You just
have to load the necessary OpenGL version (or extension) first.

For glBlendEquation, you want to call Load_GL_version_1_2, and then
(assuming Load_GL_version_1_2 returned true) glBlendEquation will be
non-nil and will work OK.

Regards,
Michalis

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: GLExt crashing

Ryan Joseph
Thanks I didn’t know any loading had to be called.

Does this work on OpenGLES 1.x do you know? I’m going to try this on iOS also.

> On Jan 29, 2016, at 10:20 AM, Michalis Kamburelis <[hidden email]> wrote:
>
> For glBlendEquation, you want to call Load_GL_version_1_2, and then
> (assuming Load_GL_version_1_2 returned true) glBlendEquation will be
> non-nil and will work OK.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: GLExt crashing

Ryan Joseph
Just tested on iOS and I get that error. I think on iOS it loads from the OpenGLES.framework and therefor this is failing. Also that load function wasn’t available but it failed upon including the GLExt unit.

An unhandled exception occurred at $00000001000CDEF7:
Exception: Could not load OpenGL from /System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib
  $00000001000CDEF7
  $00000001000D0F85


> On Jan 29, 2016, at 10:40 AM, Ryan Joseph <[hidden email]> wrote:
>
> Does this work on OpenGLES 1.x do you know? I’m going to try this on iOS also.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: GLExt crashing

Michalis Kamburelis-3
Ryan Joseph wrote:
> Just tested on iOS and I get that error. I think on iOS it loads from the OpenGLES.framework and therefor this is failing. Also that load function wasn’t available but it failed upon including the GLExt unit.
>
> An unhandled exception occurred at $00000001000CDEF7:
> Exception: Could not load OpenGL from /System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib
>   $00000001000CDEF7
>   $00000001000D0F85
>
>

Um, GLExt is for OpenGL, it loads OpenGL extension, *not* for OpenGLES.
For Android and iOS, use GLES20 unit. My Castle Game Engine uses this
for Android and iOS and it works cool:)

Michalis
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: GLExt crashing

Ryan Joseph
I’m using OpenGLES 1.1 because it was easier to learn but I don’t see glBlendEquation being included in the GLES11 unit. Maybe it didn’t exist until OpenGLES 2.0?

> On Jan 29, 2016, at 11:02 AM, Michalis Kamburelis <[hidden email]> wrote:
>
> Um, GLExt is for OpenGL, it loads OpenGL extension, *not* for OpenGLES.
> For Android and iOS, use GLES20 unit. My Castle Game Engine uses this
> for Android and iOS and it works cool:)

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: GLExt crashing

Michalis Kamburelis-3
Ryan Joseph wrote:
> I’m using OpenGLES 1.1 because it was easier to learn but I don’t see
> glBlendEquation being included in the GLES11 unit. Maybe it didn’t
> exist until OpenGLES 2.0?
>

Indeed, glBlendEquation is simply not available in OpenGLES 1.1.

See the specs: https://www.khronos.org/opengles/ , e.g. the list of
OpenGLES 1.1 functions on
https://www.khronos.org/opengles/sdk/1.1/docs/man/ .

Michalis
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: GLExt crashing

Ryan Joseph
Is it available in any version before 2.0 do you know? I don’t know much about OpenGL but there is a 1.5 version also which maybe has it.

I found this page also which suggests it exists on some 1.x version.

http://stackoverflow.com/questions/17457327/blending-issue-porting-from-opengles-1-0-to-2-0-ios

> On Jan 29, 2016, at 11:14 AM, Michalis Kamburelis <[hidden email]> wrote:
>
> Indeed, glBlendEquation is simply not available in OpenGLES 1.1.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: GLExt crashing

Reimar Grabowski
On Fri, 29 Jan 2016 11:30:25 +0700
Ryan Joseph <[hidden email]> wrote:

> Is it available in any version before 2.0 do you know?
No.

> I don’t know much about OpenGL but there is a 1.5 version also which maybe has it.
Of course it has it but it is OpenGL 1.5 not OpenGL ES 1.5.

> I found this page also which suggests it exists on some 1.x version.
> http://stackoverflow.com/questions/17457327/blending-issue-porting-from-opengles-1-0-to-2-0-ios
It's not in the specs so maybe Apple just added it for their implementation. You may want to take a look at the corresponding C header files provided by Apple.

Btw official specs and header files can be found here: https://www.khronos.org/

R.

P.S.: If your hardware allows move on to shader based OpenGL as the fixed function pipeline is inefficient on modern hardware and it teaches bad habits (like immediate mode usage or usage of glMatrix* calls).
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: GLExt crashing

Michalis Kamburelis-3
In reply to this post by Ryan Joseph
Ryan Joseph wrote:
> Is it available in any version before 2.0 do you know? I don’t know
> much about OpenGL but there is a 1.5 version also which maybe has
> it.
>

Before OpenGLES version 2.0 (shader pipeline), you only have OpenGLES
1.1 and OpenGLES 1.0. See https://en.wikipedia.org/wiki/OpenGL_ES and
https://www.khronos.org/opengles/1_X/ . Although OpenGLES 1.1 was based
on (desktop) OpenGL 1.5, which included glBlendEquation (you can see it
in https://www.opengl.org/documentation/specs/version1.5/glspec15.pdf ).
But I guess glBlendEquation was not included in OpenGLES for simplicity
--- OpenGLES was, by design, a very "trimmed down" version of (desktop)
OpenGL.

And "glBlendEquation" is not available in OpenGLES 1.1. You have
"glBlendFunc" in 1.1, but it only allows you to specify blending
parameters, while blending equation is "hardcoded". Effectively,
OpenGLES 1.1 always behaves like

  glBlendEquation(GL_FUNC_ADD)

was called. You can see it e.g. by comparing glBlendFunc specifications
for 1.1 and 2.0:
- https://www.khronos.org/opengles/sdk/1.1/docs/man/glBlendFunc.xml ,
- https://www.khronos.org/opengles/sdk/docs/man/xhtml/glBlendFunc.xml

In 1.1 version, the equation is simply hardcoded, while in 2.0 it can be
configured by glBlendEquation.

Hmm, but there's this extension:
https://www.khronos.org/registry/gles/extensions/OES/OES_blend_subtract.txt
. If this extension is supported, you could load glBlendEquationOES
function, which should be what you need.

I'm not sure why the thread on
http://stackoverflow.com/questions/17457327/blending-issue-porting-from-opengles-1-0-to-2-0-ios
suggests that glBlendEquation was used in OpenGLES 1.1. Maybe it's an
Apple extension that, once you have OES_blend_subtract, you can load
entry point "glBlendEquation", without "OES" suffix? Or maybe the poster
on stackoverflow just simplified his/her code, to simplify the question?

Regards,
Michalis
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: GLExt crashing

Ryan Joseph
Thanks for your response.

I’m seeing the method glBlendEquationOES in Apple’s headers so I assume this is available in the OpenGLES framework included with iOS (8.0 at least). Not sure how to load the extension though...

I’ll probably just deal with the default blending equation until I can implement 2.0. I was using glBlendEquation(GL_FUNC_ADD) anyways so that’s good to know I can just leave that line out and it will behave that anyways.

> On Jan 29, 2016, at 7:05 PM, Michalis Kamburelis <[hidden email]> wrote:
>
> Hmm, but there's this extension:
> https://www.khronos.org/registry/gles/extensions/OES/OES_blend_subtract.txt
> . If this extension is supported, you could load glBlendEquationOES
> function, which should be what you need.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal