Sculpt-dev: Print error message to console
when wintab initilization fails.
This commit is contained in:
parent
a34611b453
commit
cc5c1e7837
|
@ -25,6 +25,18 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef ATTR_NO_OPT
|
||||
#ifdef __clang__
|
||||
# define ATTR_NO_OPT __attribute__((optnone))
|
||||
#elif defined(_MSC_VER)
|
||||
# define ATTR_NO_OPT __pragma(optimize("", off))
|
||||
#elif defined(__GNUC__)
|
||||
# define ATTR_NO_OPT __attribute__((optimize("O0")))
|
||||
#else
|
||||
# define ATTR_NO_OPT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
# include "MEM_guardedalloc.h"
|
||||
#endif
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#define _USE_MATH_DEFINES
|
||||
|
||||
#include "GHOST_Wintab.h"
|
||||
#include <cstdio>
|
||||
|
||||
GHOST_Wintab *GHOST_Wintab::loadWintab(HWND hwnd)
|
||||
{
|
||||
|
@ -87,6 +88,9 @@ GHOST_Wintab *GHOST_Wintab::loadWintab(HWND hwnd)
|
|||
|
||||
LOGCONTEXT lc = {0};
|
||||
if (!info(WTI_DEFSYSCTX, 0, &lc)) {
|
||||
fprintf(stderr, "Failed to load Wintab driver\n");
|
||||
fflush(stderr);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -97,6 +101,9 @@ GHOST_Wintab *GHOST_Wintab::loadWintab(HWND hwnd)
|
|||
/* The Wintab spec says we must open the context disabled if we are using cursor masks. */
|
||||
auto hctx = unique_hctx(open(hwnd, &lc, FALSE), close);
|
||||
if (!hctx) {
|
||||
fprintf(stderr, "Failed to open Wintab driver\n");
|
||||
fflush(stderr);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue