aboutsummaryrefslogtreecommitdiffstats
path: root/examples/pugl_embed_demo.c
AgeCommit message (Collapse)AuthorFilesLines
2023-01-14Add general string hint interfaceDavid Robillard1-2/+2
This replaces the window title and class name APIs with a more general one that can be easily extended to other things, like icon names, more detailed application hints, and so on.
2023-01-11Raise the initial display of example windowsDavid Robillard1-2/+2
This is the standard behaviour for applications.
2023-01-08Prepare OpenGL context flags for OpenGL ES supportDavid Robillard1-2/+2
2023-01-08Add support for raising windowsDavid Robillard1-2/+2
2023-01-07Add support for special view types and stylesDavid Robillard1-1/+2
2022-10-07Use uppercase integer literal suffixesDavid Robillard1-6/+6
2022-06-08Use consistent terminology for native viewsDavid Robillard1-1/+1
On MacOS in particular, views and windows are entirely different concepts, so confusing them... confuses things. This was the last holdover in the API that used the old "native window".
2022-05-22Factor out pugl_clipboard_demo example programDavid Robillard1-14/+4
This is a simpler example than pugl_embed_demo that demonstrates clipboard functionality without the complexity of embedded views.
2022-05-21Add puglSetPosition() and puglSetSize()David Robillard1-14/+8
These are redundant with puglSetFrame in a sense, but allow setting the size of a view without the position, or vice-versa. This API also maps more nicely to Wayland, where applications can not position themselves (but can resize).
2022-05-21Use consistent integer types for view positions and sizesDavid Robillard1-13/+14
Actual window sizes and positions fit easily in a 16-bit integer. So, we use that in "representation contexts" like events. This makes structures smaller, and allows the values to be converted to float, double, or integer without casting (since any int16_t or uint16_t value can fit in them without loss). Setter APIs use native integers for convenience, to avoid casting hassles when doing arithmetic. Ranges are checked at runtime.
2022-05-21Add a uniform API for setting size hintsDavid Robillard1-4/+5
This collapses many functions into one, which makes the API more easily extensible and reduces code size.
2022-05-20Use consistent class names and titles in tests and examplesDavid Robillard1-1/+1
2021-12-17Adopt REUSE machine-readable licensing standardDavid Robillard1-15/+2
See https://reuse.software/ for details.
2021-05-25Rename event structs in a more readable styleDavid Robillard1-1/+1
Aside from reading more naturally, this avoids clashes with types that are not events, like PuglEventFlags. This is also more consistent with the C++ bindings, where "EventExpose" would be quite strange, for example. Apologies for the noise. Aliases to the old names will be preserved in the deprecated API like other things for a short while.
2021-04-18Improve cube rendering in example programsDavid Robillard1-4/+4
2021-04-18Improve cube rendering in example programsDavid Robillard1-1/+10
2021-01-02Simplify clang-format configuration and format all codeDavid Robillard1-287/+279
2020-11-26Remove file documentationDavid Robillard1-5/+0
These will not be used in the Sphinx documentation, and most were self-explanatory and only there to make the Doxygen index look nice anyway. Where there was actually useful information, it has been preserved as regular comments.
2020-11-25Rename puglShowWindow and puglHideWindow to puglShow an puglHideDavid Robillard1-2/+2
These names were confusing because a view is not necessarily a window. Since there's no room for ambiguity here, simply drop the superfluous word.
2020-10-30Simplify header namesDavid Robillard1-1/+1
2020-10-30Remove GL and GLU wrapper headersDavid Robillard1-1/+0
Include them in pugl_gl.h instead, to simplify things and unclutter the include directory.
2020-07-05Improve struct packingDavid Robillard1-3/+3
Unfortunately there is no warning like Wpadded but only for internal padding, so that can't be turned on, but if there was, after this commit the build would be clean with it. Maybe some day...
2020-06-08Windows: Fix maximum sizeDavid Robillard1-0/+1
2020-05-16Add default and maximum sizeDavid Robillard1-1/+1
2020-05-16Use email address in copyright headersDavid Robillard1-1/+1
Not really sure why I used a web link here (maybe because it's more stable), but this is more conventional.
2020-05-16Fix file documentationDavid Robillard1-1/+2
2020-04-02Strengthen warningsDavid Robillard1-3/+10
2020-04-01Replace puglShowWindow() with puglRealize()David Robillard1-2/+5
2020-03-17Use clearer names for pointer eventsDavid Robillard1-4/+4
These old "notify" names are a smell from X11 which is a bit strange and inconsistent here, since nearly everything is a "notification" of sorts. I think the new names here are much more clear since they are consistent with the keyboard focus events.
2020-03-16Embed Demo: Add timer to occasionally reverse spin directionDavid Robillard1-2/+10
2020-03-15Unify event loop functions as puglUpdate()David Robillard1-9/+12
The previous separation between polling and dispatching was a lie, especially on MacOS where it is impossible to only poll for events without dispatching anything. Providing such an API is misleading, and problematic in various other ways. So, merge them into a single puglUpdate() function which can do the right thing on all platforms. This also adds the behaviour of actually processing all events in the given time interval, which is almost always what clients actually want to do when using a positive timeout (naively doing this before caused terrible input lag).
2020-03-15Add type and flags to worldDavid Robillard1-1/+1
Unfortunately this is an API break, but there's no reasonable way to deprecate the old function and this is required for things to work correctly. The type will be used in following commits to tick the main loop and dispatch events correctly for either case.
2020-03-13Strengthen warningsDavid Robillard1-2/+0
2020-03-08Add vsync command line options to demosDavid Robillard1-2/+2
2020-03-08Embed Demo: Simplify FPS counterDavid Robillard1-3/+3
What we're really interested in here is how often the main loop iteration runs.
2020-03-08Embed Demo: Only redisplay on input when not running continuouslyDavid Robillard1-5/+11
2020-03-08Factor out cube drawingDavid Robillard1-59/+6
2020-03-08Move demo programs to examples directoryDavid Robillard1-0/+394
These are not really tests, but examples or demos, which has caused some confusion in the past. So, move them, and make room for actual tests.