this renderer can now be built independently of all other renderers.
this allows building multiple renderers at once.
Signed-off-by: Timo Lotterbach <timo.lotterbach@bmw-carit.de>
#==============================================================================
# Internal global settings not available to user
#==============================================================================
-set (WITH_WAYLAND OFF)
set (STATICALLY_LINKED_PLUGINS "" CACHE INTERNAL "list of static plugins" FORCE)
#==============================================================================
-# make sure, only one wayland based renderer was selected
-#==============================================================================
-set(NumberOfWaylandRenderers 0)
-
-if (WITH_WAYLAND_X11)
- set (WITH_GLESv2_LIB ON)
- set (WITH_WAYLAND ON)
- MATH(EXPR NumberOfWaylandRenderers "${NumberOfWaylandRenderers} + 1")
-endif(WITH_WAYLAND_X11)
-
-if (WITH_WAYLAND_FBDEV)
- set (WITH_GLESv2_LIB)
- set (WITH_WAYLAND ON)
- MATH(EXPR NumberOfWaylandRenderers "${NumberOfWaylandRenderers} + 1")
-endif(WITH_WAYLAND_FBDEV)
-
-if (WITH_WAYLAND_DRM)
- set (WITH_GLESv2_LIB ON)
- set (WITH_WAYLAND ON)
- MATH(EXPR NumberOfWaylandRenderers "${NumberOfWaylandRenderers} + 1")
-endif(WITH_WAYLAND_DRM)
-
-if(NumberOfWaylandRenderers GREATER 1)
- MESSAGE(FATAL_ERROR "More than one Wayland based renderer was selected. This is not supported.")
-endif(NumberOfWaylandRenderers GREATER 1)
-
-
-#==============================================================================
# set default build parameters
#==============================================================================
add_subdirectory(cmake/optionalFeatures)
add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLX)
endif(WITH_GLX_LIB)
-if (WITH_WAYLAND)
+if (WITH_WAYLAND_X11)
+ add_subdirectory_once (LayerManagerUtils)
+ add_subdirectory_once (LayerManagerBase)
+ add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2)
add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
-endif(WITH_WAYLAND)
+ add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandX11GLESRenderer)
+endif(WITH_WAYLAND_X11)
if (WITH_WAYLAND_X11_LIB)
add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2)
${CMAKE_THREAD_LIBS_INIT}
${EGL_LIBRARY}
${GLESv2_LIBRARIES}
- LayerManagerGraphicWaylandGLESv2
LayerManagerUtils
)
#===========================================================================
# create statically linked plugin
#===========================================================================
-if (WITH_STATIC_LIBRARIES)
-
- add_library(${PROJECT_NAME} STATIC ${SRC_FILES})
-
- set (STATICALLY_LINKED_PLUGINS ${STATICALLY_LINKED_PLUGINS}
- ${PROJECT_NAME} CACHE INTERNAL "list of static plugins")
-
-#===========================================================================
-# create dynamically linked plugin
-#===========================================================================
-else(WITH_STATIC_LIBRARIES)
-
- add_library(${PROJECT_NAME} SHARED ${SRC_FILES})
-
- install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${PLUGIN_INSTALL_PATH})
-
-endif(WITH_STATIC_LIBRARIES)
+add_library(${PROJECT_NAME} STATIC ${SRC_FILES})
#===========================================================================
// from PluginBase
virtual HealthCondition pluginGetHealth();
- virtual t_ilm_const_string pluginGetName() const;
-private:
+ // implement in inheriting classes
+ virtual WaylandBaseWindowSystem* getWindowSystem(const char* displayname) = 0;
+ virtual GLESGraphicsystem* getGraphicSystem(PfnShaderProgramCreator shaderProgram) = 0;
+
+protected:
WaylandBaseWindowSystem* m_pWindowSystem;
GLESGraphicsystem* m_pGraphicSystem;
uint m_width;
#ifdef WITH_WAYLAND_FBDEV
#include "WindowSystems/WaylandFbdevWindowSystem.h"
#endif // WITH_WAYLAND_FBDEV
-#ifdef WITH_WAYLAND_X11
-#include "WindowSystems/WaylandX11WindowSystem.h"
-#endif // WITH_WAYLAND_X11
#ifdef WITH_WAYLAND_DRM
#include "WindowSystems/WaylandDrmWindowSystem.h"
#include "GraphicSystems/DrmGLESGraphicSystem.h"
m_pWindowSystem = new WaylandFbdevWindowSystem(displayname, width, height, m_pScene, m_pInputManager);
#endif
#ifdef WITH_WAYLAND_X11
- m_pWindowSystem = new WaylandX11WindowSystem(displayname, width, height, m_pScene, m_pInputManager);
+ m_pWindowSystem = getWindowSystem(displayname);
#endif
#ifdef WITH_WAYLAND_DRM
m_pWindowSystem = new WaylandDrmWindowSystem(displayname, width, height, m_pScene, m_pInputManager);
#ifdef WITH_WAYLAND_DRM
m_pGraphicSystem = new DrmGLESGraphicSystem(width,height, ShaderProgramGLES::createProgram);
#else
- m_pGraphicSystem = new GLESGraphicsystem(width,height, ShaderProgramGLES::createProgram);
+ m_pGraphicSystem = getGraphicSystem(ShaderProgramGLES::createProgram);
#endif
if (!m_pWindowSystem->init((BaseGraphicSystem<void*, void*>*) m_pGraphicSystem))
return BaseRenderer::pluginGetHealth();
}
-t_ilm_const_string WaylandGLESRenderer::pluginGetName() const
-{
- return "WaylandGLESRenderer";
-}
-
Shader* WaylandGLESRenderer::createShader(const string* vertexName, const string* fragmentName)
{
Shader *result = NULL;
m_pGraphicSystem->releaseGraphicContext();
m_pWindowSystem->setSystemState(IDLE_STATE);
return result;
-}
-
-DECLARE_LAYERMANAGEMENT_PLUGIN(WaylandGLESRenderer)
\ No newline at end of file
+}
\ No newline at end of file
--- /dev/null
+
+############################################################################
+#
+# Copyright 2010-2012 BMW Car IT GmbH
+# Copyright (C) 2011 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh
+# Copyright (C) 2012 Bayerische Motorenwerke Aktiengesellschaft
+#
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+############################################################################
+
+cmake_minimum_required (VERSION 2.6)
+
+#===========================================================================
+# plugin configuration
+#===========================================================================
+project(WaylandX11GLESRenderer)
+
+find_package(Wayland REQUIRED)
+find_package(EGL REQUIRED)
+find_package(GLESv2 REQUIRED)
+find_package(Threads REQUIRED)
+
+include_directories(
+ include
+ ${CMAKE_SOURCE_DIR}/LayerManagerBase/include
+ ${CMAKE_SOURCE_DIR}/LayerManagerUtils/include
+ ${CMAKE_SOURCE_DIR}/LayerManagerPlugins/Renderers/Base/include
+ ${CMAKE_SOURCE_DIR}/LayerManagerPlugins/Renderers/Graphic/include
+ ${CMAKE_SOURCE_DIR}/LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer/include
+)
+
+set(LIBS
+ LayerManagerUtils
+ WaylandGLESRenderer
+ LayerManagerGraphicWaylandX11GLESv2
+)
+
+set(SRC_FILES
+ src/WaylandX11GLESRenderer.cpp
+)
+
+set(PLUGIN_INSTALL_PATH lib/layermanager/renderer)
+
+set(X11GLES_RENDERER_PATH ${CMAKE_SOURCE_DIR}/LayerManagerPlugins/Renderers/Platform/X11GLESRenderer)
+install(FILES ${X11GLES_RENDERER_PATH}/renderer_frag_clear.glslf
+ ${X11GLES_RENDERER_PATH}/renderer_frag.glslf
+ ${X11GLES_RENDERER_PATH}/renderer_frag_no_blend.glslf
+ ${X11GLES_RENDERER_PATH}/renderer_frag_no_ualpha.glslf
+ ${X11GLES_RENDERER_PATH}/renderer_frag_add_uchromakey.glslf
+ ${X11GLES_RENDERER_PATH}/renderer_frag_no_blend_no_ualpha.glslf
+ ${X11GLES_RENDERER_PATH}/renderer_frag_2surf.glslf
+ ${X11GLES_RENDERER_PATH}/renderer_frag_2surf_no_blend.glslf
+ ${X11GLES_RENDERER_PATH}/renderer_frag_2surf_no_ualpha.glslf
+ ${X11GLES_RENDERER_PATH}/renderer_frag_2surf_no_blend_no_ualpha.glslf
+ ${X11GLES_RENDERER_PATH}/renderer_frag_2surf_no_ualpha_0.glslf
+ ${X11GLES_RENDERER_PATH}/renderer_frag_2surf_no_blend_no_ualpha_0.glslf
+ ${X11GLES_RENDERER_PATH}/renderer_frag_2surf_no_ualpha_1.glslf
+ ${X11GLES_RENDERER_PATH}/renderer_frag_2surf_no_blend_no_ualpha_1.glslf
+ ${X11GLES_RENDERER_PATH}/renderer_vert.glslv
+ ${X11GLES_RENDERER_PATH}/renderer_vert_2surf.glslv
+ DESTINATION lib/layermanager/renderer
+)
+
+#===========================================================================
+# create statically linked plugin
+#===========================================================================
+if (WITH_STATIC_LIBRARIES)
+
+ add_library(${PROJECT_NAME} STATIC ${SRC_FILES})
+
+ set (STATICALLY_LINKED_PLUGINS ${STATICALLY_LINKED_PLUGINS}
+ ${PROJECT_NAME} CACHE INTERNAL "list of static plugins")
+
+#===========================================================================
+# create dynamically linked plugin
+#===========================================================================
+else(WITH_STATIC_LIBRARIES)
+
+ add_library(${PROJECT_NAME} SHARED ${SRC_FILES})
+
+ install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${PLUGIN_INSTALL_PATH})
+
+endif(WITH_STATIC_LIBRARIES)
+
+
+#===========================================================================
+# external libraries
+#===========================================================================
+target_link_libraries(${PROJECT_NAME} ${LIBS})
+
+add_dependencies(${PROJECT_NAME} ${LIBS})
--- /dev/null
+/***************************************************************************
+ *
+ * Copyright 2010-2012 BMW Car IT GmbH
+ * Copyright (C) 2011 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh
+ * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ****************************************************************************/
+
+#ifndef _WAYLANDX11GLESRENDERER_H_
+#define _WAYLANDX11GLESRENDERER_H_
+
+#include "WaylandGLESRenderer.h"
+
+class WaylandX11GLESRenderer : public WaylandGLESRenderer
+{
+public:
+ WaylandX11GLESRenderer(ICommandExecutor& executor, Configuration& config);
+
+ // from PluginBase
+ virtual t_ilm_const_string pluginGetName() const;
+
+ // from WaylandGLESRenderer
+ virtual WaylandBaseWindowSystem* getWindowSystem(const char* displayname);
+ virtual GLESGraphicsystem* getGraphicSystem(PfnShaderProgramCreator shaderProgram);
+};
+
+#endif /* _WAYLANDX11GLESRENDERER_H_*/
--- /dev/null
+/***************************************************************************
+ *
+ * Copyright 2010, 2011 BMW Car IT GmbH
+ * Copyright (C) 2011 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ****************************************************************************/
+
+#include "WaylandX11GLESRenderer.h"
+#include "WindowSystems/WaylandX11WindowSystem.h"
+#include "Configuration.h"
+
+
+WaylandX11GLESRenderer::WaylandX11GLESRenderer(ICommandExecutor& executor, Configuration& config)
+: WaylandGLESRenderer(executor, config)
+{
+}
+
+t_ilm_const_string WaylandX11GLESRenderer::pluginGetName() const
+{
+ return "WaylandX11GLESRenderer";
+}
+
+WaylandBaseWindowSystem* WaylandX11GLESRenderer::getWindowSystem(const char* displayname)
+{
+ return new WaylandX11WindowSystem(displayname, m_width, m_height, m_pScene, m_pInputManager);
+}
+
+GLESGraphicsystem* WaylandX11GLESRenderer::getGraphicSystem(PfnShaderProgramCreator shaderProgram)
+{
+ return new GLESGraphicsystem(m_width, m_height, shaderProgram);
+}
+
+DECLARE_LAYERMANAGEMENT_PLUGIN(WaylandX11GLESRenderer)
\ No newline at end of file