mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
LibWeb/WebGL2: Implement createSampler
This commit is contained in:
parent
71521a7004
commit
8a9d1de1cf
Notes:
github-actions[bot]
2024-12-14 08:10:32 +00:00
Author: https://github.com/Lubrsi Commit: https://github.com/LadybirdBrowser/ladybird/commit/8a9d1de1cfd Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2905
4 changed files with 14 additions and 1 deletions
|
@ -842,6 +842,7 @@ class WebGLObject;
|
|||
class WebGLProgram;
|
||||
class WebGLRenderbuffer;
|
||||
class WebGLRenderingContext;
|
||||
class WebGLSampler;
|
||||
class WebGLShader;
|
||||
class WebGLShaderPrecisionFormat;
|
||||
class WebGLTexture;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#import <WebGL/WebGLRenderingContextBase.idl>
|
||||
#import <WebGL/WebGLRenderingContextOverloads.idl>
|
||||
#import <WebGL/WebGLQuery.idl>
|
||||
#import <WebGL/WebGLSampler.idl>
|
||||
#import <WebGL/WebGLSync.idl>
|
||||
#import <WebGL/WebGLTransformFeedback.idl>
|
||||
#import <WebGL/WebGLTexture.idl>
|
||||
|
@ -386,7 +387,7 @@ interface mixin WebGL2RenderingContextBase {
|
|||
[FIXME] any getQueryParameter(WebGLQuery query, GLenum pname);
|
||||
|
||||
// Sampler Objects
|
||||
[FIXME] WebGLSampler createSampler();
|
||||
WebGLSampler createSampler();
|
||||
[FIXME] undefined deleteSampler(WebGLSampler? sampler);
|
||||
[FIXME] GLboolean isSampler(WebGLSampler? sampler); // [WebGLHandlesContextLoss]
|
||||
[FIXME] undefined bindSampler(GLuint unit, WebGLSampler? sampler);
|
||||
|
|
|
@ -113,6 +113,7 @@ static bool is_platform_object(Type const& type)
|
|||
"WebGLProgram"sv,
|
||||
"WebGLRenderbuffer"sv,
|
||||
"WebGLRenderingContext"sv,
|
||||
"WebGLSampler"sv,
|
||||
"WebGLShader"sv,
|
||||
"WebGLShaderPrecisionFormat"sv,
|
||||
"WebGLTexture"sv,
|
||||
|
|
|
@ -354,6 +354,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
#include <LibWeb/WebGL/WebGLProgram.h>
|
||||
#include <LibWeb/WebGL/WebGLRenderbuffer.h>
|
||||
#include <LibWeb/WebGL/@class_name@.h>
|
||||
#include <LibWeb/WebGL/WebGLSampler.h>
|
||||
#include <LibWeb/WebGL/WebGLShader.h>
|
||||
#include <LibWeb/WebGL/WebGLShaderPrecisionFormat.h>
|
||||
#include <LibWeb/WebGL/WebGLTexture.h>
|
||||
|
@ -508,6 +509,15 @@ public:
|
|||
continue;
|
||||
}
|
||||
|
||||
if (function.name == "createSampler"sv) {
|
||||
function_impl_generator.append(R"~~~(
|
||||
GLuint handle = 0;
|
||||
glGenSamplers(1, &handle);
|
||||
return WebGLSampler::create(m_realm, handle);
|
||||
)~~~");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (function.name == "shaderSource"sv) {
|
||||
function_impl_generator.append(R"~~~(
|
||||
Vector<GLchar*> strings;
|
||||
|
|
Loading…
Add table
Reference in a new issue