blob: 1848b3f75e07b214ff98ff5c28b8dcc220b5bc29 [file] [log] [blame]
Kristian Høgsberg08d8c682013-06-17 08:48:57 -04001/*
2 * Copyright © 2011 Intel Corporation
3 *
Bryce Harringtona0bbfea2015-06-11 15:35:43 -07004 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sublicense, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject to
10 * the following conditions:
Kristian Høgsberg08d8c682013-06-17 08:48:57 -040011 *
Bryce Harringtona0bbfea2015-06-11 15:35:43 -070012 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial
14 * portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
Kristian Høgsberg08d8c682013-06-17 08:48:57 -040024 */
25
Daniel Stone8e7a8bd2013-08-15 01:10:24 +010026#include "config.h"
27
Kristian Høgsberg08d8c682013-06-17 08:48:57 -040028#include "compositor.h"
29
30WL_EXPORT void
Jason Ekstranda7af7042013-10-12 22:38:11 -050031weston_view_geometry_dirty(struct weston_view *view)
Kristian Høgsberg08d8c682013-06-17 08:48:57 -040032{
33}
34
35WL_EXPORT int
36weston_log(const char *fmt, ...)
37{
38 return 0;
39}
40
41WL_EXPORT void
Jason Ekstranda7af7042013-10-12 22:38:11 -050042weston_view_schedule_repaint(struct weston_view *view)
Kristian Høgsberg08d8c682013-06-17 08:48:57 -040043{
44}
45
Jonny Lambf8bfd052014-05-22 22:41:33 +020046WL_EXPORT void
47weston_compositor_schedule_repaint(struct weston_compositor *compositor)
48{
49}
50
Kristian Høgsberg08d8c682013-06-17 08:48:57 -040051int
52main(int argc, char *argv[])
53{
54 const double k = 300.0;
Kristian Høgsberg1cfd4062013-06-17 11:08:11 -040055 const double current = 0.5;
Kristian Høgsberg08d8c682013-06-17 08:48:57 -040056 const double target = 1.0;
57 const double friction = 1400;
58
59 struct weston_spring spring;
60 uint32_t time = 0;
61
62 weston_spring_init(&spring, k, current, target);
63 spring.friction = friction;
Kristian Høgsberg1cfd4062013-06-17 11:08:11 -040064 spring.previous = 0.48;
Kristian Høgsberg08d8c682013-06-17 08:48:57 -040065 spring.timestamp = 0;
66
67 while (!weston_spring_done(&spring)) {
68 printf("\t%d\t%f\n", time, spring.current);
69 weston_spring_update(&spring, time);
70 time += 16;
71 }
72
73 return 0;
74}