2023-01-20 13:38:21 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2018-2023 Intel Corporation
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2023-03-19 03:11:40 +01:00
|
|
|
#pragma once
|
2023-01-20 13:38:21 +01:00
|
|
|
#include "shared/source/os_interface/os_library.h"
|
|
|
|
|
|
|
|
|
|
#include "GL/gl.h"
|
2023-01-20 13:38:21 +01:00
|
|
|
#include "gl_types.h"
|
2023-01-20 13:38:21 +01:00
|
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
class GlFunctionHelper {
|
|
|
|
|
public:
|
2023-01-20 13:38:21 +01:00
|
|
|
GlFunctionHelper(OsLibrary *glLibrary, const std::string &functionName) {
|
2023-01-20 13:38:21 +01:00
|
|
|
glFunctionPtr = (*glLibrary)[functionName];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ConvertibleProcAddr operator[](const char *name) {
|
2023-01-20 13:38:21 +01:00
|
|
|
return ConvertibleProcAddr{reinterpret_cast<void *>(glFunctionPtr(name))};
|
2023-01-20 13:38:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected:
|
2023-01-20 13:38:21 +01:00
|
|
|
GLFunctionType glFunctionPtr = nullptr;
|
2023-01-20 13:38:21 +01:00
|
|
|
};
|
|
|
|
|
}; // namespace NEO
|