From 193b53344a20d11d64b78775aaa2f69cc707967b Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Sat, 24 Apr 2021 17:51:13 +0430 Subject: [PATCH] LibGL: Implement glVertex2f(v) --- Userland/Libraries/LibGL/GL/gl.h | 2 ++ Userland/Libraries/LibGL/GLVert.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/Userland/Libraries/LibGL/GL/gl.h b/Userland/Libraries/LibGL/GL/gl.h index dd3fa6a588..2b392d73ac 100644 --- a/Userland/Libraries/LibGL/GL/gl.h +++ b/Userland/Libraries/LibGL/GL/gl.h @@ -87,6 +87,8 @@ GLAPI void glPopMatrix(); GLAPI void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); GLAPI void glScalef(GLfloat x, GLfloat y, GLfloat z); GLAPI void glTranslatef(GLfloat x, GLfloat y, GLfloat z); +GLAPI void glVertex2f(GLfloat x, GLfloat y); +GLAPI void glVertex2fv(const GLfloat* v); GLAPI void glVertex3f(GLfloat x, GLfloat y, GLfloat z); GLAPI void glVertex3fv(const GLfloat* v); GLAPI void glViewport(GLint x, GLint y, GLsizei width, GLsizei height); diff --git a/Userland/Libraries/LibGL/GLVert.cpp b/Userland/Libraries/LibGL/GLVert.cpp index 6119f53a6b..281207c0ee 100644 --- a/Userland/Libraries/LibGL/GLVert.cpp +++ b/Userland/Libraries/LibGL/GLVert.cpp @@ -20,6 +20,16 @@ void glEnd() g_gl_context->gl_end(); } +void glVertex2f(GLfloat x, GLfloat y) +{ + g_gl_context->gl_vertex(x, y, 0.0, 1.0); +} + +void glVertex2fv(const GLfloat* v) +{ + g_gl_context->gl_vertex(v[0], v[1], 0.0, 1.0); +} + void glVertex3f(GLfloat x, GLfloat y, GLfloat z) { g_gl_context->gl_vertex(x, y, z, 1.0);