diff options
author | Armin Weatherwax | 2010-06-14 16:27:25 +0200 |
---|---|---|
committer | Armin Weatherwax | 2010-09-23 15:42:38 +0200 |
commit | 3069d8886241b2d9deaadfbf8823d463b469ec6b (patch) | |
tree | e70aeae85d110d66a7c048a0132085e0301ab068 /linden/indra/media_plugins/example/media_plugin_example.cpp | |
parent | make it compile and run. (diff) | |
download | meta-impy-3069d8886241b2d9deaadfbf8823d463b469ec6b.zip meta-impy-3069d8886241b2d9deaadfbf8823d463b469ec6b.tar.gz meta-impy-3069d8886241b2d9deaadfbf8823d463b469ec6b.tar.bz2 meta-impy-3069d8886241b2d9deaadfbf8823d463b469ec6b.tar.xz |
update to latest SG2 media_plugins
Diffstat (limited to 'linden/indra/media_plugins/example/media_plugin_example.cpp')
-rwxr-xr-x | linden/indra/media_plugins/example/media_plugin_example.cpp | 31 |
1 files changed, 17 insertions, 14 deletions
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" ); |