mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Implement WebGL getVertexAttribOffset
This commit is contained in:
parent
1bc7e9d3f8
commit
50d66ba74c
Notes:
github-actions[bot]
2025-11-01 23:55:07 +00:00
Author: https://github.com/cqundefine
Commit: 50d66ba74c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6663
Reviewed-by: https://github.com/gmta ✅
5 changed files with 27 additions and 1 deletions
|
|
@ -3193,6 +3193,18 @@ JS::Value WebGL2RenderingContextImpl::get_vertex_attrib(WebIDL::UnsignedLong ind
|
|||
}
|
||||
}
|
||||
|
||||
WebIDL::LongLong WebGL2RenderingContextImpl::get_vertex_attrib_offset(WebIDL::UnsignedLong index, WebIDL::UnsignedLong pname)
|
||||
{
|
||||
if (pname != GL_VERTEX_ATTRIB_ARRAY_POINTER) {
|
||||
set_error(GL_INVALID_ENUM);
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLintptr result { 0 };
|
||||
glGetVertexAttribPointervRobustANGLE(index, GL_VERTEX_ATTRIB_ARRAY_POINTER, 1, nullptr, reinterpret_cast<void**>(&result));
|
||||
return result;
|
||||
}
|
||||
|
||||
void WebGL2RenderingContextImpl::hint(WebIDL::UnsignedLong target, WebIDL::UnsignedLong mode)
|
||||
{
|
||||
m_context->make_current();
|
||||
|
|
|
|||
|
|
@ -200,6 +200,7 @@ public:
|
|||
JS::Value get_uniform(GC::Root<WebGLProgram> program, GC::Root<WebGLUniformLocation> location);
|
||||
GC::Root<WebGLUniformLocation> get_uniform_location(GC::Root<WebGLProgram> program, String name);
|
||||
JS::Value get_vertex_attrib(WebIDL::UnsignedLong index, WebIDL::UnsignedLong pname);
|
||||
WebIDL::LongLong get_vertex_attrib_offset(WebIDL::UnsignedLong index, WebIDL::UnsignedLong pname);
|
||||
void hint(WebIDL::UnsignedLong target, WebIDL::UnsignedLong mode);
|
||||
bool is_buffer(GC::Root<WebGLBuffer> buffer);
|
||||
bool is_enabled(WebIDL::UnsignedLong cap);
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ interface mixin WebGLRenderingContextBase {
|
|||
|
||||
any getVertexAttrib(GLuint index, GLenum pname);
|
||||
|
||||
[FIXME] GLintptr getVertexAttribOffset(GLuint index, GLenum pname);
|
||||
GLintptr getVertexAttribOffset(GLuint index, GLenum pname);
|
||||
|
||||
undefined hint(GLenum target, GLenum mode);
|
||||
GLboolean isBuffer(WebGLBuffer? buffer);
|
||||
|
|
|
|||
|
|
@ -1757,6 +1757,18 @@ JS::Value WebGLRenderingContextImpl::get_vertex_attrib(WebIDL::UnsignedLong inde
|
|||
}
|
||||
}
|
||||
|
||||
WebIDL::LongLong WebGLRenderingContextImpl::get_vertex_attrib_offset(WebIDL::UnsignedLong index, WebIDL::UnsignedLong pname)
|
||||
{
|
||||
if (pname != GL_VERTEX_ATTRIB_ARRAY_POINTER) {
|
||||
set_error(GL_INVALID_ENUM);
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLintptr result { 0 };
|
||||
glGetVertexAttribPointervRobustANGLE(index, GL_VERTEX_ATTRIB_ARRAY_POINTER, 1, nullptr, reinterpret_cast<void**>(&result));
|
||||
return result;
|
||||
}
|
||||
|
||||
void WebGLRenderingContextImpl::hint(WebIDL::UnsignedLong target, WebIDL::UnsignedLong mode)
|
||||
{
|
||||
m_context->make_current();
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ public:
|
|||
JS::Value get_uniform(GC::Root<WebGLProgram> program, GC::Root<WebGLUniformLocation> location);
|
||||
GC::Root<WebGLUniformLocation> get_uniform_location(GC::Root<WebGLProgram> program, String name);
|
||||
JS::Value get_vertex_attrib(WebIDL::UnsignedLong index, WebIDL::UnsignedLong pname);
|
||||
WebIDL::LongLong get_vertex_attrib_offset(WebIDL::UnsignedLong index, WebIDL::UnsignedLong pname);
|
||||
void hint(WebIDL::UnsignedLong target, WebIDL::UnsignedLong mode);
|
||||
bool is_buffer(GC::Root<WebGLBuffer> buffer);
|
||||
bool is_enabled(WebIDL::UnsignedLong cap);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue