diff options
Diffstat (limited to 'linden/indra/media_plugins/example')
-rwxr-xr-x | linden/indra/media_plugins/example/CMakeLists.txt | 6 | ||||
-rwxr-xr-x | linden/indra/media_plugins/example/media_plugin_example.cpp | 31 |
2 files changed, 20 insertions, 17 deletions
diff --git a/linden/indra/media_plugins/example/CMakeLists.txt b/linden/indra/media_plugins/example/CMakeLists.txt index 6d14c1b..7822300 100755 --- a/linden/indra/media_plugins/example/CMakeLists.txt +++ b/linden/indra/media_plugins/example/CMakeLists.txt | |||
@@ -14,7 +14,7 @@ include(PluginAPI) | |||
14 | include(MediaPluginBase) | 14 | include(MediaPluginBase) |
15 | include(FindOpenGL) | 15 | include(FindOpenGL) |
16 | 16 | ||
17 | #awfixme include(ExamplePlugin) | 17 | #include(ExamplePlugin) |
18 | 18 | ||
19 | include_directories( | 19 | include_directories( |
20 | ${LLPLUGIN_INCLUDE_DIRS} | 20 | ${LLPLUGIN_INCLUDE_DIRS} |
@@ -29,13 +29,13 @@ include_directories( | |||
29 | 29 | ||
30 | ### media_plugin_example | 30 | ### media_plugin_example |
31 | 31 | ||
32 | if(WORD_SIZE EQUAL 64) | 32 | if(NOT CMAKE_SIZEOF_VOID_P MATCHES 4) |
33 | if(WINDOWS) | 33 | if(WINDOWS) |
34 | add_definitions(/FIXED:NO) | 34 | add_definitions(/FIXED:NO) |
35 | else(WINDOWS) # not windows therefore gcc LINUX and DARWIN | 35 | else(WINDOWS) # not windows therefore gcc LINUX and DARWIN |
36 | add_definitions(-fPIC) | 36 | add_definitions(-fPIC) |
37 | endif(WINDOWS) | 37 | endif(WINDOWS) |
38 | endif (WORD_SIZE EQUAL 64) | 38 | endif (NOT CMAKE_SIZEOF_VOID_P MATCHES 4) |
39 | 39 | ||
40 | set(media_plugin_example_SOURCE_FILES | 40 | set(media_plugin_example_SOURCE_FILES |
41 | media_plugin_example.cpp | 41 | media_plugin_example.cpp |
diff --git a/linden/indra/media_plugins/example/media_plugin_example.cpp b/linden/indra/media_plugins/example/media_plugin_example.cpp index 83abae0..1eabe6c 100755 --- a/linden/indra/media_plugins/example/media_plugin_example.cpp +++ b/linden/indra/media_plugins/example/media_plugin_example.cpp | |||
@@ -13,13 +13,13 @@ | |||
13 | * ("GPL"), unless you have obtained a separate licensing agreement | 13 | * ("GPL"), unless you have obtained a separate licensing agreement |
14 | * ("Other License"), formally executed by you and Linden Lab. Terms of | 14 | * ("Other License"), formally executed by you and Linden Lab. Terms of |
15 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | 15 | * the GPL can be found in doc/GPL-license.txt in this distribution, or |
16 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | 16 | * online at http://secondlife.com/developers/opensource/gplv2 |
17 | * | 17 | * |
18 | * There are special exceptions to the terms and conditions of the GPL as | 18 | * There are special exceptions to the terms and conditions of the GPL as |
19 | * it is applied to this Source Code. View the full text of the exception | 19 | * it is applied to this Source Code. View the full text of the exception |
20 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 20 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
21 | * online at | 21 | * online at |
22 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | 22 | * http://secondlife.com/developers/opensource/flossexception |
23 | * | 23 | * |
24 | * By copying, modifying or distributing this software, you acknowledge | 24 | * By copying, modifying or distributing this software, you acknowledge |
25 | * that you have read and understood your obligations described above, | 25 | * that you have read and understood your obligations described above, |
@@ -29,6 +29,7 @@ | |||
29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
30 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
31 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * | ||
32 | * @endcond | 33 | * @endcond |
33 | */ | 34 | */ |
34 | 35 | ||
@@ -120,17 +121,6 @@ void MediaPluginExample::receiveMessage( const char* message_string ) | |||
120 | std::string plugin_version = "Example media plugin, Example Version 1.0.0.0"; | 121 | std::string plugin_version = "Example media plugin, Example Version 1.0.0.0"; |
121 | message.setValue( "plugin_version", plugin_version ); | 122 | message.setValue( "plugin_version", plugin_version ); |
122 | sendMessage( message ); | 123 | sendMessage( message ); |
123 | |||
124 | // Plugin gets to decide the texture parameters to use. | ||
125 | message.setMessage( LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params" ); | ||
126 | message.setValueS32( "default_width", mWidth ); | ||
127 | message.setValueS32( "default_height", mHeight ); | ||
128 | message.setValueS32( "depth", mDepth ); | ||
129 | message.setValueU32( "internalformat", GL_RGBA ); | ||
130 | message.setValueU32( "format", GL_RGBA ); | ||
131 | message.setValueU32( "type", GL_UNSIGNED_BYTE ); | ||
132 | message.setValueBoolean( "coords_opengl", false ); | ||
133 | sendMessage( message ); | ||
134 | } | 124 | } |
135 | else | 125 | else |
136 | if ( message_name == "idle" ) | 126 | if ( message_name == "idle" ) |
@@ -192,7 +182,20 @@ void MediaPluginExample::receiveMessage( const char* message_string ) | |||
192 | else | 182 | else |
193 | if ( message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA ) | 183 | if ( message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA ) |
194 | { | 184 | { |
195 | if ( message_name == "size_change" ) | 185 | if ( message_name == "init" ) |
186 | { | ||
187 | // Plugin gets to decide the texture parameters to use. | ||
188 | LLPluginMessage message( LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params" ); | ||
189 | message.setValueS32( "default_width", mWidth ); | ||
190 | message.setValueS32( "default_height", mHeight ); | ||
191 | message.setValueS32( "depth", mDepth ); | ||
192 | message.setValueU32( "internalformat", GL_RGBA ); | ||
193 | message.setValueU32( "format", GL_RGBA ); | ||
194 | message.setValueU32( "type", GL_UNSIGNED_BYTE ); | ||
195 | message.setValueBoolean( "coords_opengl", false ); | ||
196 | sendMessage( message ); | ||
197 | } | ||
198 | else if ( message_name == "size_change" ) | ||
196 | { | 199 | { |
197 | std::string name = message_in.getValue( "name" ); | 200 | std::string name = message_in.getValue( "name" ); |
198 | S32 width = message_in.getValueS32( "width" ); | 201 | S32 width = message_in.getValueS32( "width" ); |