BGE: alpha on frame buffer and precedence of MSAA over swap.
[blender.git] / intern / ghost / CMakeLists.txt
index 12dd4c0d3eb0d4be5a92769280889c2e2f51ede6..e549a48d4b93aa91a26d2df0c36212d86906814b 100644 (file)
@@ -25,6 +25,7 @@
 
 set(INC
        .
+       ../glew-mx
        ../string
        ../../source/blender/imbuf
        ../../source/blender/makesdna
@@ -38,13 +39,14 @@ set(SRC
        intern/GHOST_Buttons.cpp
        intern/GHOST_C-api.cpp
        intern/GHOST_CallbackEventConsumer.cpp
+       intern/GHOST_Context.cpp
+       intern/GHOST_ContextNone.cpp
        intern/GHOST_DisplayManager.cpp
        intern/GHOST_EventManager.cpp
        intern/GHOST_ISystem.cpp
        intern/GHOST_ISystemPaths.cpp
        intern/GHOST_ModifierKeys.cpp
        intern/GHOST_Path-api.cpp
-       intern/GHOST_Path-api.cpp
        intern/GHOST_Rect.cpp
        intern/GHOST_System.cpp
        intern/GHOST_TimerManager.cpp
@@ -64,6 +66,8 @@ set(SRC
 
        intern/GHOST_Buttons.h
        intern/GHOST_CallbackEventConsumer.h
+       intern/GHOST_Context.h
+       intern/GHOST_ContextNone.h
        intern/GHOST_Debug.h
        intern/GHOST_DisplayManager.h
        intern/GHOST_Event.h
@@ -121,89 +125,46 @@ if(WITH_HEADLESS OR WITH_GHOST_SDL)
                        intern/GHOST_DisplayManagerSDL.cpp
                        intern/GHOST_SystemSDL.cpp
                        intern/GHOST_WindowSDL.cpp
+                       intern/GHOST_ContextSDL.cpp
 
                        intern/GHOST_DisplayManagerSDL.h
                        intern/GHOST_SystemSDL.h
                        intern/GHOST_WindowSDL.h
+                       intern/GHOST_ContextSDL.h
                )
                add_definitions(-DWITH_GHOST_SDL)
        endif()
 
-
-       # ack, this is still system dependant
-       if(APPLE)
-               if(WITH_COCOA)
-                       list(APPEND SRC
-                               intern/GHOST_SystemPathsCocoa.mm
-                               intern/GHOST_SystemPathsCocoa.h
-                       )
-               else()
-                       list(APPEND SRC
-                               intern/GHOST_SystemPathsCarbon.cpp
-                               intern/GHOST_SystemPathsCarbon.h
-                       )
-               endif()
-
-       elseif(UNIX)
-               list(APPEND SRC
-                       intern/GHOST_SystemPathsX11.cpp
-                       intern/GHOST_SystemPathsX11.h
-               )
-
-               if(NOT WITH_INSTALL_PORTABLE)
-                       add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
-               endif()
-
-       elseif(WIN32)
-               list(APPEND SRC
-                       intern/GHOST_SystemPathsWin32.cpp
-
-                       intern/GHOST_SystemPathsWin32.h
-               )
-
-               list(APPEND INC
-                       ../utfconv
-               )
-       endif()
-
        if(NOT WITH_HEADLESS)
                list(APPEND INC_SYS
                        ${SDL_INCLUDE_DIR}
                )
        endif()
 
-elseif(APPLE)
-       if(WITH_COCOA)
+elseif(APPLE AND NOT WITH_X11)
+       list(APPEND SRC
+               intern/GHOST_DisplayManagerCocoa.mm
+               intern/GHOST_SystemCocoa.mm
+               intern/GHOST_WindowCocoa.mm
+
+               intern/GHOST_DisplayManagerCocoa.h
+               intern/GHOST_SystemCocoa.h
+               intern/GHOST_WindowCocoa.h
+       )
+
+       if(NOT WITH_GL_EGL)
                list(APPEND SRC
-                       intern/GHOST_DisplayManagerCocoa.mm
-                       intern/GHOST_SystemCocoa.mm
-                       intern/GHOST_SystemPathsCocoa.mm
-                       intern/GHOST_WindowCocoa.mm
-
-                       intern/GHOST_DisplayManagerCocoa.h
-                       intern/GHOST_SystemCocoa.h
-                       intern/GHOST_SystemPathsCocoa.h
-                       intern/GHOST_WindowCocoa.h
-               )
+                       intern/GHOST_ContextCGL.mm
 
-               if(WITH_INPUT_NDOF)
-                       list(APPEND SRC
-                               intern/GHOST_NDOFManagerCocoa.mm
-                               intern/GHOST_NDOFManagerCocoa.h
-                       )
-               endif()
+                       intern/GHOST_ContextCGL.h
+               )
+       endif()
 
-       else()
+       if(WITH_INPUT_NDOF)
                list(APPEND SRC
-                       intern/GHOST_DisplayManagerCarbon.cpp
-                       intern/GHOST_SystemCarbon.cpp
-                       intern/GHOST_SystemPathsCarbon.cpp
-                       intern/GHOST_WindowCarbon.cpp
-
-                       intern/GHOST_DisplayManagerCarbon.h
-                       intern/GHOST_SystemCarbon.h
-                       intern/GHOST_SystemPathsCarbon.h
-                       intern/GHOST_WindowCarbon.h
+                       intern/GHOST_NDOFManagerCocoa.mm
+
+                       intern/GHOST_NDOFManagerCocoa.h
                )
        endif()
 
@@ -211,8 +172,7 @@ elseif(APPLE)
                add_definitions(-DWITH_QUICKTIME)
        endif()
 
-elseif(UNIX)
-
+elseif(WITH_X11)
        list(APPEND INC_SYS
                ${X11_X11_INCLUDE_PATH}
        )
@@ -220,15 +180,21 @@ elseif(UNIX)
        list(APPEND SRC
                intern/GHOST_DisplayManagerX11.cpp
                intern/GHOST_SystemX11.cpp
-               intern/GHOST_SystemPathsX11.cpp
                intern/GHOST_WindowX11.cpp
 
                intern/GHOST_DisplayManagerX11.h
                intern/GHOST_SystemX11.h
-               intern/GHOST_SystemPathsX11.h
                intern/GHOST_WindowX11.h
        )
 
+       if(NOT WITH_GL_EGL)
+               list(APPEND SRC
+                       intern/GHOST_ContextGLX.cpp
+
+                       intern/GHOST_ContextGLX.h
+               )
+       endif()
+
        if(WITH_GHOST_XDND)
                add_definitions(-DWITH_XDND)
 
@@ -257,11 +223,15 @@ elseif(UNIX)
                )
        endif()
 
