diff options
author | Stephan Unverwerth <s.unverwerth@serenityos.org> | 2021-05-30 00:15:51 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-05-30 00:32:37 +0100 |
commit | 755393e684268b8ee1c1f72b6a705e99827836b5 (patch) | |
tree | 6e2f552d4908db497931ef855ffc31a0f5fffe7a /Userland/Libraries/LibGL/SoftwareRasterizer.cpp | |
parent | fde0045ebe7ac5aa1698870002ae58edac3c4f85 (diff) | |
download | serenity-755393e684268b8ee1c1f72b6a705e99827836b5.zip |
LibGL: Implement glBindTexture()
Textures are now initialized with a nullptr upon generation.
They are only actually created once they are bound to a target.
Currently only the GL_TEXTURE_2D target is supported.
The software rasterizer now allows rendering with or without
a bound TEXTURE_2D.
Diffstat (limited to 'Userland/Libraries/LibGL/SoftwareRasterizer.cpp')
-rw-r--r-- | Userland/Libraries/LibGL/SoftwareRasterizer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGL/SoftwareRasterizer.cpp b/Userland/Libraries/LibGL/SoftwareRasterizer.cpp index 3f13938288..d9b57f4da4 100644 --- a/Userland/Libraries/LibGL/SoftwareRasterizer.cpp +++ b/Userland/Libraries/LibGL/SoftwareRasterizer.cpp @@ -414,6 +414,13 @@ SoftwareRasterizer::SoftwareRasterizer(const Gfx::IntSize& min_size) { } +void SoftwareRasterizer::submit_triangle(const GLTriangle& triangle) +{ + rasterize_triangle(m_options, *m_render_target, *m_depth_buffer, triangle, [](const FloatVector2&, const FloatVector4& color) -> FloatVector4 { + return color; + }); +} + void SoftwareRasterizer::submit_triangle(const GLTriangle& triangle, const Texture2D& texture) { rasterize_triangle(m_options, *m_render_target, *m_depth_buffer, triangle, [&texture](const FloatVector2& uv, const FloatVector4& color) -> FloatVector4 { |