Commit Graph

  • 13f025ab21 [mtl canvas] convert triangle rasterization to fixed point Martin Fouilleul 2023-03-13 15:18:18 +0100
  • 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 Fouilleul 2023-03-13 12:21:33 +0100
  • 716bdc53d4 [ui] draw drop-down button with correct roundness Martin Fouilleul 2023-03-13 10:53:21 +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 Fouilleul 2023-03-13 10:26:39 +0100
  • 9e41d2b6fc [ui] first version of select popup menu Martin Fouilleul 2023-03-12 19:06:09 +0100
  • 09951afa53 [ui] added ui_checkbox() helper Martin Fouilleul 2023-03-11 19:05:25 +0100
  • b907578eb4 Fix clipping one pixel short Martin Fouilleul 2023-03-11 16:55:30 +0100
  • 009fe8e3e8 [ui, styling]Fix order of adding after rules to running list in rule-matching pass Martin Fouilleul 2023-03-11 16:43:58 +0100
  • bf92a6f307 Merge branch 'master' of ssh://git.forkingpaths.dev/martinfouilleul/milepost Martin Fouilleul 2023-03-11 16:27:52 +0100
  • da7e0f402b [ui, layout] Add UI_FLAG_ALLOW_OVERFLOW_X/Y Martin Fouilleul 2023-03-11 16:27:21 +0100
  • 137a75540b [win32] implemented string clipboard functions martinfouilleul 2023-03-09 19:44:55 +0100
  • 359e08b0a8 [ui] set text box cursor to the same color as text martinfouilleul 2023-03-09 18:09:04 +0100
  • cae8666561 [ui, win32] Fixed char input and modifier keys martinfouilleul 2023-03-09 18:03:27 +0100
  • 9accf4c666 [ui, win32] - change coord system of gl canvas to match ui - change mouse coordinate system to match ui - fix mouse delta martinfouilleul 2023-03-09 17:38:41 +0100
  • c7d5cf113e [ui] reintroducing tooltip Martin Fouilleul 2023-03-09 16:08:42 +0100
  • c362751c23 [ui] menus widgets first draft Martin Fouilleul 2023-03-09 16:02:46 +0100
  • feca7d1026 [ui] moved ui_panel() into ui.c Martin Fouilleul 2023-03-09 14:27:46 +0100
  • d2f4f5083b [ui, layout] solving layout constraints Martin Fouilleul 2023-03-09 13:13:13 +0100
  • 56874c99d6 [ui, layout] layout constraint solving, first draft Martin Fouilleul 2023-03-09 12:36:38 +0100
  • a569454df5 [ui, wip] scrolling / scrolling panels Martin Fouilleul 2023-03-08 19:53:28 +0100
  • 873d4ab6db [ui, canvas] - Allow querying the size of the canvas's underlying surface - Set size of ui root to canvas' size Martin Fouilleul 2023-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() anymore Martin Fouilleul 2023-03-08 13:19:18 +0100
  • 7b2ef080e8 [util, formatting] shorten list loop names to for_list_xxx Martin Fouilleul 2023-03-08 12:03:33 +0100
  • 3682605f97 [util, formatting] changed list api to snakecase for consistency with the rest of the codebase Martin Fouilleul 2023-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_ip Martin Fouilleul 2023-03-08 11:40:40 +0100
  • f07f56948d [ui] shorten ui styling api names Martin Fouilleul 2023-03-08 11:13:32 +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 Fouilleul 2023-03-08 11:09:28 +0100
  • c551135933 [ui] remove the need to pass a default style to ui_frame() Martin Fouilleul 2023-03-07 19:44:22 +0100
  • 2466241b1e [ui, styling] finished first pass on core layout/styling system Martin Fouilleul 2023-03-07 19:27:01 +0100
  • 8032c7340b [ui, styling] revisiting layout/sizing Martin Fouilleul 2023-03-07 19:06:04 +0100
  • d3a8a651e5 [ui, styling] make layout and floating properties part of styling system Martin Fouilleul 2023-03-07 10:33:22 +0100
  • 7b10a99a8c [ui, styling] First draft of rule-based styling to replace old stack-based system Martin Fouilleul 2023-03-06 19:33:01 +0100
  • b52a35c753 [ui, textbox] Fixed selection background rectangle Martin Fouilleul 2023-03-05 17:03:00 +0100
  • 1af132352a [ui, textbox] Scroll text inside text box to always show edit cursor. Martin Fouilleul 2023-03-05 16:35:55 +0100
  • 592f4cdecd end of line renormalization Martin Fouilleul 2023-03-05 16:05:43 +0100
  • 4359bdaa3c [ui, textbox] position cursor at mouse position / extend selection on shift + mouse press or drag Martin Fouilleul 2023-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 Fouilleul 2023-03-04 19:24:30 +0100
  • c04e8639ab [wip, ui] re-integrating UI subsystem and completing text box Martin Fouilleul 2023-03-03 20:09:44 +0100
  • d21e737733 [wip] re-introducing UI subsystem Martin Fouilleul 2023-03-03 17:13:03 +0100
  • 653ddec978 [win32 surface sharing] win32 surface sharing using window reparenting martinfouilleul 2023-03-03 12:41:09 +0100
  • 731e5b1ae8 [surface] pull mp_layer into the generic mg_surface_data struct, out of each backend-specific implementation Martin Fouilleul 2023-03-03 11:50:12 +0100
  • ac00cc9def [wip, win32 surface sharing] simplifyin the surface sharing API martinfouilleul 2023-03-02 19:21:39 +0100
  • ee87976429 [win32 surface sharing] hacky proof of concept martinfouilleul 2023-03-02 18:24:15 +0100
  • 3ada8ece9a [wip, win32 surface sharing] in surface sharing example, terminate child process when parent exits martinfouilleul 2023-03-02 12:23:10 +0100
  • e58ae3ef52 [surface sharing] first draft for win32 using window reparenting martinfouilleul 2023-03-02 09:54:12 +0100
  • 2560ddd5b4 [win32] adding simple IPC to test delegated surface martinfouilleul 2023-03-01 18:58:59 +0100
  • 1dfc5dd684 [graphics, win32] applying changes to surface backend API martinfouilleul 2023-03-01 17:41:39 +0100
  • 43d413dbbc [surface] graphics surface sharing API + osx implementation Martin Fouilleul 2023-03-01 16:15:36 +0100
  • 28f5af32fa [graphics] Allocate canvases and fonts from graphics subsystem's arena Martin Fouilleul 2023-03-01 11:37:33 +0100
  • 6bf989564d [graphics] use a single handle arena for all graphics subsystem handles Martin Fouilleul 2023-02-28 20:33:55 +0100
  • 5a19c03ad6 [canvas] removing unused old atlasing api Martin Fouilleul 2023-02-28 18:47:45 +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 Fouilleul 2023-02-28 16:54:39 +0100
  • d4bceba7e9 [canvas] basic image atlas API Martin Fouilleul 2023-02-28 13:16:36 +0100
  • 9cb4aedbc5 [canvas, gl] use pre-multiplied alpha in draw shader and when compositing batches martinfouilleul 2023-02-27 19:50:18 +0100
  • ac6a5db209 [canvas, gl] Checked batching/transparency martinfouilleul 2023-02-27 19:39:26 +0100
  • 5fa07cb462 adding image with transparency (top512.png) in resources to test transparency/overlaying Martin Fouilleul 2023-02-27 19:34:54 +0100
  • 8f834fa1a5 [wip, canvas, gl] implementing basic image API martinfouilleul 2023-02-27 19:25:41 +0100
  • 5e5f8ac5e7 adding image test/example Martin Fouilleul 2023-02-27 15:43:41 +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 Fouilleul 2023-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 Fouilleul 2023-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 finalized Martin Fouilleul 2023-02-27 11:56:04 +0100
  • e66932e624 [canvas] Set command attributes to canvas->attributes by default in mg_push_command() Martin Fouilleul 2023-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.h Martin Fouilleul 2023-02-25 15:23:15 +0100
  • 074b17b743 [canvas] Set transform matrix as part of primitive and don't replay push/pop during render Martin Fouilleul 2023-02-25 14:20:07 +0100
  • b24de5d969 [canvas] Allow setting image source region Martin Fouilleul 2023-02-25 12:59:49 +0100
  • 50569a1427 Allow setting texture on arbitrary path fills Martin Fouilleul 2023-02-24 23:06:39 +0100
  • 4333ed02b0 [canvas] remove image draw commands, replace with rect/rounded rects + image source Martin Fouilleul 2023-02-24 22:59:33 +0100
  • 1b62ec568c [canvas, mtl backend] Handle image rotation Martin Fouilleul 2023-02-24 20:39:41 +0100
  • bb106b717f Build user-space bounding box of shape in mg_push_vertex() _before_ transforming vertices Martin Fouilleul 2023-02-24 19:20:05 +0100
  • 11c25bf001 Make transform implicit in mg_push_vertex() Martin Fouilleul 2023-02-24 19:11:03 +0100
  • 5be019d166 [canvas, metal] compute uv coords in shader using uvTransformed computed in canvas backend, using shape bounding box, image dimension, source and dest regions Martin Fouilleul 2023-02-24 18:50:46 +0100
  • fd4c4e7be3 [canvas] simple image API Martin Fouilleul 2023-02-24 12:01:00 +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 API Martin Fouilleul 2023-02-23 18:30:47 +0100
  • 2b60db292a [wip] image api Martin Fouilleul 2023-02-23 17:07:41 +0100
  • 1250dfd7c1 hardcode GL/GLES versions per-platform for now martinfouilleul 2023-02-22 18:30:10 +0100
  • 4b9b182762 Removed todo. Track todos/dev notes/etc in external obsidian vault for now martinfouilleul 2023-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 DLLs martinfouilleul 2023-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 accordingly martinfouilleul 2023-02-21 18:43:30 +0100
  • dc2961f513 updated todo Martin Fouilleul 2023-02-21 17:22:18 +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 accordingly Martin Fouilleul 2023-02-21 17:09:26 +0100
  • 94373d12ae [surface] extracted common layer functionality from osx surfaces. Use layer in platform-agnostic egl surface. Martin Fouilleul 2023-02-21 13:40:30 +0100
  • 9ea9ea7636 [surface] abstracted child window layer from win32 surfaces martinfouilleul 2023-02-21 12:35:22 +0100
  • 5ac512c15e [wgl] Keep dummy window/context around for gl context creation, and don't reload wgl functions every time martinfouilleul 2023-02-20 20:20:52 +0100
  • 64d7b31e5c destroy gles surfaces resources martinfouilleul 2023-02-20 19:38:24 +0100
  • 2dccfa5547 [win32 surfaces] Backing win32 surfaces with child window and implementing frame/hidding control martinfouilleul 2023-02-20 18:34:29 +0100
  • 4306d0a01c back osx surfaces by CALayer Martin Fouilleul 2023-02-20 16:49:44 +0100
  • 2232b647ed reintroduced GLES backend to osx Martin Fouilleul 2023-02-20 11:05:01 +0100
  • 9eaa125129 add GLES headers to ext martinfouilleul 2023-02-17 18:57:01 +0100
  • 333d3e9f9c [gles, wip] reintroducing egl surface (for win32 at first) martinfouilleul 2023-02-17 18:56:16 +0100
  • 20e425494f Use 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. martinfouilleul 2023-02-16 19:34:22 +0100
  • 54df26232c [wip, opengl] include gl headers in generated glapi files Martin Fouilleul 2023-02-16 15:16:51 +0100
  • a32e2165c7 [wip, opengl] parsing opengl xml spec to auto-generate gl/gles loader Martin Fouilleul 2023-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 scheme martinfouilleul 2023-02-10 16:56:10 +0100
  • f54f639db5 properly destroying windows and fonts martinfouilleul 2023-02-10 12:05:52 +0100
  • 08d3521b61 [canvas/surface cleanup] - properly destroy gl canvas backend - properly destroy gl surface martinfouilleul 2023-02-09 18:40:42 +0100
  • af7cbae1fa [canvas cleanup] cleanup canvas resources on creation failure martinfouilleul 2023-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 shape martinfouilleul 2023-02-09 17:02:58 +0100
  • 09a18419e4 [canvas] make shapeIndex implicit in calls to mg_push_vertex martinfouilleul 2023-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 everywhere martinfouilleul 2023-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) martinfouilleul 2023-02-09 13:09:41 +0100