#ifndef _BASERENDERER_H_
#define _BASERENDERER_H_
+#include "PluginBase.h"
#include "LayerType.h"
#include "Scene.h"
#include "IRenderer.h"
#include "WindowSystems/BaseWindowSystem.h"
-class BaseRenderer: public IRenderer
+class BaseRenderer: public IRenderer, public PluginBase
{
public:
- BaseRenderer(Scene* pScene);
+ BaseRenderer(ICommandExecutor& executor, Configuration& config);
virtual ~BaseRenderer();
bool start(int, int, const char*) = 0;
bool BaseRenderer::debugMode = true;
-BaseRenderer::BaseRenderer(Scene* pScene) : m_pScene(pScene)
+BaseRenderer::BaseRenderer(ICommandExecutor& executor, Configuration& config)
+: PluginBase(executor, config, Renderer_Api_v1)
+, m_pScene(executor.getScene())
{
LOG_DEBUG("BaseRenderer", "Creating Renderer");
- m_pInputManager = new InputManager(pScene);
- setHealth(HealthRunning);
+ m_pInputManager = new InputManager(m_pScene);
+ pluginSetHealth(HealthRunning);
}
BaseRenderer::~BaseRenderer()
{
delete m_pInputManager;
}
- setHealth(HealthStopped);
+ pluginSetHealth(HealthStopped);
}
uint BaseRenderer::getLayerTypeCapabilities(LayerType layerType)
target_link_libraries(${GRAPHIC_LIB_NAME} ${LIBS})
add_dependencies(${GRAPHIC_LIB_NAME}
- LayerManagerService
LayerManagerUtils
)
cmake_minimum_required (VERSION 2.6)
+project(X11GLESRenderer)
+
include_directories ("include")
include_directories ("../../Base/include")
include_directories ("../../Graphic/include")
-include_directories ("${PROJECT_SOURCE_DIR}/config")
-include_directories ("${PROJECT_SOURCE_DIR}/LayerManagerService/include")
-include_directories ("${PROJECT_SOURCE_DIR}/LayerManagerUtils/include")
+include_directories ("${CMAKE_SOURCE_DIR}/config")
+include_directories ("${CMAKE_SOURCE_DIR}/LayerManagerService/include")
+include_directories ("${CMAKE_SOURCE_DIR}/LayerManagerUtils/include")
+
+set(SRC_FILES
+ src/X11GLESRenderer.cpp
+ src/ShaderProgramGLES.cpp
+)
+
+if (WITH_STATIC_PLUGINS)
+
+ add_library(${PROJECT_NAME} STATIC ${SRC_FILES})
+ set (STATICALLY_LINKED_PLUGINS ${STATICALLY_LINKED_PLUGINS}
+ ${PROJECT_NAME} CACHE INTERNAL "list of static plugins")
+
+else(WITH_STATIC_PLUGINS)
+
+ add_library(${PROJECT_NAME} SHARED ${SRC_FILES})
-file(GLOB SOURCES
- src/X11GLESRenderer.cpp
- src/ShaderProgramGLES.cpp
- )
-
-add_library(X11GLESRenderer SHARED ${SOURCES})
+endif(WITH_STATIC_PLUGINS)
find_package(X11 REQUIRED)
include_directories(${X11_INCLUDE_DIR})
find_package (Threads)
set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT} ${EGL_LIBRARY} ${GLESv2_LIBRARIES} ${X11_Xcomposite_LIB} ${X11_Xdamage_LIB} LayerManagerGraphicGLESv2 LayerManagerUtils )
-target_link_libraries(X11GLESRenderer ${LIBS})
+target_link_libraries(${PROJECT_NAME} ${LIBS})
-add_dependencies(X11GLESRenderer LayerManagerService)
-add_dependencies(X11GLESRenderer LayerManagerUtils)
-add_dependencies(X11GLESRenderer LayerManagerGraphicGLESv2)
+add_dependencies(${PROJECT_NAME} LayerManagerUtils)
+add_dependencies(${PROJECT_NAME} LayerManagerGraphicGLESv2)
-install (TARGETS X11GLESRenderer DESTINATION lib/layermanager/renderer)
+install (TARGETS ${PROJECT_NAME}
+ LIBRARY DESTINATION lib/layermanager/renderer
+ ARCHIVE DESTINATION lib/layermanager/static
+)
install (FILES renderer_frag_clear.glslf DESTINATION lib/layermanager/renderer)
install (FILES renderer_frag.glslf DESTINATION lib/layermanager/renderer)
install (FILES renderer_frag_no_blend.glslf DESTINATION lib/layermanager/renderer)
class X11GLESRenderer : public BaseRenderer
{
public:
- X11GLESRenderer(Scene* pScene);
+ X11GLESRenderer(ICommandExecutor& executor, Configuration& config);
bool start(int, int, const char*);
void stop();
void doScreenShot(std::string fileToSave);
void signalWindowSystemRedraw();
void forceCompositionWindowSystem();
Shader* createShader(const string* vertexName, const string* fragmentName);
- virtual HealthCondition getHealth();
virtual bool setOptimizationMode(OptimizationType id, OptimizationModeType mode);
virtual bool getOptimizationMode(OptimizationType id, OptimizationModeType *mode);
+ // from PluginBase
+ virtual HealthCondition pluginGetHealth();
+ virtual t_ilm_const_string pluginGetName() const;
+
private:
X11WindowSystem* m_pWindowSystem;
GLESGraphicsystem* m_pGraphicSystem;
****************************************************************************/
#include "X11GLESRenderer.h"
-#include "config.h"
+#include "Configuration.h"
#include "Shader.h"
#include "ShaderProgramGLES.h"
#include "X11/Xlib.h"
#include <pthread.h>
#include <signal.h>
-X11GLESRenderer::X11GLESRenderer(Scene* pScene)
-: BaseRenderer(pScene)
+X11GLESRenderer::X11GLESRenderer(ICommandExecutor& executor, Configuration& config)
+: BaseRenderer(executor, config)
, m_pWindowSystem(0)
, m_pGraphicSystem(0)
, m_width(0)
return m_pGraphicSystem->getOptimizationMode(id, mode);
}
+t_ilm_const_string X11GLESRenderer::pluginGetName() const
+{
+ return "X11GLESRenderer";
+}
+
Shader* X11GLESRenderer::createShader(const string* vertexName, const string* fragmentName)
{
Shader *result = NULL;
return result;
}
-HealthCondition X11GLESRenderer::getHealth()
+HealthCondition X11GLESRenderer::pluginGetHealth()
{
- HealthCondition health = PluginBase::getHealth();
+ HealthCondition health = PluginBase::pluginGetHealth();
if (0 != pthread_kill(m_pWindowSystem->mThreadId, 0))
{
health = HealthDead;
return health;
}
-extern "C" BaseRenderer* createX11GLESRenderer(Scene* pScene){
- return new X11GLESRenderer(pScene);
-}
-
-extern "C" void destroyX11GLESRenderer(X11GLESRenderer* p)
-{
- delete p;
-}
+DECLARE_LAYERMANAGEMENT_PLUGIN(X11GLESRenderer)
#define _IRENDERER_H_
#include <string>
-#include "PluginBase.h"
#include "LayerType.h"
#include "Shader.h"
#include "OptimizationType.h"
* Abstract Base of all CompositingControllers, ie Renderers.
* \defgroup RendererAPI Layer Management Renderer API
*/
-class IRenderer : public PluginBase
+class IRenderer
{
public:
/**