Bladeren bron

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 :^).
Luke Wilde 3 jaren geleden
bovenliggende
commit
cba1972deb
2 gewijzigde bestanden met toevoegingen van 30 en 0 verwijderingen
  1. 5 0
      Userland/Libraries/LibGL/GL/gl.h
  2. 25 0
      Userland/Libraries/LibGL/GLVert.cpp

+ 5 - 0
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);

+ 25 - 0
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]);