Fixed web browser thanks to ArminW/Imprudence
This commit is contained in:
@@ -14,7 +14,7 @@ include(PluginAPI)
|
||||
include(MediaPluginBase)
|
||||
include(FindOpenGL)
|
||||
|
||||
include(ExamplePlugin)
|
||||
#include(ExamplePlugin)
|
||||
|
||||
include_directories(
|
||||
${LLPLUGIN_INCLUDE_DIRS}
|
||||
@@ -29,13 +29,13 @@ include_directories(
|
||||
|
||||
### media_plugin_example
|
||||
|
||||
if(WORD_SIZE EQUAL 64)
|
||||
if(NOT CMAKE_SIZEOF_VOID_P MATCHES 4)
|
||||
if(WINDOWS)
|
||||
add_definitions(/FIXED:NO)
|
||||
else(WINDOWS) # not windows therefore gcc LINUX and DARWIN
|
||||
add_definitions(-fPIC)
|
||||
endif(WINDOWS)
|
||||
endif (WORD_SIZE EQUAL 64)
|
||||
endif (NOT CMAKE_SIZEOF_VOID_P MATCHES 4)
|
||||
|
||||
set(media_plugin_example_SOURCE_FILES
|
||||
media_plugin_example.cpp
|
||||
|
||||
44
indra/media_plugins/example/media_plugin_example.cpp
Normal file → Executable file
44
indra/media_plugins/example/media_plugin_example.cpp
Normal file → Executable file
@@ -2,10 +2,11 @@
|
||||
* @file media_plugin_example.cpp
|
||||
* @brief Example plugin for LLMedia API plugin system
|
||||
*
|
||||
* @cond
|
||||
* $LicenseInfo:firstyear=2008&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2009, Linden Research, Inc.
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2008-2010, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
@@ -13,20 +14,23 @@
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlife.com/developers/opensource/gplv2
|
||||
*
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at http://secondlife.com/developers/opensource/flossexception
|
||||
*
|
||||
* online at
|
||||
* http://secondlife.com/developers/opensource/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*
|
||||
* @endcond
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
@@ -117,17 +121,6 @@ void MediaPluginExample::receiveMessage( const char* message_string )
|
||||
std::string plugin_version = "Example media plugin, Example Version 1.0.0.0";
|
||||
message.setValue( "plugin_version", plugin_version );
|
||||
sendMessage( message );
|
||||
|
||||
// Plugin gets to decide the texture parameters to use.
|
||||
message.setMessage( LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params" );
|
||||
message.setValueS32( "default_width", mWidth );
|
||||
message.setValueS32( "default_height", mHeight );
|
||||
message.setValueS32( "depth", mDepth );
|
||||
message.setValueU32( "internalformat", GL_RGBA );
|
||||
message.setValueU32( "format", GL_RGBA );
|
||||
message.setValueU32( "type", GL_UNSIGNED_BYTE );
|
||||
message.setValueBoolean( "coords_opengl", false );
|
||||
sendMessage( message );
|
||||
}
|
||||
else
|
||||
if ( message_name == "idle" )
|
||||
@@ -189,7 +182,20 @@ void MediaPluginExample::receiveMessage( const char* message_string )
|
||||
else
|
||||
if ( message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA )
|
||||
{
|
||||
if ( message_name == "size_change" )
|
||||
if ( message_name == "init" )
|
||||
{
|
||||
// Plugin gets to decide the texture parameters to use.
|
||||
LLPluginMessage message( LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params" );
|
||||
message.setValueS32( "default_width", mWidth );
|
||||
message.setValueS32( "default_height", mHeight );
|
||||
message.setValueS32( "depth", mDepth );
|
||||
message.setValueU32( "internalformat", GL_RGBA );
|
||||
message.setValueU32( "format", GL_RGBA );
|
||||
message.setValueU32( "type", GL_UNSIGNED_BYTE );
|
||||
message.setValueBoolean( "coords_opengl", false );
|
||||
sendMessage( message );
|
||||
}
|
||||
else if ( message_name == "size_change" )
|
||||
{
|
||||
std::string name = message_in.getValue( "name" );
|
||||
S32 width = message_in.getValueS32( "width" );
|
||||
|
||||
Reference in New Issue
Block a user