Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: GLES With SFML on Android.  (Read 1575 times)

0 Members and 1 Guest are viewing this topic.

kramitox

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
GLES With SFML on Android.
« on: April 05, 2017, 01:28:08 pm »
Hi guys, I'm working on an assignment for college which is to build a cube in a 3D environment using SFML for an android device.
I managed to get regular SFML stuff working fine following guides on the internet and with lots of headaches (I had no prior experience with Cmake, MinGW, etc.)
Now I am facing a new problem and that is trying to call GL commands in my code.
When I go to compile it, this is the errors I am getting and its only with GL commands.

Quote
[armeabi] Install        : libsfml-activity.so => libs/armeabi/libsfml-activity.so
[armeabi] SharedLibrary  : libsfml-example.so
jni/main.cpp:93: error: undefined reference to 'glMatrixMode'
jni/main.cpp:94: error: undefined reference to 'glLoadIdentity'
jni/main.cpp:96: error: undefined reference to 'glFrustumf'
jni/main.cpp:97: error: undefined reference to 'glScalef'
jni/main.cpp:99: error: undefined reference to 'glClear'

I know its probably something simple but I can't for the life of me figure it out.
These are the includes im using
Quote
#include <vector>

#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <SFML/Network.hpp>

#include <GLES/gl.h>
#include <GLES/glext.h>

I have a few weeks to figure this out but any help in solving this quicker would be appreciated.
Thanks in advance :)

Qiu3344

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: GLES With SFML on Android.
« Reply #1 on: April 05, 2017, 05:00:37 pm »
Maybe those headers are in different locations?

Quote
#include <GLES/gl.h>
#include <GLES/glext.h>


PS Check the links to the libraries !

kramitox

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: GLES With SFML on Android.
« Reply #2 on: April 06, 2017, 01:52:27 pm »
Got it working today. You were right so thank you so much!
The problem was the Android.mk not having the link in the sfml-system module so when I manually added it it started working :D so thank you again! Now I can finally start making my 3D environment and then moving on to setting up to viewports for the VR experience :)

Qiu3344

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: GLES With SFML on Android.
« Reply #3 on: April 24, 2017, 04:37:13 pm »
Glad I helped  :D