diff options
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/CMakeLists.txt | 12 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_ImeWin32.cpp | 5 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_ImeWin32.h | 2 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCocoa.mm | 2 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWin32.cpp | 9 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowWin32.cpp | 34 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_XrContext.cpp | 11 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_XrContext.h | 1 | ||||
-rw-r--r-- | intern/ghost/test/CMakeLists.txt | 2 |
9 files changed, 54 insertions, 24 deletions
diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt index 84f156949aa..34d1ab1150e 100644 --- a/intern/ghost/CMakeLists.txt +++ b/intern/ghost/CMakeLists.txt @@ -291,7 +291,7 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND) include(CheckSymbolExists) set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE") check_symbol_exists(memfd_create "sys/mman.h" HAVE_MEMFD_CREATE) - if (HAVE_MEMFD_CREATE) + if(HAVE_MEMFD_CREATE) add_definitions(-DHAVE_MEMFD_CREATE) endif() @@ -307,7 +307,7 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND) pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner) pkg_check_modules(wayland-protocols wayland-protocols>=1.15) - if (${wayland-protocols_FOUND}) + if(${wayland-protocols_FOUND}) pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir) else() find_path(WAYLAND_PROTOCOLS_DIR @@ -316,7 +316,7 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND) ) endif() - if (NOT EXISTS ${WAYLAND_PROTOCOLS_DIR}) + if(NOT EXISTS ${WAYLAND_PROTOCOLS_DIR}) message(FATAL_ERROR "path to wayland-protocols not found") endif() @@ -518,11 +518,11 @@ if(WITH_XR_OPENXR) ) elseif(UNIX AND NOT APPLE) list(APPEND XR_PLATFORM_DEFINES -DXR_OS_LINUX) - if (WITH_GHOST_WAYLAND) + if(WITH_GHOST_WAYLAND) list(APPEND XR_PLATFORM_DEFINES -DXR_USE_PLATFORM_WAYLAND) endif() - if (WITH_GHOST_X11) - if (WITH_GL_EGL) + if(WITH_GHOST_X11) + if(WITH_GL_EGL) list(APPEND XR_PLATFORM_DEFINES -DXR_USE_PLATFORM_EGL) else() list(APPEND XR_PLATFORM_DEFINES -DXR_USE_PLATFORM_XLIB) diff --git a/intern/ghost/intern/GHOST_ImeWin32.cpp b/intern/ghost/intern/GHOST_ImeWin32.cpp index d1fc80adf56..2a1bfb633b3 100644 --- a/intern/ghost/intern/GHOST_ImeWin32.cpp +++ b/intern/ghost/intern/GHOST_ImeWin32.cpp @@ -96,7 +96,7 @@ bool GHOST_ImeWin32::IsEnglishMode() !(conversion_modes_ & (IME_CMODE_NATIVE | IME_CMODE_FULLSHAPE)); } -bool GHOST_ImeWin32::IsImeKeyEvent(char ascii) +bool GHOST_ImeWin32::IsImeKeyEvent(char ascii, GHOST_TKey key) { if (!(IsEnglishMode())) { /* In Chinese, Japanese, Korean, all alpha keys are processed by IME. */ @@ -106,7 +106,8 @@ bool GHOST_ImeWin32::IsImeKeyEvent(char ascii) if (IsLanguage(IMELANG_JAPANESE) && (ascii >= ' ' && ascii <= '~')) { return true; } - else if (IsLanguage(IMELANG_CHINESE) && ascii && strchr("!\"$'(),.:;<>?[\\]^_`/", ascii)) { + else if (IsLanguage(IMELANG_CHINESE) && ascii && strchr("!\"$'(),.:;<>?[\\]^_`/", ascii) && + !(key == GHOST_kKeyNumpadPeriod)) { return true; } } diff --git a/intern/ghost/intern/GHOST_ImeWin32.h b/intern/ghost/intern/GHOST_ImeWin32.h index ce0e4d64d53..d17a6d79503 100644 --- a/intern/ghost/intern/GHOST_ImeWin32.h +++ b/intern/ghost/intern/GHOST_ImeWin32.h @@ -161,7 +161,7 @@ class GHOST_ImeWin32 { bool IsEnglishMode(); /* Checks a key whether IME has to do handling. */ - bool IsImeKeyEvent(char ascii); + bool IsImeKeyEvent(char ascii, GHOST_TKey key); /** * Create the IME windows, and allocate required resources for them. diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index b92c3e73a88..756c4f876ed 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -890,7 +890,7 @@ bool GHOST_SystemCocoa::processEvents(bool waitForEvent) bool anyProcessed = false; NSEvent *event; - // TODO : implement timer ?? + /* TODO: implement timer? */ #if 0 do { GHOST_TimerManager* timerMgr = getTimerManager(); diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 5251dd01b29..923453d6c6f 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -105,6 +105,8 @@ */ #define BROKEN_PEEK_TOUCHPAD +static bool isStartedFromCommandPrompt(); + static void initRawInput() { #ifdef WITH_INPUT_NDOF @@ -166,7 +168,10 @@ GHOST_SystemWin32::~GHOST_SystemWin32() { // Shutdown COM OleUninitialize(); - toggleConsole(1); + + if (isStartedFromCommandPrompt()) { + toggleConsole(1); + } } uint64_t GHOST_SystemWin32::performanceCounterToMillis(__int64 perf_ticks) const @@ -1220,7 +1225,7 @@ GHOST_EventKey *GHOST_SystemWin32::processKeyEvent(GHOST_WindowWin32 *window, RA } #ifdef WITH_INPUT_IME - if (window->getImeInput()->IsImeKeyEvent(ascii)) { + if (window->getImeInput()->IsImeKeyEvent(ascii, key)) { return NULL; } #endif /* WITH_INPUT_IME */ diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp index b5d0fd8e6db..47d4ff77d17 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.cpp +++ b/intern/ghost/intern/GHOST_WindowWin32.cpp @@ -71,6 +71,8 @@ GHOST_WindowWin32::GHOST_WindowWin32(GHOST_SystemWin32 *system, m_mousePresent(false), m_inLiveResize(false), m_system(system), + m_dropTarget(NULL), + m_hWnd(0), m_hDC(0), m_isDialog(dialog), m_hasMouseCaptured(false), @@ -78,6 +80,7 @@ GHOST_WindowWin32::GHOST_WindowWin32(GHOST_SystemWin32 *system, m_nPressedButtons(0), m_customCursor(0), m_wantAlphaBackground(alphaBackground), + m_Bar(NULL), m_wintab(NULL), m_lastPointerTabletData(GHOST_TABLET_DATA_NONE), m_normal_state(GHOST_kWindowStateNormal), @@ -129,8 +132,24 @@ GHOST_WindowWin32::GHOST_WindowWin32(GHOST_SystemWin32 *system, m_hDC = ::GetDC(m_hWnd); if (!setDrawingContextType(type)) { + const char *title = "Blender - Unsupported Graphics Card Configuration"; + const char *text = + "A graphics card and driver with support for OpenGL 3.3 or higher is " + "required.\n\nInstalling the latest driver for your graphics card might resolve the " + "issue."; + if (GetSystemMetrics(SM_CMONITORS) > 1) { + text = + "A graphics card and driver with support for OpenGL 3.3 or higher is " + "required.\n\nPlugging all monitors into your primary graphics card might resolve " + "this issue. Installing the latest driver for your graphics card could also help."; + } + MessageBox(m_hWnd, text, title, MB_OK | MB_ICONERROR); + ::ReleaseDC(m_hWnd, m_hDC); ::DestroyWindow(m_hWnd); m_hWnd = NULL; + if (!parentwindow) { + exit(0); + } return; } @@ -564,20 +583,13 @@ GHOST_Context *GHOST_WindowWin32::newDrawingContext(GHOST_TDrawingContextType ty (m_debug_context ? WGL_CONTEXT_DEBUG_BIT_ARB : 0), GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY); - if (context->initializeDrawingContext()) { - return context; - } - else { - MessageBox(m_hWnd, - "A graphics card and driver with support for OpenGL 3.3 or higher is required.\n" - "Installing the latest driver for your graphics card may resolve the issue.\n\n" - "The program will now close.", - "Blender - Unsupported Graphics Card or Driver", - MB_OK | MB_ICONERROR); + if (context && !context->initializeDrawingContext()) { delete context; - exit(0); + context = nullptr; } + return context; + #elif defined(WITH_GL_PROFILE_COMPAT) // ask for 2.1 context, driver gives any GL version >= 2.1 // (hopefully the latest compatibility profile) diff --git a/intern/ghost/intern/GHOST_XrContext.cpp b/intern/ghost/intern/GHOST_XrContext.cpp index 15b40690d83..9fa93f0c4b4 100644 --- a/intern/ghost/intern/GHOST_XrContext.cpp +++ b/intern/ghost/intern/GHOST_XrContext.cpp @@ -86,6 +86,7 @@ void GHOST_XrContext::initialize(const GHOST_XrContextCreateInfo *create_info) initApiLayers(); initExtensions(); if (isDebugMode()) { + printSDKVersion(); printAvailableAPILayersAndExtensionsInfo(); } @@ -156,6 +157,16 @@ void GHOST_XrContext::storeInstanceProperties() /** \name Debug Printing * \{ */ +void GHOST_XrContext::printSDKVersion() +{ + const XrVersion sdk_version = XR_CURRENT_API_VERSION; + + printf("OpenXR SDK Version: %u.%u.%u\n", + XR_VERSION_MAJOR(sdk_version), + XR_VERSION_MINOR(sdk_version), + XR_VERSION_PATCH(sdk_version)); +} + void GHOST_XrContext::printInstanceInfo() { assert(m_oxr->instance != XR_NULL_HANDLE); diff --git a/intern/ghost/intern/GHOST_XrContext.h b/intern/ghost/intern/GHOST_XrContext.h index 479b50e1537..b00f017ff59 100644 --- a/intern/ghost/intern/GHOST_XrContext.h +++ b/intern/ghost/intern/GHOST_XrContext.h @@ -126,6 +126,7 @@ class GHOST_XrContext : public GHOST_IXrContext { void storeInstanceProperties(); void initDebugMessenger(); + void printSDKVersion(); void printInstanceInfo(); void printAvailableAPILayersAndExtensionsInfo(); void printExtensionsAndAPILayersToEnable(); diff --git a/intern/ghost/test/CMakeLists.txt b/intern/ghost/test/CMakeLists.txt index acd0da8785e..c564085c774 100644 --- a/intern/ghost/test/CMakeLists.txt +++ b/intern/ghost/test/CMakeLists.txt @@ -292,7 +292,7 @@ target_link_libraries(multitest_c guardedalloc_lib wcwidth_lib ${OPENGL_gl_LIBRARY} - ${FREETYPE_LIBRARIES} + ${FREETYPE_LIBRARIES} ${BROTLI_LIBRARIES} ${ZLIB_LIBRARIES} ${CMAKE_DL_LIBS} ${PLATFORM_LINKLIBS} |