OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Trying to understand GraphicsWindow system


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
bhaines
Newbie


Joined: 19 Dec 2017
Posts: 2

PostPosted: Tue Dec 19, 2017 7:31 pm    Post subject:
Trying to understand GraphicsWindow system
Reply with quote

Hi all,

I'm in the middle of building OSG for Android, but I'm having an issue when actually linking the library to another appilication. If fails to link due to an "undefined reference to 'graphicswindow_X11'". I tracked down why X11 is being used to the GraphicsWindow header file:

Code:

#define USE_GRAPICSWINDOW_IMPLEMENTATION(ext) \
 extern "C" void +t(void); \
 static osgViewer::GraphicsWindowFunctionProxy graphicswindowproxy_##ext(graphicswindow_##ext);

#if defined(_WIN32)
 #define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Win32)
#elif defined(__APPLE__)
 #define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Carbon)
#else
 #define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(X11)
#endif


Since X11 doesn't exist on Android, it seems like there isn't an option there that Android can use. Is there something here that I am missing?

Thank you,
Brett

EDIT -- I looked to see if I had replied and realized I forgot to add the CMake command I built OSG with:

Code:

TRD_PARTY=$BASEDIR/osg/3rdparty
mkdir $TRD_PARTY
mkdir $TRD_PARTY/build

# Copy necessary libraries into $TRD_PARTY

mkdir $BASEDIR/osg/build
cd $BASEDIR/osg/build
cmake -DOSG_BUILD_PLATFORM_ANDROID=ON \
      -DANDROID_STANDALONE_TOOLCHAIN=$TOOLCHAIN \
      -DANDROID_NATIVE_API_LEVEL=21 \
      -DANDROID_ABI="armeabi-v7a" \
      -DANDROID_STL="gnustl_static" \
      -DCMAKE_MAKE_PROGRAM=$MAKE \
      -DCMAKE_INSTALL_PREFIX=$SYSROOT/usr \
      -DCMAKE_TOOLCHAIN_FILE=$BASEDIR/android.toolchain.cmake \
      -DCMAKE_CXX_FLAGS="-fpermissive" \
      -DOSG_CPP_EXCEPTIONS_AVAILABLE=TRUE \
      -DOSG_GL1_AVAILABLE=OFF \
      -DOSG_GL2_AVAILABLE=OFF \
      -DOSG_GL3_AVAILABLE=OFF \
      -DOSG_GLES1_AVAILABLE=ON \
      -DOSG_GLES2_AVAILABLE=OFF \
      -DOSG_GL_LIBRARY_STATIC=OFF \
      -DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF \
      -DOSG_GL_MATRICES_AVAILABLE=ON \
      -DOSG_GL_VERTEX_FUNCS_AVAILABLE=ON \
      -DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=ON \
      -DOSG_GL_FIXED_FUNCTION_AVAILABLE=ON \
      -DDYNAMIC_OPENTHREADS=OFF \
      -DDYNAMIC_OPENSCENEGRAPH=OFF \
      -DBUILD_OSG_APPLICATIONS=OFF \
      -DBUILD_OSG_PLUGINS_BY_DEFAULT=OFF \
      -DBUILD_OSG_PLUGIN_OSG=ON \
      -DBUILD_OSG_PLUGIN_DDS=ON \
      -DBUILD_OSG_PLUGIN_TGA=ON \
      -DBUILD_OSG_PLUGIN_BMP=ON \
      -DBUILD_OSG_PLUGIN_JPEG=ON \
      -DBUILD_OSG_PLUGIN_PNG=ON \
      -DBUILD_OSG_DEPRECATED_SERIALIZERS=OFF \
      -DJPEG_LIBRARY:PATH=$TRD_PARTY/build/libjpeg/lib/libjpeg.so \
      -DJPEG_INCLUDE_DIR:PATH=$TRD_PARTY/build/libjpeg/include \
      -DOPENGL_gl_LIBRARY:PATH=$SYS_LIB/libGLESv1_CM.so \
      -DOPENGL_INCLUDE_DIR:PATH=$SYS_INC \
      -DPNG_INCLUDE_DIR:PATH=$TRD_PARTY/build/libpng/include \
      -DTIFF_INCLUDE_DIR:PATH=$TRD_PARTY/build/libtiff/include \
      -DZLIB_INCLUDE_DIR:PATH=$TRD_PARTY/build/libjpeg/include \
      ..
make -j $(nproc) install
Back to top
View user's profile Send private message
kornerr
Appreciator


Joined: 01 Oct 2013
Posts: 284

PostPosted: Wed Dec 20, 2017 3:23 pm    Post subject:
Trying to understand GraphicsWindow system
Reply with quote

Hi.
Depends on how you build for Android.
Here's how to build OpenSceneGraph application with Android Studio:
https://github.com/OGStudio/openscenegraph-cross-platform-guide/tree/master/1.8.SampleUnderAndroid


On 19 December 2017 at 22:31, Brett Haines <> wrote:
Quote:
Hi all,

I'm in the middle of building OSG for Android, but I'm having an issue when actually linking the library to another appilication. If fails to link due to an "undefined reference to 'graphicswindow_X11'". I tracked down why X11 is being used to the GraphicsWindow header file:


Code:

#define USE_GRAPICSWINDOW_IMPLEMENTATION(ext) \
extern "C" void +t(void); \
static osgViewer::GraphicsWindowFunctionProxy graphicswindowproxy_##ext(graphicswindow_##ext);

#if defined(_WIN32)
#define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Win32)
#elif defined(__APPLE__)
#define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Carbon)
#else
#define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(X11)
#endif




Since X11 doesn't exist on Android, it seems like there isn't an option there that Android can use. Is there something here that I am missing?

Thank you,
Brett

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72610#72610








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
bhaines
Newbie


Joined: 19 Dec 2017
Posts: 2

PostPosted: Wed Dec 20, 2017 8:51 pm    Post subject:
Re: Trying to understand GraphicsWindow system
Reply with quote

Thanks for the tip. I had been building it all in the command line, but I'll try doing everything in Android Studio next.

Cheers!
Brett

kornerr wrote:
Hi.
Depends on how you build for Android.

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts [Help] OSG + ArKit: Problem convertin... Brayner General 4 Mon Oct 08, 2018 7:07 pm View latest post
No new posts Build error under Windows? Need feedb... robertosfield General 3 Wed Jun 27, 2018 11:11 am View latest post
No new posts EXTERNAL: Re: What coordinate system ... Rowley, Marlin R General 0 Tue Apr 10, 2018 8:50 pm View latest post
No new posts What coordinate system does OSG use? Rowley, Marlin R General 1 Tue Apr 10, 2018 7:09 pm View latest post
No new posts How to improve system performance white_water125 General 0 Tue Oct 17, 2017 6:43 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP