7c58145524[mtl surface] Allow setting swap interval to 0. Note however that vsync needs to be turned off at the OS level for that to work smoothly. Otherwise, we get jittery frame rate with stalls when we run off of drawables (I suppose? should investigate some more). This can be done with Quart Debugger in Additional Tools for XCode.Martin Fouilleul2023-03-13 12:21:33 +0100
5455c2a52b[ui] Allow styling overlay boxes (e.g. menu and drop-down list panels) locally. - Added an UI_FLAG_OVERLAY flag. When we make a box with that flag set, it is added the an overlayList in the ui context. - After styling and static size pass, we reparent boxes in the overlayList to an overlay node just below the root node. - Layout and drawing works uniformly on the whole tree. Overlay boxes get drawn last and steal mouse hover from boxes underneath them.Martin Fouilleul2023-03-13 10:26:39 +0100
9accf4c666[ui, win32] - change coord system of gl canvas to match ui - change mouse coordinate system to match ui - fix mouse deltamartinfouilleul2023-03-09 17:38:41 +0100
873d4ab6db[ui, canvas] - Allow querying the size of the canvas's underlying surface - Set size of ui root to canvas' sizeMartin Fouilleul2023-03-08 15:03:35 +0100
1212d714d5[platform/canvas] - Changed canvas coordinate system to match UI coord system (origin at top left, y axis down) - Changed mouse coordinate system to match UI and canvas - No need to pass width/height to ui_begin_frame() anymoreMartin Fouilleul2023-03-08 13:19:18 +0100
7b2ef080e8[util, formatting] shorten list loop names to for_list_xxxMartin Fouilleul2023-03-08 12:03:33 +0100
3682605f97[util, formatting] changed list api to snakecase for consistency with the rest of the codebaseMartin Fouilleul2023-03-08 12:00:10 +0100
bfc19665ce[util] - shorten str8_lit macro to STR8 - use strlen() in STR8 and remove str8_from_cstring(). Usage with string literal seem to always be optimized by compile-time constant, so there's little need for a confusing macro that only works with literals and breaks with pointers. - replaced str8_unbox() with str8_lp/str8_ipMartin Fouilleul2023-03-08 11:40:40 +0100
8b06cb31ba[ui, styling] - Put all styling calls _before_ the styled box. - Renamed full pattern matching API to ui_style_match_next_before/after - Helper to style next box only (ui_style_next())Martin Fouilleul2023-03-08 11:09:28 +0100
c551135933[ui] remove the need to pass a default style to ui_frame()Martin Fouilleul2023-03-07 19:44:22 +0100
2466241b1e[ui, styling] finished first pass on core layout/styling systemMartin Fouilleul2023-03-07 19:27:01 +0100
4359bdaa3c[ui, textbox] position cursor at mouse position / extend selection on shift + mouse press or dragMartin Fouilleul2023-03-05 15:59:57 +0100
e95efe85e8[wip, input system] Fixed bug on macOS, where keyUp events are not received when the command modifier key is down and makes a meaningful combination with the pressed key (note this is normal macOS event handling behaviour, but we still want all events to arrive to track key states). Fixed by overloading the sendEvent method of our derived NSApplication class. There we check if modifier is down and send the event. Note glfw solves that by adding a block handler for the keyUp event with addLocalMonitorForEventsMatchingMask.Martin Fouilleul2023-03-04 19:24:30 +0100
c04e8639ab[wip, ui] re-integrating UI subsystem and completing text boxMartin Fouilleul2023-03-03 20:09:44 +0100
731e5b1ae8[surface] pull mp_layer into the generic mg_surface_data struct, out of each backend-specific implementationMartin Fouilleul2023-03-03 11:50:12 +0100
3615775168[canvas] decompose image atlas API into simple rect atlas API + image atlas helpers. This avoids creating a bunch of new types/handles, and exposes the underlying image/sourceRegion so that user code can freely use these for more complex scenarios (eg drawing only a sub-region of an atlased image, or using an atlas image for arbitrary path filling)Martin Fouilleul2023-02-28 16:54:39 +0100
30aa6a4a48[canvas] Put primitive's transform in the attributes struct. When rendering, set current transform at the beginning of mg_next_shape(). (This avoid using an additional prevTransform matrix to correctly setup uvTransform when mg_finalize_shape() at the beginning of mg_next_shape())Martin Fouilleul2023-02-27 15:01:44 +0100
d195fb1f61[canvas, mtl backend] Compute each layer with pre-multiplied alpha, starting from transparent color. Composite them to surface with premultiplied alpha too.Martin Fouilleul2023-02-27 14:24:59 +0100
9ed630fc55[canvas] - Clear final surface to clear color, and enable blending layers onto it - Fixed Batching bug where we were writing to vertex/shape buffers while the previous batch is using them - Fixed bug where uvTransform uses transform of next shape instead of that of shape being finalizedMartin Fouilleul2023-02-27 11:56:04 +0100
e66932e624[canvas] Set command attributes to canvas->attributes by default in mg_push_command()Martin Fouilleul2023-02-25 15:35:24 +0100
193afb61fd[canvas] move canvas structs decl from graphics_internal.h to graphics.c, keep only surface/canvas backend interface stuff in graphics_internal.hMartin Fouilleul2023-02-25 15:23:15 +0100
074b17b743[canvas] Set transform matrix as part of primitive and don't replay push/pop during renderMartin Fouilleul2023-02-25 14:20:07 +0100
5be019d166[canvas, metal] compute uv coords in shader using uvTransformed computed in canvas backend, using shape bounding box, image dimension, source and dest regionsMartin Fouilleul2023-02-24 18:50:46 +0100
d1b71110bb- Fixed metal canvas backend's drawBatch argument order - Removed texturing in metal shader while we work on image API - Started working on simple image APIMartin Fouilleul2023-02-23 18:30:47 +0100
4b9b182762Removed todo. Track todos/dev notes/etc in external obsidian vault for nowmartinfouilleul2023-02-22 17:21:31 +0100
0f5c93b767[win32 build] use /DELAYLOAD option for libEGL and libGLESv2 to allow apps that don't use GLES backend to work without redistributing those unused DLLsmartinfouilleul2023-02-21 19:02:16 +0100
665c63c3d0[win32 build/link] - Build milepost as a dynamic library - Add import/export directives to public API symbols - Change example build scripts accordinglymartinfouilleul2023-02-21 18:43:30 +0100
3b26c92c85[osx build/linking] - Remove the need for client apps to explicitly link with all dependent libs and frameworks - Don't require redistributing libEGL/libGLES if not used, by linking them with '-weak-l' option - Change examples build scripts accordinglyMartin Fouilleul2023-02-21 17:09:26 +0100
94373d12ae[surface] extracted common layer functionality from osx surfaces. Use layer in platform-agnostic egl surface.Martin Fouilleul2023-02-21 13:40:30 +0100
9ea9ea7636[surface] abstracted child window layer from win32 surfacesmartinfouilleul2023-02-21 12:35:22 +0100
5ac512c15e[wgl] Keep dummy window/context around for gl context creation, and don't reload wgl functions every timemartinfouilleul2023-02-20 20:20:52 +0100
20e425494fUse a custom GL loader to allow different versions of GL/GLES APIs to co-exist. The loader fills an api struct with GL functions pointers. We have a per-thread pointer to select which api struct is used, and GL functions are pound-defined to call the versions in that struct. GL/GLES surfaces can use one of the loader function to load their api, and the prepare proc of the surface sets its api as the current one before gl calls are issued.martinfouilleul2023-02-16 19:34:22 +0100
54df26232c[wip, opengl] include gl headers in generated glapi filesMartin Fouilleul2023-02-16 15:16:51 +0100
a32e2165c7[wip, opengl] parsing opengl xml spec to auto-generate gl/gles loaderMartin Fouilleul2023-02-16 13:59:11 +0100
80ea8db687[surface/canvas cleanup] - Make build-time and runtime backend selection a bit easier - Reorganized backend-specific files with slightly more coherent naming schememartinfouilleul2023-02-10 16:56:10 +0100
af7cbae1fa[canvas cleanup] cleanup canvas resources on creation failuremartinfouilleul2023-02-09 18:18:12 +0100
35e396e4c4[canvas cleanup] - Remove attributes/color arguments in functions where we don't need them anymore (since they're defined when calling mg_next_shape()) - Renamed "_with_zindex" functions with "_path" -> these function only fill a path (eg rect), but don't increment the current shapemartinfouilleul2023-02-09 17:02:58 +0100
09a18419e4[canvas] make shapeIndex implicit in calls to mg_push_vertexmartinfouilleul2023-02-09 16:42:02 +0100
4e816a838b[Clean canvas/shaders] - Simplified shader names, prefix embedded strings by "glsl_" - Extracted shader compilation in common function - Add shader version string and common structs in canvas code rather than in every shader file - Renamed zIndex with shapeIndex everywheremartinfouilleul2023-02-09 16:14:15 +0100
4a8c77f023- Move and Zoom perf_text example with the mouse - Reverted to using 4 bits of subpixel precision and computing cross products with 32 bits integers, for perf reasons - Fixed some confusion in tile array size vs number of elements (could still clean-up naming a bit though) - Fixed bug where triangles on the left or below canvas boundaries where bucketted to the first colum/row of tiles - Fixed bug in mouse button message handling (was always sending press on left button)martinfouilleul2023-02-09 13:09:41 +0100