summaryrefslogtreecommitdiff
path: root/tests/test_api.cpp
blob: acfbbb80b0dc8786411a198dc6153833d6736b3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <yasl/yasl.h>
#include <yasl/cpu.h>
#include <yasl/gl.h>
#include <yasl/metal.h>
#include <yasl/desktop.h>
#if YASL_HAS_VULKAN
#include <yasl/vulkan.h>
#endif
#if YASL_HAS_WAYLAND
#include <yasl/native/wayland.h>
#endif
#if YASL_HAS_X11
#include <yasl/native/x11.h>
#endif
#if YASL_HAS_COCOA
#include <yasl/native/cocoa.h>
#endif
#include <cassert>
int main()
{
    yasl_event e{};
    e.pen.x = 1.5;
    e.pen.pressure = 0.25;
    assert(e.pen.pressure == 0.25);
    yasl_surface_options options{};
    options.width = -1;
    options.height = 10;
    assert(!yasl_surface_create(&options) && errno == EINVAL);
    yasl_gl_options gl = YASL_GL_OPTIONS_INIT;
    assert(gl.major == 3 && gl.minor == 2 && gl.share == nullptr);
    yasl_cpu_buffer buffer{};
    assert(yasl_cpu_acquire(nullptr, &buffer) == -ENODEV);
    yasl_shutdown();
    return 0;
}