B4A Library OpenGL 2.0 library

walterf25

Expert
Licensed User
Longtime User
Hi @agraham, first off thank you very much for wrapping this library, i am currently wrapping at AR library and it requires the use of the GLSurfaceView View, i had no idea that you had wrapped this library before I started wrapping my AR library, i had already wrapped some of the Opengles2.0 classes when I realized there was already this library in the forums, i was able to get some of the AR examples to compile and run just fine with B4A, i am now trying to finish wrapping some of the last classes of this AR library before releasing it to the forums, however i was wondering if you would be willing to add some more functions to your library.

I noticed that you have GLBufferDataF and GLBufferDataI for floats and integers, however I need to also have a GLBufferDataB which would take an array of bytes and another maybe GLBufferDataS which would take an array of shorts, as this library i am wrapping requires this two methods, everything else seems to have already been wrapped in your library.

Please let me know if that would be possible I realize you may be very busy as i have been this last few months wrapping this library as well.

Thanks in advanced.
Walter
 

agraham

Expert
Licensed User
Longtime User
It's nearly six years since I last looked at this and returned to desktop development only so I've forgotten almost everything about it. However here's the Eclipse project for the library, perhaps that will be of some use.
 

Attachments

  • OpenGL2.zip
    42.2 KB · Views: 429

walterf25

Expert
Licensed User
Longtime User
It's nearly six years since I last looked at this and returned to desktop development only so I've forgotten almost everything about it. However here's the Eclipse project for the library, perhaps that will be of some use.
Thanks @agraham I added the functions I needed, i have increased the version to 1.5, would you mind uploading it and edit your first post, i got my AR library working, i'm ready to upload a beta version of it, there's still something to iron out but for the most part it works as expected.

Here's the updated version.
I added the following function
B4X:
    public void glBufferData(int target, int size, Buffer buffer, int type) {
        GLES20.glBufferData(target, size, buffer, type);
    }
and this one as well
B4X:
    public void glDrawElements2(int mode, int count, int type, int offset) {
        GLES20.glDrawElements(mode, count, type, offset);
    }
On my AR library wrapper there was a need for the glBufferData function but needed to pass a Buffer type.
For the glDrawElements function i needed to pass the mode parameter, count param, type param and offset param.

Anyhow, thank you very much for wrapping this library, it definitely saved me some time as I didn't have to wrap this library.

Walter
 

Attachments

  • OpenGL2_v1.5.zip
    42.4 KB · Views: 400

agraham

Expert
Licensed User
Longtime User
i have increased the version to 1.5, would you mind uploading it and edit your first post
I'd be glad to but you seem to have posted just the Eclipse project. There's no jar or xml file and no B4A demo project . Perhaps you could take my OpenGL2_1.4.zip and replace the jar and xml with yours.
 
Last edited:

walterf25

Expert
Licensed User
Longtime User
I'd be glad to but you seem to have posted just the Eclipse project. There's no jar or xml file and no B4A demo project . Perhaps you could take my OpenGL2_1.4.zip and replace the jar and xml with yours.
Hi abraham, I figured you would want to do a quick review of the source code and compile the jar and xml files yourself since you are the author of this lib, but no worries I will upload them in a bit so you can edit the first post and update the files.

I have uploaded an example apk file in the new libraries thread

Walter
 

walterf25

Expert
Licensed User
Longtime User
I'm not set up to do so any more without a lot of setup so if it works for you I'm happy to post it!
Here ya go, Thanks again, if you'd like if there's any other changes that may be required in the future i can just create a separate thread and name it something like Updated OpenGL2.0 library that way i don't have to bother you to update your post every time.

Here is the updated lib files version 1.5

Walter
 

Attachments

  • OpenGL2_v1.5.zip
    38.2 KB · Views: 432

Informatix

Expert
Licensed User
Longtime User
The libGDX library wraps also the OpenGL classes. What you added here was already in libGDX.
 

walterf25

Expert
Licensed User
Longtime User
The libGDX library wraps also the OpenGL classes. What you added here was already in libGDX.
Great to know, I completely forgot about libGDX, I'll play around with libGDX and EasyAR one of this day .
Walter
 

luke2012

Well-Known Member
Licensed User
Longtime User

Hi @agraham and thanks for this library
I have a project based on WebGL library. Is it possible to porting it within a desktop app using OpenGL library ?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…