17 # pragma warning(disable : 4244 4305)
64 int ltidx = (side / 2) % 4;
65 int dkidx = (ltidx + 1 + (side & 1)) % 4;
69 for (i = 0; i <
width; i++) {
70 float ltf =
pow(lt[i], 1.0 / 2.2), dkf =
pow(dk[i], 1.0 / 2.2);
71 float stf = (dkidx > ltidx) ? dkf : ltf;
72 int lx = rect[1][0] - i - 1;
73 int ly = rect[0][1] + i;
77 int x = (
corner == 0 ||
corner == 1) ? (rect[0][0] + i) : (rect[1][0] - i - 1);
78 int y = (
corner == 0 ||
corner == 3) ? (rect[0][1] + i) : (rect[1][1] - i - 1);
97 float *lt = malloc(
sizeof(*lt) *
width);
98 float *dk = malloc(
sizeof(*dk) *
width);
102 for (i = 0; i <
width; i++) {
104 lt[i] = 1.2 + (1.0 - 1.2) *
v;
105 dk[i] = 0.2 + (1.0 - 0.2) *
v;
108 glGetFloatv(GL_CURRENT_COLOR,
col);
128 int lmouse[2], lmbut[3];
144 glClearColor(0.5, 0.5, 0.5, 1);
147 glClearColor(1, 1, 1, 1);
149 glClear(GL_COLOR_BUFFER_BIT);
167 glViewport(0, 0, mw->
size[0], mw->
size[1]);
211 for (i = 0; i < 10; i++)
236 mw->
lmbut[0] = press;
241 mw->
lmbut[1] = press;
244 mw->
lmbut[2] = press;
294 sprintf(buf,
"timer: %6.2f", (
double)((
int64_t)
time) / 1000);
301 GHOST_WindowHandle win;
371 #define SCROLLBAR_PAD 2
372 #define SCROLLBAR_WIDTH 14
373 #define TEXTAREA_PAD 2
396 glViewport(0, 0, lw->
size[0], lw->
size[1]);
423 int i, ndisplines, startline;
424 int sb_rect[2][2], sb_thumb[2][2];
429 glClearColor(1, 1, 1, 1);
430 glClear(GL_COLOR_BUFFER_BIT);
453 for (i = 0; i < ndisplines; i++) {
481 lw->
lmbut[0] = press;
499 lw->
lmbut[1] = press;
502 lw->
lmbut[2] = press;
558 GHOST_WindowHandle win;
648 glClearColor(1, 1, 1, 1);
649 glClear(GL_COLOR_BUFFER_BIT);
667 glViewport(0, 0, ew->
size[0], ew->
size[1]);
693 float angle = fmod(ftime, 1.0) * 3.1415 * 2;
696 memset(&bitmap, 0,
sizeof(bitmap));
699 bitmap[0][0] |=
mask[0][0] |= 0xF;
700 bitmap[1][0] |=
mask[1][0] |= 0xF;
701 bitmap[2][0] |=
mask[2][0] |= 0xF;
702 bitmap[3][0] |=
mask[3][0] |= 0xF;
704 for (i = 0; i < 7; i++) {
708 mask[
y][
x / 8] |= (1 << (
x % 8));
710 for (i = 0; i < 64; i++) {
711 float v = (i / 63.0) * 3.1415 * 2;
712 int x = 7 +
cos(
v) * 7;
713 int y = 7 +
sin(
v) * 7;
715 mask[
y][
x / 8] |= (1 << (
x % 8));
761 GHOST_WindowHandle win;
818 GHOST_WindowHandle win;
860 fatal(
"Unable to create ghost system");
863 fatal(
"Unable to add multitest event consumer ");
867 fatal(
"Unable to create main window");
871 fatal(
"Unable to create logger window");
931 int main(
int argc,
char **argv)
typedef float(TangentPoint)[2]
int BLF_load_default(bool unique)
float BLF_height(int fontid, const char *str, size_t str_len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLF_draw(int fontid, const char *str, size_t str_len) ATTR_NONNULL(2)
void BLF_size(int fontid, float size, int dpi)
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.
GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle, uint8_t *bitmap, uint8_t *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor)
int32_t GHOST_GetWidthRectangle(GHOST_RectangleHandle rectanglehandle)
GHOST_TSuccess GHOST_SetWindowOrder(GHOST_WindowHandle windowhandle, GHOST_TWindowOrder order)
GHOST_TUserDataPtr GHOST_GetWindowUserData(GHOST_WindowHandle windowhandle)
GHOST_SystemHandle GHOST_CreateSystem(void)
GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle, GHOST_EventConsumerHandle consumerhandle)
void GHOST_SetWindowUserData(GHOST_WindowHandle windowhandle, GHOST_TUserDataPtr userdata)
bool GHOST_ProcessEvents(GHOST_SystemHandle systemhandle, bool waitForEvent)
void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle, int32_t inX, int32_t inY, int32_t *outX, int32_t *outY)
GHOST_TSuccess GHOST_SetCursorShape(GHOST_WindowHandle windowhandle, GHOST_TStandardCursor cursorshape)
uint64_t GHOST_GetEventTime(GHOST_EventHandle eventhandle)
GHOST_TUserDataPtr GHOST_GetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle)
GHOST_TSuccess GHOST_InvalidateWindow(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_DisposeWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle)
int32_t GHOST_GetHeightRectangle(GHOST_RectangleHandle rectanglehandle)
GHOST_TimerTaskHandle GHOST_InstallTimer(GHOST_SystemHandle systemhandle, uint64_t delay, uint64_t interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData)
void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle, uint32_t *width, uint32_t *height)
GHOST_TSuccess GHOST_SwapWindowBuffers(GHOST_WindowHandle windowhandle)
GHOST_TEventDataPtr GHOST_GetEventData(GHOST_EventHandle eventhandle)
GHOST_TSuccess GHOST_SetCursorVisibility(GHOST_WindowHandle windowhandle, bool visible)
GHOST_TSuccess GHOST_ActivateWindowDrawingContext(GHOST_WindowHandle windowhandle)
bool GHOST_ValidWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle)
GHOST_TEventType GHOST_GetEventType(GHOST_EventHandle eventhandle)
GHOST_WindowHandle GHOST_GetEventWindow(GHOST_EventHandle eventhandle)
void GHOST_DispatchEvents(GHOST_SystemHandle systemhandle)
GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle parent_windowhandle, const char *title, int32_t left, int32_t top, uint32_t width, uint32_t height, GHOST_TWindowState state, bool is_dialog, GHOST_TDrawingContextType type, GHOST_GLSettings glSettings)
GHOST_EventConsumerHandle GHOST_CreateEventConsumer(GHOST_EventCallbackProcPtr eventCallback, GHOST_TUserDataPtr userdata)
GHOST_RectangleHandle GHOST_GetClientBounds(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle systemhandle)
@ GHOST_kWindowStateNormal
void * GHOST_TUserDataPtr
@ GHOST_kStandardCursorUpDown
@ GHOST_kStandardCursorDefault
@ GHOST_kStandardCursorNumCursors
@ GHOST_kEventWindowClose
@ GHOST_kEventWindowUpdate
@ GHOST_kEventQuitRequest
@ GHOST_kDrawingContextTypeOpenGL
@ GHOST_kWindowOrderBottom
@ GHOST_kButtonMaskMiddle
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 y
_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 GLsizei width
Read Guarded memory(de)allocation.
static void loggerwindow_recalc_regions(LoggerWindow *lw)
ExtraWindow * extrawindow_new(MultiTestApp *app)
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)
static void extrawindow_spin_cursor(ExtraWindow *ew, uint64_t time)
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 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)
static bool multitest_event_handler(GHOST_EventHandle evt, GHOST_TUserDataPtr data)
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)
char const datatoc_bfont_ttf[]
static void mainwindow_timer_proc(GHOST_TimerTaskHandle task, uint64_t 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)
ccl_device_inline float3 pow(float3 v, float e)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
struct blender::compositor::@179::@181 task
unsigned __int64 uint64_t