2023-10-27 17:03:17 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2023, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/Assertions.h>
|
|
|
|
|
#include <AK/OwnPtr.h>
|
|
|
|
|
|
2023-11-12 14:18:00 +01:00
|
|
|
#ifndef AK_OS_MACOS
|
2023-11-01 13:41:25 -06:00
|
|
|
// Make sure egl.h doesn't give us definitions from X11 headers
|
2023-11-12 14:18:00 +01:00
|
|
|
# define EGL_NO_X11
|
|
|
|
|
# include <EGL/egl.h>
|
|
|
|
|
# undef EGL_NO_X11
|
|
|
|
|
#endif
|
2023-10-27 17:03:17 +02:00
|
|
|
|
|
|
|
|
namespace AccelGfx {
|
|
|
|
|
|
|
|
|
|
class Context {
|
|
|
|
|
public:
|
2024-01-24 15:27:03 +01:00
|
|
|
static ErrorOr<NonnullOwnPtr<Context>> create();
|
2023-10-27 17:03:17 +02:00
|
|
|
|
2023-11-12 14:18:00 +01:00
|
|
|
Context()
|
2023-10-27 17:03:17 +02:00
|
|
|
{
|
|
|
|
|
}
|
2024-01-18 20:24:29 +01:00
|
|
|
|
|
|
|
|
virtual ~Context()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual void activate() = 0;
|
2023-10-27 17:03:17 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|