+       if(WITH_X11_ALPHA)
+               add_definitions(-DWITH_X11_ALPHA)
+       endif()
+
        if(WITH_INPUT_NDOF)
                list(APPEND SRC
-                       intern/GHOST_NDOFManagerX11.cpp
+                       intern/GHOST_NDOFManagerUnix.cpp
 
-                       intern/GHOST_NDOFManagerX11.h
+                       intern/GHOST_NDOFManagerUnix.h
                )
        endif()
 
@@ -276,6 +246,8 @@ elseif(UNIX)
                )
        endif()
 
+       add_definitions(-DWITH_X11)
+
 elseif(WIN32)
        ## Warnings as errors, this is too strict!
        #if(MSVC)
@@ -286,25 +258,37 @@ elseif(WIN32)
                ${WINTAB_INC}
        )
 
-       list(APPEND INC
-               ../utfconv
-       )
-
        list(APPEND SRC
                intern/GHOST_DisplayManagerWin32.cpp
                intern/GHOST_SystemWin32.cpp
-               intern/GHOST_SystemPathsWin32.cpp
                intern/GHOST_WindowWin32.cpp
                intern/GHOST_DropTargetWin32.cpp
 
                intern/GHOST_DisplayManagerWin32.h
                intern/GHOST_DropTargetWin32.h
                intern/GHOST_SystemWin32.h
-               intern/GHOST_SystemPathsWin32.h
                intern/GHOST_WindowWin32.h
                intern/GHOST_TaskbarWin32.h
        )
 
+       if(NOT WITH_GL_EGL)
+               list(APPEND SRC
+                       intern/GHOST_ContextWGL.cpp
+                               
+                       intern/GHOST_ContextWGL.h
+               )
+       endif()
+
+       if(WITH_INPUT_IME)
+               add_definitions(-DWITH_INPUT_IME)
+
+               list(APPEND SRC
+                       intern/GHOST_ImeWin32.cpp
+
+                       intern/GHOST_ImeWin32.h
+               )
+       endif()
+
        if(WITH_INPUT_NDOF)
                list(APPEND SRC
                        intern/GHOST_NDOFManagerWin32.cpp
@@ -312,8 +296,44 @@ elseif(WIN32)
                        intern/GHOST_NDOFManagerWin32.h
                )
        endif()
+endif()
 
+if(WITH_GL_EGL AND NOT (WITH_HEADLESS OR WITH_GHOST_SDL))
+       list(APPEND SRC
+               intern/GHOST_ContextEGL.cpp
+                       
+               intern/GHOST_ContextEGL.h
+       )
 endif()
 
-blender_add_lib(bf_intern_ghost "${SRC}" "${INC}" "${INC_SYS}")
+if(APPLE)
+       list(APPEND SRC
+               intern/GHOST_SystemPathsCocoa.mm
+               intern/GHOST_SystemPathsCocoa.h
+       )
 
+elseif(UNIX)
+       list(APPEND SRC
+               intern/GHOST_SystemPathsUnix.cpp
+               intern/GHOST_SystemPathsUnix.h
+       )
+
+       if(NOT WITH_INSTALL_PORTABLE)
+               add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
+       endif()
+
+elseif(WIN32)
+       list(APPEND SRC
+               intern/GHOST_SystemPathsWin32.cpp
+               intern/GHOST_SystemPathsWin32.h
+       )
+
+       list(APPEND INC
+               ../utfconv
+       )
+
+endif()
+
+add_definitions(${GL_DEFINITIONS})
+
+blender_add_lib(bf_intern_ghost "${SRC}" "${INC}" "${INC_SYS}")