Discussion:
[osg-users] Emscripten build and dlopen
Jay Maloney
2018-09-25 06:30:43 UTC
Permalink
I am using the Emscripten build of osg and am running into a problem when I try to use functions like
Code:
osgDB::readNodeFile

and
Code:
osgDB::readImageFile

.

Usually I get an exception with the message
To use dlopen, you need to use Emscripten's linking support, see (cannot post links) github ... /kripken/emscripten/wiki/Linking
The instructions on the page say
you must load the side module into the filesystem, so that dlopen (or fopen, etc.) can access it.
Currently I have in CMakeLists.txt

Code:
TARGET_LINK_LIBRARIES(
main
osgViewer
osgDB
# osgDB plugins start.
osgdb_osg
osgdb_glsl
osgdb_tga
osgdb_serializers_osg
osgdb_serializers_osgtext
# osgDB plugins end.
osgGA
osgText
osgUtil
osg
osgShadow
OpenThreads
)



So, does anyone know what is supposed to be done here? I am able to load .osgt and .osgb nodes but can't load other file nodes or image files like png or tga.

Do you have to actually do the loading of the side module, if so which file? The osglib*.a plugins?

Is there a way to load files without dlopen?[/code]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74970#74970
michael kapelko
2018-11-02 09:54:27 UTC
Permalink
Hi. I can't comment on dlopen() usage but here's how i load png
texture and apply it to a model:
https://github.com/OGStudio/openscenegraph-cross-platform-examples/tree/master/02.TextureImage
Post by Jay Maloney
I am using the Emscripten build of osg and am running into a problem when I try to use functions like
osgDB::readNodeFile
and
osgDB::readImageFile
.
Usually I get an exception with the message
To use dlopen, you need to use Emscripten's linking support, see (cannot post links) github ... /kripken/emscripten/wiki/Linking
The instructions on the page say
you must load the side module into the filesystem, so that dlopen (or fopen, etc.) can access it.
Currently I have in CMakeLists.txt
TARGET_LINK_LIBRARIES(
main
osgViewer
osgDB
# osgDB plugins start.
osgdb_osg
osgdb_glsl
osgdb_tga
osgdb_serializers_osg
osgdb_serializers_osgtext
# osgDB plugins end.
osgGA
osgText
osgUtil
osg
osgShadow
OpenThreads
)
So, does anyone know what is supposed to be done here? I am able to load .osgt and .osgb nodes but can't load other file nodes or image files like png or tga.
Do you have to actually do the loading of the side module, if so which file? The osglib*.a plugins?
Is there a way to load files without dlopen?[/code]
------------------
http://forum.openscenegraph.org/viewtopic.php?p=74970#74970
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Loading...