[Bf-blender-cvs] [d9ffc99] soc-2014-viewport_fx: Merge branch 'master' into soc-2014-viewport_fx
Antony Riakiotakis
noreply at git.blender.org
Mon Sep 8 18:17:44 CEST 2014
Commit: d9ffc99e66d659ac887d801b9cc071b4c3f9b8ab
Author: Antony Riakiotakis
Date: Mon Sep 8 18:15:42 2014 +0200
Branches: soc-2014-viewport_fx
https://developer.blender.org/rBd9ffc99e66d659ac887d801b9cc071b4c3f9b8ab
Merge branch 'master' into soc-2014-viewport_fx
I have resolved some differences, for instance selection code which was more or less a stub, to be
the same as master. This will have to be fixed later.
Conflicts:
CMakeLists.txt
intern/ghost/CMakeLists.txt
intern/ghost/intern/GHOST_SystemWin32.cpp
intern/ghost/intern/GHOST_Window.cpp
intern/ghost/intern/GHOST_WindowWin32.cpp
intern/ghost/intern/GHOST_WindowX11.cpp
source/blender/blenlib/BLI_math_matrix.h
source/blender/blenlib/intern/math_matrix.c
source/blender/gpu/CMakeLists.txt
source/blender/gpu/GPU_select.h
source/blender/gpu/intern/gpu_buffers.c
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_extensions.c
source/blender/gpu/intern/gpu_select.c
source/blender/gpu/shaders/gpu_shader_simple_vert.glsl
source/blender/nodes/CMakeLists.txt
===================================================================
===================================================================
diff --cc CMakeLists.txt
index 432e5eb,1c063e2..1e079d9
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@@ -1025,6 -982,11 +1038,10 @@@ elseif(WIN32
add_definitions(-DWIN32)
if(MSVC)
-
+ # needed for some MSVC installations
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
+ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
list(APPEND PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid psapi)
diff --cc intern/cycles/app/CMakeLists.txt
index 00544ae,5876ac3..34e9581
--- a/intern/cycles/app/CMakeLists.txt
+++ b/intern/cycles/app/CMakeLists.txt
@@@ -28,10 -28,10 +28,12 @@@ set(LIBRARIE
${JPEG_LIBRARIES}
${ZLIB_LIBRARIES}
${TIFF_LIBRARY}
+ extern_clew
+ extern_cuew
)
+add_definitions(${GL_DEFINITIONS})
+
if(WIN32)
list(APPEND LIBRARIES ${PTHREADS_LIBRARIES})
endif()
diff --cc intern/cycles/blender/CMakeLists.txt
index ad553fb,548aac8..e97ad2e
--- a/intern/cycles/blender/CMakeLists.txt
+++ b/intern/cycles/blender/CMakeLists.txt
@@@ -44,9 -43,10 +44,10 @@@ set(ADDON_FILE
addon/presets.py
addon/properties.py
addon/ui.py
+ addon/version_update.py
)
-add_definitions(-DGLEW_STATIC)
+add_definitions(${GL_DEFINITIONS})
blender_add_lib(bf_intern_cycles "${SRC}" "${INC}" "${INC_SYS}")
diff --cc intern/cycles/device/CMakeLists.txt
index 318e446,a62ce29..998b353
--- a/intern/cycles/device/CMakeLists.txt
+++ b/intern/cycles/device/CMakeLists.txt
@@@ -10,7 -9,10 +10,9 @@@ set(IN
)
set(INC_SYS
- ${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_PATH}
+ ../../../extern/cuew/include
+ ../../../extern/clew/include
)
set(SRC
diff --cc intern/ghost/intern/GHOST_Context.cpp
index 211c712,0000000..c3483d7
mode 100644,000000..100644
--- a/intern/ghost/intern/GHOST_Context.cpp
+++ b/intern/ghost/intern/GHOST_Context.cpp
@@@ -1,152 -1,0 +1,152 @@@
+/*
+ * ***** 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.
+ *
+ * The Original Code is Copyright (C) 2013 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Jason Wilkins
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file ghost/intern/GHOST_Context.cpp
+ * \ingroup GHOST
+ * Definition of GHOST_Context class.
+ */
+
+#include "GHOST_Context.h"
+
+#include <cstdio>
+#include <cstring>
+
+
+
- const char* get_glew_error_message_string(GLenum error)
++static const char* get_glew_error_message_string(GLenum error)
+{
+ switch (error) {
+ case GLEW_OK: /* also GLEW_NO_ERROR */
+ return "OK";
+
+ case GLEW_ERROR_NO_GL_VERSION:
+ return "Unable to determine GL version.";
+
+ case GLEW_ERROR_GL_VERSION_10_ONLY:
+ return "OpenGL 1.1 or later is required.";
+
+ case GLEW_ERROR_GLX_VERSION_11_ONLY:
+ return "GLX 1.2 or later is required.";
+
- #if WITH_GLEW_ES
++#ifdef WITH_GLEW_ES
+ case GLEW_ERROR_NOT_GLES_VERSION:
+ return "OpenGL ES is required.";
+
+ case GLEW_ERROR_GLES_VERSION:
+ return "A non-ES version of OpenGL is required.";
+
+ case GLEW_ERROR_NO_EGL_VERSION:
+ return "Unabled to determine EGL version.";
+
+ case GLEW_ERROR_EGL_VERSION_10_ONLY:
+ return "EGL 1.1 or later is required.";
+#endif
+
+ default:
+ return NULL;
+ }
+}
+
+
+
- const char* get_glew_error_enum_string(GLenum error)
++static const char* get_glew_error_enum_string(GLenum error)
+{
+ switch (error) {
+ case GLEW_OK: /* also GLEW_NO_ERROR */
+ return "GLEW_OK";
+
+ case GLEW_ERROR_NO_GL_VERSION:
+ return "GLEW_ERROR_NO_GL_VERSION";
+
+ case GLEW_ERROR_GL_VERSION_10_ONLY:
+ return "GLEW_ERROR_GL_VERSION_10_ONLY";
+
+ case GLEW_ERROR_GLX_VERSION_11_ONLY:
+ return "GLEW_ERROR_GLX_VERSION_11_ONLY";
+
- #if WITH_GLEW_ES
++#ifdef WITH_GLEW_ES
+ case GLEW_ERROR_NOT_GLES_VERSION:
+ return "GLEW_ERROR_NOT_GLES_VERSION";
+
+ case GLEW_ERROR_GLES_VERSION:
+ return "GLEW_ERROR_GLES_VERSION";
+
+ case GLEW_ERROR_NO_EGL_VERSION:
+ return "GLEW_ERROR_NO_EGL_VERSION";
+
+ case GLEW_ERROR_EGL_VERSION_10_ONLY:
+ return "GLEW_ERROR_EGL_VERSION_10_ONLY";
+#endif
+
+ default:
+ return NULL;
+ }
+}
+
+
+
+GLenum glew_chk(GLenum error, const char* file, int line, const char* text)
+{
+ if (error != GLEW_OK) {
+ const char* code = get_glew_error_enum_string(error);
+ const char* msg = get_glew_error_message_string(error);
+
+#ifndef NDEBUG
+ fprintf(
+ stderr,
+ "%s(%d):[%s] -> GLEW Error (0x%04X): %s: %s\n",
+ file,
+ line,
+ text,
+ error,
+ code ? code : "<no symbol>",
+ msg ? msg : "<no message>");
+#else
+ fprintf(
+ stderr,
+ "GLEW Error (%04X): %s: %s\n",
+ error,
+ code ? code : "<no symbol>",
+ msg ? msg : "<no message>");
+#endif
+ }
+
+ return error;
+}
+
+
+
+void GHOST_Context::initContextGLEW()
+{
+ glewDestroyContext(m_glewContext);
+
+ glewSetContext(glewCreateContext());
+
+ m_glewContext = glewGetContext();
+
+ GLEW_CHK(glewInit());
+}
diff --cc intern/ghost/intern/GHOST_SystemWin32.cpp
index ac0d5f3,3b95373..c53c6a1
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@@ -214,38 -227,48 +227,49 @@@ void GHOST_SystemWin32::getAllDisplayDi
}
GHOST_IWindow *GHOST_SystemWin32::createWindow(
++<<<<<<< HEAD
+ const STR_String& title,
+ GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height,
+ GHOST_TWindowState state, GHOST_TDrawingContextType type,
+ bool wantStereoVisual, const bool exclusive, const GHOST_TUns16 wantNumOfAASamples, const GHOST_TEmbedderWindowID parentWindow)
++=======
+ const STR_String &title,
+ GHOST_TInt32 left, GHOST_TInt32 top,
+ GHOST_TUns32 width, GHOST_TUns32 height,
+ GHOST_TWindowState state, GHOST_TDrawingContextType type,
+ bool stereoVisual,
+ const bool exclusive,
+ const GHOST_TUns16 numOfAASamples,
+ const GHOST_TEmbedderWindowID parentWindow)
++>>>>>>> master
{
- GHOST_Window *window = 0;
- window = new GHOST_WindowWin32(this, title, left, top, width, height, state, type, stereoVisual, numOfAASamples, parentWindow);
- if (window) {
- if (window->getValid()) {
- // Store the pointer to the window
-// if (state != GHOST_kWindowStateFullScreen) {
+ GHOST_Window *window =
+ new GHOST_WindowWin32(
+ this,
+ title,
+ left,
+ top,
+ width,
+ height,
+ state,
+ type,
+ wantStereoVisual,
+ wantNumOfAASamples,
+ parentWindow);
+
+ if (window->getValid()) {
+ // Store the pointer to the window
+ //if (state != GHOST_kWindowStateFullScreen) {
m_windowManager->addWindow(window);
m_windowManager->setActiveWindow(window);
-// }
- }
- else {
-
- // Invalid parent window hwnd
- if (((GHOST_WindowWin32 *)window)->getNextWindow() == NULL) {
- delete window;
- window = 0;
- return window;
- }
-
- // An invalid window could be one that was used to test for AA
- window = ((GHOST_WindowWin32 *)window)->getNextWindow();
-
- // If another window is found, let the wm know about that one, but not the old one
- if (window->getValid()) {
- m_windowManager->addWindow(window);
- }
- else {
- delete window;
- window = 0;
- }
-
- }
+ //}
}
+ else {
+ GHOST_PRINT("GHOST_SystemWin32::createWindow(): window invalid\n");
+ delete window;
+ window = 0;
+ }
+
return window;
}
diff --cc intern/ghost/intern/GHOST_WindowWin32.cpp
index 8e52fe8,8e7e824..11ddc47
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@@ -54,9 -52,59 +54,54 @@@
const wchar_t *GHOST_WindowWin32::s_windowClassName = L"GHOST_WindowClass";
const int GHOST_WindowWin32::s_maxTitleLength = 128;
-HGLRC GHOST_WindowWin32::s_firsthGLRc = NULL;
-HDC GHOST_WindowWin32::s_firstHDC = NULL;
++<<<<<<< HEAD
++=======
+ static int WeightPixelFormat(PIXELFORMATDESCRIPTOR &pfd);
+ static int EnumPixelFormats(HDC hdc);
+
+ /*
+ * Color and depth bit values are not to be trusted.
+ * For instance, on TNT2:
+ * When the screen color depth is set to 16 bit, we get 5 color bits
+ * and 16 depth bits.
+ * When the screen color depth is set to 32 bit, we get 8 color bits
+ * and 24 depth bits.
+ * Just to be safe, we request high quality settings.
+ */
+ static PIXELFORMATDESCRIPTOR sPreferredFormat = {
+ sizeof(PIXELFORMATDESCRIPTOR), /* size */
+ 1, /* version */
+ PFD_SUPPORT_OPENGL |
+ PFD_DRAW_TO_WINDOW |
+ PFD_SWAP_COPY | /* support swap copy */
+ PFD_DOUBLEBUFFER, /* support double-buffering */
+ PFD_TYPE_RGBA, /* color type */
+ 32, /* prefered color depth */
+ 0, 0, 0, 0, 0, 0, /* color bits (ignored) */
+ 0, /* no alpha buffer */
+ 0, /* alpha bits (ignored) */
+ 0, /* no accumulation buffer */
+ 0, 0, 0, 0, /* accum bits (ignored) */
+ 32, /* depth buffer */
+ 0, /* no stencil buffer */
+ 0,
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list