From: a1batross Date: Sun, 23 Aug 2015 18:48:42 +0000 (+0600) Subject: Add missing funcs for Xash3D. It may never be used, but Xash successfully enables... X-Git-Url: http://deadsoftware.ru/gitweb?p=nanogl.git;a=commitdiff_plain;h=543642550271268e647d7ce403c3e296e6aa9705 Add missing funcs for Xash3D. It may never be used, but Xash successfully enables base OpenGL 1.1 --- diff --git a/GL/gl.h b/GL/gl.h index 5bdc472..edfc67b 100644 --- a/GL/gl.h +++ b/GL/gl.h @@ -573,10 +573,10 @@ typedef int GLclampx; // Vladimir #define glVertex2i(x,y) glVertex3f(x,y,0.0) -#define glTexCoord2d glTexCoord2f +//#define glTexCoord2d glTexCoord2f #define glVertex3d glVertex3f //#define glColor4ub(x,y,z,p) glColor4f(x,y,z,p) //nicknekit: wtf??? -#define glFogi glFogf +//#define glFogi glFogf // void glBegin(GLenum mode); @@ -673,7 +673,28 @@ void glFrontFace (GLenum mode); //nicknekit: for xash3d - +void glGetDoublev( GLenum pname, GLdouble *params); +void glIndexPointer( GLenum type, GLsizei stride, const GLvoid *pointer ); +void glTexCoord1f( GLfloat s ); +void glTexCoord3f( GLfloat s, GLfloat t, GLfloat r ); +void glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q); +void glTexGenf( GLenum coord, GLenum pname, GLfloat param ); +void glRasterPos2f( GLfloat x, GLfloat y ); +void glPushAttrib( GLbitfield mask ); +void glPopAttrib( ); +void glLoadMatrixd( GLdouble *m ); +void glMultMatrixd( GLdouble *m ); +void glRotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z ); +void glScaled( GLdouble x, GLdouble y, GLdouble z); +void glTranslated( GLdouble x, GLdouble y, GLdouble z ); +void glDrawPixels( GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ); +GLboolean glIsList( GLuint list ); +void glPixelStoref( GLenum pname, GLfloat param ) ; +void glCopyTexImage1D( GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border ); +void glCopyTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width ); +void glPolygonStipple( const GLubyte *mask ); +void glGetClipPlane( GLenum plane, const GLdouble *equation ); +void glFogi( GLenum pname, GLint param ); void glColor3ub( GLubyte red, GLubyte green, GLubyte blue); void glNormal3fv( const GLfloat *v ); void glCopyTexImage2D( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ); @@ -690,6 +711,19 @@ GLboolean glIsTexture(GLuint texture); void glTexGeni( GLenum coord, GLenum pname, GLint param ); void glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); void glColor4ub( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +void glTexEnvi( GLenum target, GLenum pname, GLint param ); +void glTexEnvfv( GLenum target, GLenum pname, GLfloat *params ); +void glCopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ); +void glGetTexEnviv( GLenum target, GLenum pname, GLint *params ); +void glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz ); +void glGetBooleanv( GLenum pname, GLboolean *params ); +void glNormalPointer( GLenum type, GLsizei stride, const GLvoid *pointer ); +void glIsEnabled( GLenum cap ); + + +#ifdef __MULTITEXTURE_SUPPORT__ +void glMultiTexCoord2fARB( GLenum target, GLfloat s, GLfloat t ); +#endif #ifdef __cplusplus diff --git a/nanoWrap.cpp b/nanoWrap.cpp index a30a009..b50f348 100644 --- a/nanoWrap.cpp +++ b/nanoWrap.cpp @@ -1176,6 +1176,91 @@ void glColor3fv( const GLfloat *v ) //-- nicknekit: xash3d funcs -- +void glGetDoublev( GLenum pname, GLdouble *params) + { + glGetFloatv( pname, (GLfloat *)params ); + } + +void glIndexPointer( GLenum type, GLsizei stride, const GLvoid *pointer ) { } +void glTexCoord1f( GLfloat s ) +{ + glTexCoord2f( s, 0 ); +} + +void glTexCoord3f( GLfloat s, GLfloat t, GLfloat r ) +{ + glTexCoord2f( s, t ); +} + +void glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q) +{ + glTexCoord2f( s, t ); +} + +void glTexGenf( GLenum coord, GLenum pname, GLfloat param ) +{ + +} + +void glRasterPos2f( GLfloat x, GLfloat y ) { } + +void glPushAttrib( GLbitfield mask ) { } + +void glPopAttrib( ) { } + +void glLoadMatrixd( GLdouble *m ) +{ + glLoadMatrixf( (GLfloat *)m); +} + +void glMultMatrixd( GLdouble *m ) +{ + glMultMatrixf( (GLfloat *)m ); +} + +void glRotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z ) +{ + glRotatef( angle, x, y, z ); +} + +void glScaled( GLdouble x, GLdouble y, GLdouble z) +{ + glScalef( x, y, z ); +} + +void glTranslated( GLdouble x, GLdouble y, GLdouble z ) +{ + glTranslatef( x, y, z); +} + +void glDrawPixels( GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) { } + +GLboolean glIsList( GLuint list ) { } + +void glPixelStoref( GLenum pname, GLfloat param ) +{ + glPixelStorei( pname, param ); +} + +void glCopyTexImage1D( GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border ) +{ + glCopyTexImage2D( target, level, internalFormat, x, y, width, 0, border ); +} + +void glCopyTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width ) +{ + glCopyTexSubImage2D( target, level, xoffset, 0, x, y, width, 0 ); +} + +void glPolygonStipple( const GLubyte *mask ) { } + +void glGetClipPlane( GLenum plane, const GLdouble *equation ) { } + +void glFogi( GLenum pname, GLint param ) +{ + glFogf( pname, param ); +} + void glColor4ub( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) { currentVertexAttrib.red = red; @@ -1248,6 +1333,56 @@ void glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) //for mirrors? not needed for original hl? } +void glTexEnvi( GLenum target, GLenum pname, GLint param ) +{ + FlushOnStateChange(); + glEsImpl->glTexEnvi( target, pname, param ); +} + +void glTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) +{ + for( ; params; params++ ) + { + glTexEnvf( target, pname, *params ); + } +} + +void glCopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) +{ + FlushOnStateChange(); + glEsImpl->glCopyTexSubImage2D( target, level, xoffset, yoffset, x, y, width, height ); +} + +void glGetTexEnviv( GLenum target, GLenum pname, GLint *params ) +{ + FlushOnStateChange(); + glEsImpl->glGetTexEnviv( target, pname, params ); +} + +void glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz ) +{ + FlushOnStateChange(); + glEsImpl->glNormal3f( nx, ny, nz ); +} + +void glGetBooleanv( GLenum pname, GLboolean *params ) +{ + FlushOnStateChange(); + glEsImpl->glGetBooleanv( pname, params ); +} + +void glNormalPointer( GLenum type, GLsizei stride, const GLvoid *pointer ) +{ + FlushOnStateChange(); + glEsImpl->glNormalPointer( type, stride, pointer ); +} + +void glIsEnabled( GLenum cap ) +{ + FlushOnStateChange(); + glEsImpl->glIsEnabled( cap ); +} + //-- --// void glHint (GLenum target, GLenum mode) @@ -1727,7 +1862,7 @@ void glColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *p tmuState0.color_array.type == type && tmuState0.color_array.ptr == pointer) { - return; + return; } tmuState0.color_array.size = size; tmuState0.color_array.stride = stride; @@ -1748,7 +1883,7 @@ void glClearStencil( GLint s ) {} extern "C" void glMultiTexCoord2fARB( GLenum target, GLfloat s, GLfloat t ); void glMultiTexCoord2fARB( GLenum target, GLfloat s, GLfloat t ) - { +{ if (target == GL_TEXTURE0) { glTexCoord2f(s,t);