mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 04:52:06 +02:00
LibWeb/WebGL: Implement texImage2D()
This commit is contained in:
committed by
Alexander Kalenik
parent
3c2ac309ca
commit
64fec8b2de
Notes:
github-actions[bot]
2024-12-03 22:36:45 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/64fec8b2de3 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2688 Reviewed-by: https://github.com/ADKaster ✅
@@ -263,6 +263,19 @@ public:
|
||||
continue;
|
||||
}
|
||||
|
||||
if (function.name == "texImage2D"sv && function.overload_index == 0) {
|
||||
function_impl_generator.append(R"~~~(
|
||||
void const* pixels_ptr = nullptr;
|
||||
if (pixels) {
|
||||
auto const& viewed_array_buffer = pixels->viewed_array_buffer();
|
||||
auto const& byte_buffer = viewed_array_buffer->buffer();
|
||||
pixels_ptr = byte_buffer.data();
|
||||
}
|
||||
glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels_ptr);
|
||||
)~~~");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (function.name == "getShaderParameter"sv) {
|
||||
function_impl_generator.append(R"~~~(
|
||||
GLint result = 0;
|
||||
|
||||
Reference in New Issue
Block a user