From cba1972deba6ba7b40c44e361cb857829e822a2d Mon Sep 17 00:00:00 2001 From: Luke Wilde Date: Wed, 12 Jan 2022 07:48:39 +0000 Subject: [PATCH] LibGL: Implement glTexCoord{1,3,4}f(v) Not necessarily required by Half-Life's use of Xash3D, but it looks them up anyway and they're easy to implement, so here they are :^). --- Userland/Libraries/LibGL/GL/gl.h | 5 +++++ Userland/Libraries/LibGL/GLVert.cpp | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/Userland/Libraries/LibGL/GL/gl.h b/Userland/Libraries/LibGL/GL/gl.h index db3d562bd4..4caf04fa7c 100644 --- a/Userland/Libraries/LibGL/GL/gl.h +++ b/Userland/Libraries/LibGL/GL/gl.h @@ -536,11 +536,16 @@ GLAPI void glTexImage1D(GLenum target, GLint level, GLint internalFormat, GLsize GLAPI void glTexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLvoid const* data); GLAPI void glTexImage3D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLvoid const* data); GLAPI void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* data); +GLAPI void glTexCoord1f(GLfloat s); +GLAPI void glTexCoord1fv(GLfloat const* v); GLAPI void glTexCoord2d(GLdouble s, GLdouble t); GLAPI void glTexCoord2dv(GLdouble const* v); GLAPI void glTexCoord2f(GLfloat s, GLfloat t); GLAPI void glTexCoord2fv(GLfloat const* v); GLAPI void glTexCoord2i(GLint s, GLint t); +GLAPI void glTexCoord3f(GLfloat s, GLfloat t, GLfloat r); +GLAPI void glTexCoord3fv(GLfloat const* v); +GLAPI void glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q); GLAPI void glTexCoord4fv(const GLfloat* v); GLAPI void glTexParameteri(GLenum target, GLenum pname, GLint param); GLAPI void glTexParameterf(GLenum target, GLenum pname, GLfloat param); diff --git a/Userland/Libraries/LibGL/GLVert.cpp b/Userland/Libraries/LibGL/GLVert.cpp index 0408851282..15fde5d54f 100644 --- a/Userland/Libraries/LibGL/GLVert.cpp +++ b/Userland/Libraries/LibGL/GLVert.cpp @@ -140,6 +140,16 @@ void glVertex4sv(const GLshort* v) g_gl_context->gl_vertex(v[0], v[1], v[2], v[3]); } +void glTexCoord1f(GLfloat s) +{ + g_gl_context->gl_tex_coord(s, 0.0f, 0.0f, 1.0f); +} + +void glTexCoord1fv(GLfloat const* v) +{ + g_gl_context->gl_tex_coord(v[0], 0.0f, 0.0f, 1.0f); +} + void glTexCoord2d(GLdouble s, GLdouble t) { g_gl_context->gl_tex_coord(s, t, 0.0f, 1.0f); @@ -165,6 +175,21 @@ void glTexCoord2i(GLint s, GLint t) g_gl_context->gl_tex_coord(s, t, 0.0f, 1.0f); } +void glTexCoord3f(GLfloat s, GLfloat t, GLfloat r) +{ + g_gl_context->gl_tex_coord(s, t, r, 1.0f); +} + +void glTexCoord3fv(GLfloat const* v) +{ + g_gl_context->gl_tex_coord(v[0], v[1], v[2], 1.0f); +} + +void glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q) +{ + g_gl_context->gl_tex_coord(s, t, r, q); +} + void glTexCoord4fv(const GLfloat* v) { g_gl_context->gl_tex_coord(v[0], v[1], v[2], v[3]);