[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38339] branches/soc-2011-tomato: Merging r38316 through r38338 from trunk into into soc-2011-tomato
Sergey Sharybin
g.ulairi at gmail.com
Tue Jul 12 20:06:16 CEST 2011
Revision: 38339
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38339
Author: nazgul
Date: 2011-07-12 18:06:16 +0000 (Tue, 12 Jul 2011)
Log Message:
-----------
Merging r38316 through r38338 from trunk into into soc-2011-tomato
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38316
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38338
Modified Paths:
--------------
branches/soc-2011-tomato/CMakeLists.txt
branches/soc-2011-tomato/intern/ghost/CMakeLists.txt
branches/soc-2011-tomato/intern/ghost/GHOST_Types.h
branches/soc-2011-tomato/intern/ghost/intern/GHOST_ISystem.cpp
branches/soc-2011-tomato/intern/ghost/intern/GHOST_NDOFManager.cpp
branches/soc-2011-tomato/intern/ghost/intern/GHOST_SystemX11.cpp
branches/soc-2011-tomato/intern/ghost/intern/GHOST_SystemX11.h
branches/soc-2011-tomato/source/blender/makesrna/intern/rna_curve.c
Added Paths:
-----------
branches/soc-2011-tomato/intern/ghost/intern/GHOST_DisplayManagerSDL.cpp
branches/soc-2011-tomato/intern/ghost/intern/GHOST_DisplayManagerSDL.h
branches/soc-2011-tomato/intern/ghost/intern/GHOST_SystemSDL.cpp
branches/soc-2011-tomato/intern/ghost/intern/GHOST_SystemSDL.h
branches/soc-2011-tomato/intern/ghost/intern/GHOST_WindowSDL.cpp
branches/soc-2011-tomato/intern/ghost/intern/GHOST_WindowSDL.h
Property Changed:
----------------
branches/soc-2011-tomato/
Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/blender:36831-38315
+ /trunk/blender:36831-38338
Modified: branches/soc-2011-tomato/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/CMakeLists.txt 2011-07-12 18:04:29 UTC (rev 38338)
+++ branches/soc-2011-tomato/CMakeLists.txt 2011-07-12 18:06:16 UTC (rev 38339)
@@ -109,6 +109,9 @@
option(WITH_AUDASPACE "Build with blenders audio library" ON)
mark_as_advanced(WITH_AUDASPACE)
+option(WITH_SDL_GHOST "Enable building blender against SDL for windowing rather then the native APIs" OFF)
+mark_as_advanced(WITH_SDL_GHOST)
+
option(WITH_HEADLESS "Build without graphical support (renderfarm, server mode only)" OFF)
mark_as_advanced(WITH_HEADLESS)
@@ -212,6 +215,10 @@
message(FATAL_ERROR "WITH_OPENAL/WITH_SDL/WITH_JACK/WITH_CODEC_FFMPEG require WITH_AUDASPACE")
endif()
+if(NOT WITH_SDL AND WITH_SDL_GHOST)
+ message(FATAL_ERROR "WITH_SDL_GHOST requires WITH_SDL to be ON")
+endif()
+
if(NOT WITH_IMAGE_OPENJPEG AND WITH_IMAGE_REDCODE)
message(FATAL_ERROR "WITH_IMAGE_REDCODE requires WITH_IMAGE_OPENJPEG")
endif()
@@ -436,7 +443,7 @@
# OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
set(PLATFORM_LINKLIBS "-lutil -lc -lm -lpthread -lstdc++")
- if(NOT WITH_HEADLESS)
+ if((NOT WITH_HEADLESS) AND (NOT WITH_SDL_GHOST))
find_package(X11 REQUIRED)
find_path(X11_XF86keysym_INCLUDE_PATH X11/XF86keysym.h ${X11_INC_SEARCH_PATH})
mark_as_advanced(X11_XF86keysym_INCLUDE_PATH)
Modified: branches/soc-2011-tomato/intern/ghost/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/intern/ghost/CMakeLists.txt 2011-07-12 18:04:29 UTC (rev 38338)
+++ branches/soc-2011-tomato/intern/ghost/CMakeLists.txt 2011-07-12 18:06:16 UTC (rev 38339)
@@ -89,14 +89,28 @@
intern/GHOST_WindowManager.h
)
-if(WITH_HEADLESS)
- list(APPEND SRC
- intern/GHOST_DisplayManagerNULL.h
- intern/GHOST_SystemNULL.h
- intern/GHOST_WindowNULL.h
- )
- add_definitions(-DWITH_HEADLESS)
+if(WITH_HEADLESS OR WITH_SDL_GHOST)
+ if(WITH_HEADLESS)
+ list(APPEND SRC
+ intern/GHOST_DisplayManagerNULL.h
+ intern/GHOST_SystemNULL.h
+ intern/GHOST_WindowNULL.h
+ )
+ add_definitions(-DWITH_HEADLESS)
+ else()
+ list(APPEND SRC
+ intern/GHOST_DisplayManagerSDL.cpp
+ intern/GHOST_SystemSDL.cpp
+ intern/GHOST_WindowSDL.cpp
+ intern/GHOST_DisplayManagerSDL.h
+ intern/GHOST_SystemSDL.h
+ intern/GHOST_WindowSDL.h
+ )
+ add_definitions(-DWITH_SDL_GHOST)
+ endif()
+
+
# ack, this is still system dependant
if(APPLE)
if(WITH_COCOA)
@@ -124,6 +138,8 @@
)
endif()
+ list(APPEND INC_SYS ${SDL_INCLUDE_DIR})
+
elseif(APPLE)
if(WITH_COCOA)
list(APPEND SRC
Modified: branches/soc-2011-tomato/intern/ghost/GHOST_Types.h
===================================================================
--- branches/soc-2011-tomato/intern/ghost/GHOST_Types.h 2011-07-12 18:04:29 UTC (rev 38338)
+++ branches/soc-2011-tomato/intern/ghost/GHOST_Types.h 2011-07-12 18:06:16 UTC (rev 38339)
@@ -218,8 +218,9 @@
GHOST_kStandardCursorBottomLeftCorner,
GHOST_kStandardCursorCopy,
GHOST_kStandardCursorCustom,
- GHOST_kStandardCursorNumCursors,
- GHOST_kStandardCursorPencil
+ GHOST_kStandardCursorPencil,
+
+ GHOST_kStandardCursorNumCursors
} GHOST_TStandardCursor;
Copied: branches/soc-2011-tomato/intern/ghost/intern/GHOST_DisplayManagerSDL.cpp (from rev 38338, trunk/blender/intern/ghost/intern/GHOST_DisplayManagerSDL.cpp)
===================================================================
--- branches/soc-2011-tomato/intern/ghost/intern/GHOST_DisplayManagerSDL.cpp (rev 0)
+++ branches/soc-2011-tomato/intern/ghost/intern/GHOST_DisplayManagerSDL.cpp 2011-07-12 18:06:16 UTC (rev 38339)
@@ -0,0 +1,93 @@
+/*
+ * $Id:
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file ghost/intern/GHOST_DisplayManagerSDL.cpp
+ * \ingroup GHOST
+ */
+
+#include "GHOST_SystemSDL.h"
+#include "GHOST_DisplayManagerSDL.h"
+
+GHOST_DisplayManagerSDL::GHOST_DisplayManagerSDL(GHOST_SystemSDL *system)
+ :
+ GHOST_DisplayManager(),
+ m_system(system)
+{
+ /* do nothing */
+}
+
+GHOST_TSuccess
+GHOST_DisplayManagerSDL::getNumDisplays(GHOST_TUns8& numDisplays)
+{
+ numDisplays= SDL_GetNumVideoDisplays();
+ return GHOST_kSuccess;
+}
+
+
+GHOST_TSuccess GHOST_DisplayManagerSDL::getNumDisplaySettings(GHOST_TUns8 display,
+ GHOST_TInt32& numSettings)
+{
+ GHOST_ASSERT(display < 1, "Only single display systems are currently supported.\n");
+ numSettings= GHOST_TInt32(1);
+ return GHOST_kSuccess;
+}
+
+GHOST_TSuccess
+GHOST_DisplayManagerSDL::getDisplaySetting(GHOST_TUns8 display,
+ GHOST_TInt32 index,
+ GHOST_DisplaySetting& setting)
+{
+
+ GHOST_ASSERT(display < 1, "Only single display systems are currently supported.\n");
+ GHOST_ASSERT(index < 1, "Requested setting outside of valid range.\n");
+ SDL_DisplayMode mode;
+
+ SDL_GetDesktopDisplayMode(display, &mode);
+
+ setting.xPixels= mode.w;
+ setting.yPixels= mode.h;
+ setting.bpp= SDL_BYTESPERPIXEL(mode.format);
+ /* assume 60 when unset */
+ setting.frequency= mode.refresh_rate ? mode.refresh_rate : 60;
+
+ return GHOST_kSuccess;
+}
+
+GHOST_TSuccess
+GHOST_DisplayManagerSDL::getCurrentDisplaySetting(GHOST_TUns8 display,
+ GHOST_DisplaySetting& setting)
+{
+ return getDisplaySetting(display,GHOST_TInt32(0),setting);
+}
+
+GHOST_TSuccess
+GHOST_DisplayManagerSDL:: setCurrentDisplaySetting(GHOST_TUns8 display,
+ const GHOST_DisplaySetting& setting)
+{
+ // This is never going to work robustly in X
+ // but it's currently part of the full screen interface
+
+ // we fudge it for now.
+
+ return GHOST_kSuccess;
+}
Copied: branches/soc-2011-tomato/intern/ghost/intern/GHOST_DisplayManagerSDL.h (from rev 38338, trunk/blender/intern/ghost/intern/GHOST_DisplayManagerSDL.h)
===================================================================
--- branches/soc-2011-tomato/intern/ghost/intern/GHOST_DisplayManagerSDL.h (rev 0)
+++ branches/soc-2011-tomato/intern/ghost/intern/GHOST_DisplayManagerSDL.h 2011-07-12 18:06:16 UTC (rev 38339)
@@ -0,0 +1,69 @@
+/*
+ * $Id: GHOST_DisplayManagerSDL.h 37194 2011-06-05 00:10:20Z gsrb3d $
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file ghost/intern/GHOST_DisplayManagerSDL.h
+ * \ingroup GHOST
+ * Declaration of GHOST_DisplayManagerSDL class.
+ */
+
+#ifndef _GHOST_DISPLAY_MANAGER_SDL_H_
+#define _GHOST_DISPLAY_MANAGER_SDL_H_
+
+#include "GHOST_DisplayManager.h"
+
+extern "C" {
+ #include "SDL.h"
+}
+
+class GHOST_SystemSDL;
+
+class GHOST_DisplayManagerSDL : public GHOST_DisplayManager
+{
+public:
+ GHOST_DisplayManagerSDL(GHOST_SystemSDL *system);
+
+ GHOST_TSuccess
+ getNumDisplays(GHOST_TUns8& numDisplays);
+
+ GHOST_TSuccess
+ getNumDisplaySettings(GHOST_TUns8 display,
+ GHOST_TInt32& numSettings);
+
+ GHOST_TSuccess
+ getDisplaySetting(GHOST_TUns8 display,
+ GHOST_TInt32 index,
+ GHOST_DisplaySetting& setting);
+
+ GHOST_TSuccess
+ getCurrentDisplaySetting(GHOST_TUns8 display,
+ GHOST_DisplaySetting& setting);
+
+ GHOST_TSuccess
+ setCurrentDisplaySetting(GHOST_TUns8 display,
+ const GHOST_DisplaySetting& setting);
+
+private :
+ GHOST_SystemSDL * m_system;
+};
+
+#endif /* _GHOST_DISPLAY_MANAGER_SDL_H_ */
Modified: branches/soc-2011-tomato/intern/ghost/intern/GHOST_ISystem.cpp
===================================================================
--- branches/soc-2011-tomato/intern/ghost/intern/GHOST_ISystem.cpp 2011-07-12 18:04:29 UTC (rev 38338)
+++ branches/soc-2011-tomato/intern/ghost/intern/GHOST_ISystem.cpp 2011-07-12 18:06:16 UTC (rev 38339)
@@ -43,6 +43,8 @@
#ifdef WITH_HEADLESS
# include "GHOST_SystemNULL.h"
+#elif defined(WITH_SDL_GHOST)
+# include "GHOST_SystemSDL.h"
#elif defined(WIN32)
# include "GHOST_SystemWin32.h"
#else
@@ -67,6 +69,8 @@
if (!m_system) {
#ifdef WITH_HEADLESS
m_system = new GHOST_SystemNULL();
+#elif defined(WITH_SDL_GHOST)
+ m_system = new GHOST_SystemSDL();
#elif defined(WIN32)
m_system = new GHOST_SystemWin32 ();
#else
Modified: branches/soc-2011-tomato/intern/ghost/intern/GHOST_NDOFManager.cpp
===================================================================
--- branches/soc-2011-tomato/intern/ghost/intern/GHOST_NDOFManager.cpp 2011-07-12 18:04:29 UTC (rev 38338)
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list