33 # pragma warning(disable : 4244 4305)
80 int ltidx = (side / 2) % 4;
81 int dkidx = (ltidx + 1 + (side & 1)) % 4;
85 for (i = 0; i <
width; i++) {
86 float ltf =
pow(lt[i], 1.0 / 2.2), dkf =
pow(dk[i], 1.0 / 2.2);
87 float stf = (dkidx > ltidx) ? dkf : ltf;
88 int lx = rect[1][0] - i - 1;
89 int ly = rect[0][1] + i;
93 int x = (
corner == 0 ||
corner == 1) ? (rect[0][0] + i) : (rect[1][0] - i - 1);
94 int y = (
corner == 0 ||
corner == 3) ? (rect[0][1] + i) : (rect[1][1] - i - 1);
113 float *lt = malloc(
sizeof(*lt) *
width);
114 float *dk = malloc(
sizeof(*dk) *
width);
118 for (i = 0; i <
width; i++) {
120 lt[i] = 1.2 + (1.0 - 1.2) *
v;
121 dk[i] = 0.2 + (1.0 - 0.2) *
v;
124 glGetFloatv(GL_CURRENT_COLOR,
col);
144 int lmouse[2], lmbut[3];
160 glClearColor(0.5, 0.5, 0.5, 1);
163 glClearColor(1, 1, 1, 1);
165 glClear(GL_COLOR_BUFFER_BIT);
183 glViewport(0, 0, mw->
size[0], mw->
size[1]);
227 for (i = 0; i < 10; i++)
252 mw->
lmbut[0] = press;
257 mw->
lmbut[1] = press;
260 mw->
lmbut[2] = press;
317 GHOST_WindowHandle win;
387 #define SCROLLBAR_PAD 2
388 #define SCROLLBAR_WIDTH 14
389 #define TEXTAREA_PAD 2
412 glViewport(0, 0, lw->
size[0], lw->
size[1]);
439 int i, ndisplines, startline;
440 int sb_rect[2][2], sb_thumb[2][2];
445 glClearColor(1, 1, 1, 1);
446 glClear(GL_COLOR_BUFFER_BIT);
469 for (i = 0; i < ndisplines; i++) {
497 lw->
lmbut[0] = press;
515 lw->
lmbut[1] = press;
518 lw->
lmbut[2] = press;
574 GHOST_WindowHandle win;
664 glClearColor(1, 1, 1, 1);
665 glClear(GL_COLOR_BUFFER_BIT);
683 glViewport(0, 0, ew->
size[0], ew->
size[1]);
709 float angle = fmod(ftime, 1.0) * 3.1415 * 2;
712 memset(&bitmap, 0,
sizeof(bitmap));
715 bitmap[0][0] |=
mask[0][0] |= 0xF;
716 bitmap[1][0] |=
mask[1][0] |= 0xF;
717 bitmap[2][0] |=
mask[2][0] |= 0xF;
718 bitmap[3][0] |=
mask[3][0] |= 0xF;
720 for (i = 0; i < 7; i++) {
724 mask[
y][
x / 8] |= (1 << (
x % 8));
726 for (i = 0; i < 64; i++) {
727 float v = (i / 63.0) * 3.1415 * 2;
728 int x = 7 +
cos(
v) * 7;
729 int y = 7 +
sin(
v) * 7;
731 mask[
y][
x / 8] |= (1 << (
x % 8));
777 GHOST_WindowHandle win;
834 GHOST_WindowHandle win;
876 fatal(
"Unable to create ghost system");
879 fatal(
"Unable to add multitest event consumer ");
883 fatal(
"Unable to create main window");
887 fatal(
"Unable to create logger window");
947 int main(
int argc,
char **argv)
typedef float(TangentPoint)[2]
void BLF_draw(int fontid, const char *str, size_t len) ATTR_NONNULL(2)
float BLF_height(int fontid, const char *str, size_t len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLF_size(int fontid, int size, int dpi)
int BLF_load_default(const bool unique)
void BLF_position(int fontid, float x, float y, float z)
void BLI_kdtree_nd_() free(KDTree *tree)
typedef double(DMatrix)[4][4]
void event_to_buf(GHOST_EventHandle evt, char buf[128])
char * eventtype_to_string(GHOST_TEventType type)
GHOST C-API function and type declarations.
int GHOST_ProcessEvents(GHOST_SystemHandle systemhandle, int waitForEvent)
GHOST_TSuccess GHOST_SetWindowOrder(GHOST_WindowHandle windowhandle, GHOST_TWindowOrder order)
GHOST_TUserDataPtr GHOST_GetWindowUserData(GHOST_WindowHandle windowhandle)
GHOST_TInt32 GHOST_GetHeightRectangle(GHOST_RectangleHandle rectanglehandle)
void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle, GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32 *outX, GHOST_TInt32 *outY)
GHOST_SystemHandle GHOST_CreateSystem(void)
GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle, GHOST_EventConsumerHandle consumerhandle)
void GHOST_SetWindowUserData(GHOST_WindowHandle windowhandle, GHOST_TUserDataPtr userdata)
GHOST_TSuccess GHOST_SetCursorVisibility(GHOST_WindowHandle windowhandle, int visible)
GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle parent_windowhandle, const char *title, GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height, GHOST_TWindowState state, bool is_dialog, GHOST_TDrawingContextType type, GHOST_GLSettings glSettings)
GHOST_TSuccess GHOST_SetCursorShape(GHOST_WindowHandle windowhandle, GHOST_TStandardCursor cursorshape)
GHOST_TUserDataPtr GHOST_GetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle)
GHOST_TSuccess GHOST_InvalidateWindow(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_DisposeWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle)
GHOST_TInt32 GHOST_GetWidthRectangle(GHOST_RectangleHandle rectanglehandle)
GHOST_TSuccess GHOST_SwapWindowBuffers(GHOST_WindowHandle windowhandle)
GHOST_TEventDataPtr GHOST_GetEventData(GHOST_EventHandle eventhandle)
GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle, GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, int sizex, int sizey, int hotX, int hotY, GHOST_TUns8 canInvertColor)
GHOST_TSuccess GHOST_ActivateWindowDrawingContext(GHOST_WindowHandle windowhandle)
GHOST_TEventType GHOST_GetEventType(GHOST_EventHandle eventhandle)
GHOST_WindowHandle GHOST_GetEventWindow(GHOST_EventHandle eventhandle)
GHOST_TimerTaskHandle GHOST_InstallTimer(GHOST_SystemHandle systemhandle, GHOST_TUns64 delay, GHOST_TUns64 interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData)
void GHOST_DispatchEvents(GHOST_SystemHandle systemhandle)
void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle, GHOST_TUns32 *width, GHOST_TUns32 *height)
GHOST_EventConsumerHandle GHOST_CreateEventConsumer(GHOST_EventCallbackProcPtr eventCallback, GHOST_TUserDataPtr userdata)
GHOST_TUns64 GHOST_GetEventTime(GHOST_EventHandle eventhandle)
GHOST_RectangleHandle GHOST_GetClientBounds(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle systemhandle)
int GHOST_ValidWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle)
@ GHOST_kWindowStateNormal
void * GHOST_TUserDataPtr
@ GHOST_kStandardCursorUpDown
@ GHOST_kStandardCursorDefault
@ GHOST_kStandardCursorNumCursors
unsigned int GHOST_TUns32
unsigned long long GHOST_TUns64
@ GHOST_kEventWindowClose
@ GHOST_kEventButtonUp
Mouse button event.
@ GHOST_kEventWindowUpdate
@ GHOST_kEventButtonDown
Mouse move event.
@ GHOST_kEventKeyDown
Trackpad event.
@ GHOST_kEventQuitRequest
@ GHOST_kDrawingContextTypeOpenGL
@ GHOST_kButtonMaskMiddle
@ GHOST_kWindowOrderBottom
unsigned char GHOST_TUns8
struct GPUContext GPUContext
GPUContext * GPU_context_create(void *ghost_window)
void GPU_context_active_set(GPUContext *)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
Read Guarded memory(de)allocation.
static void loggerwindow_recalc_regions(LoggerWindow *lw)
ExtraWindow * extrawindow_new(MultiTestApp *app)
static int multitest_event_handler(GHOST_EventHandle evt, GHOST_TUserDataPtr data)
static void loggerwindow_setup_window_gl(LoggerWindow *lw)
void multitestapp_toggle_extra_window(MultiTestApp *app)
MainWindow * mainwindow_new(MultiTestApp *app)
static void mainwindow_do_button(MainWindow *mw, int which, int press)
void loggerwindow_free(LoggerWindow *lw)
static void loggerwindow_do_move(LoggerWindow *lw, int x, int y)
GHOST_SystemHandle multitestapp_get_system(MultiTestApp *app)
static void mainwindow_do_move(MainWindow *mw, int x, int y)
int main(int argc, char **argv)
static void mainwindow_timer_proc(GHOST_TimerTaskHandle task, GHOST_TUns64 time)
static void loggerwindow_handle(void *priv, GHOST_EventHandle evt)
static void loggerwindow_do_reshape(LoggerWindow *lw)
LoggerWindow * loggerwindow_new(MultiTestApp *app)
int datatoc_bfont_ttf_size
void multitestapp_free(MultiTestApp *app)
void multitestapp_free_extrawindow(MultiTestApp *app)
MultiTestApp * multitestapp_new(void)
void mainwindow_free(MainWindow *mw)
static void extrawindow_do_draw(ExtraWindow *ew)
static void mainwindow_do_key(MainWindow *mw, GHOST_TKey key, int press)
static void loggerwindow_do_key(LoggerWindow *lw, GHOST_TKey key, int press)
static void extrawindow_spin_cursor(ExtraWindow *ew, GHOST_TUns64 time)
void extrawindow_free(ExtraWindow *ew)
void rect_bevel_smooth(int rect[2][2], int width)
static void loggerwindow_do_button(LoggerWindow *lw, int which, int press)
void rect_bevel_side(int rect[2][2], int side, float *lt, float *dk, const float col[3], int width)
void multitestapp_exit(MultiTestApp *app)
void multitestapp_run(MultiTestApp *app)
LoggerWindow * multitestapp_get_logger(MultiTestApp *app)
static void mainwindow_log(MainWindow *mw, char *str)
static void extrawindow_handle(void *priv, GHOST_EventHandle evt)
void loggerwindow_log(LoggerWindow *lw, char *line)
static void extrawindow_do_reshape(ExtraWindow *ew)
static void mainwindow_handle(void *priv, GHOST_EventHandle evt)
static void mainwindow_do_reshape(MainWindow *mw)
static void loggerwindow_do_draw(LoggerWindow *lw)
static void mainwindow_do_draw(MainWindow *mw)
static void extrawindow_do_key(ExtraWindow *ew, GHOST_TKey key, int press)
void * memdbl(void *mem, int *size_pr, int item_size)
void fatal(char *fmt,...)
char * string_dup(char *str)
void windowdata_free(WindowData *wb)
WindowData * windowdata_new(void *data, WindowDataHandler handler)
void windowdata_handle(WindowData *wb, GHOST_EventHandle evt)
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
INLINE Rall1d< T, V, S > pow(const Rall1d< T, V, S > &arg, double m)
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
struct blender::compositor::@172::@174 task
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)