Example #1
0
static void WINE_GLAPI wine_glMultiTexCoord1fvARB(GLenum target, const GLfloat *v) {
    if(target != GL_TEXTURE0) {
        ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
        return;
    }
    glTexCoord1fv(v);
}
Example #2
0
void GeomRenderer::sendTexCoord(GLuint texCoordIndex)
{
    assert(texCoordData.size >= 1 && texCoordData.size <= 4);

    switch(texCoordData.type)
    {
        case GL_SHORT:
            if (texCoordData.size == 1) glTexCoord1sv((const GLshort*)((const char*)texCoordData.pointer + texCoordIndex*texCoordData.stride));
            if (texCoordData.size == 2) glTexCoord2sv((const GLshort*)((const char*)texCoordData.pointer + texCoordIndex*texCoordData.stride));
            if (texCoordData.size == 3) glTexCoord3sv((const GLshort*)((const char*)texCoordData.pointer + texCoordIndex*texCoordData.stride));
            if (texCoordData.size == 4) glTexCoord4sv((const GLshort*)((const char*)texCoordData.pointer + texCoordIndex*texCoordData.stride));
            break;

        case GL_INT:
            if (texCoordData.size == 1) glTexCoord1iv((const GLint*)((const char*)texCoordData.pointer + texCoordIndex*texCoordData.stride));
            if (texCoordData.size == 2) glTexCoord2iv((const GLint*)((const char*)texCoordData.pointer + texCoordIndex*texCoordData.stride));
            if (texCoordData.size == 3) glTexCoord3iv((const GLint*)((const char*)texCoordData.pointer + texCoordIndex*texCoordData.stride));
            if (texCoordData.size == 4) glTexCoord4iv((const GLint*)((const char*)texCoordData.pointer + texCoordIndex*texCoordData.stride));
            break;

        case GL_FLOAT:
            if (texCoordData.size == 1) glTexCoord1fv((const GLfloat*)((const char*)texCoordData.pointer + texCoordIndex*texCoordData.stride));
            if (texCoordData.size == 2) glTexCoord2fv((const GLfloat*)((const char*)texCoordData.pointer + texCoordIndex*texCoordData.stride));
            if (texCoordData.size == 3) glTexCoord3fv((const GLfloat*)((const char*)texCoordData.pointer + texCoordIndex*texCoordData.stride));
            if (texCoordData.size == 4) glTexCoord4fv((const GLfloat*)((const char*)texCoordData.pointer + texCoordIndex*texCoordData.stride));
            break;

        case GL_DOUBLE:
            if (texCoordData.size == 1) glTexCoord1dv((const GLdouble*)((const char*)texCoordData.pointer + texCoordIndex*texCoordData.stride));
            if (texCoordData.size == 2) glTexCoord2dv((const GLdouble*)((const char*)texCoordData.pointer + texCoordIndex*texCoordData.stride));
            if (texCoordData.size == 3) glTexCoord3dv((const GLdouble*)((const char*)texCoordData.pointer + texCoordIndex*texCoordData.stride));
            if (texCoordData.size == 4) glTexCoord4dv((const GLdouble*)((const char*)texCoordData.pointer + texCoordIndex*texCoordData.stride));
            break;
    }
}
Example #3
0
/////////////////////////////////////////////////////////
// Render
//
void GEMglTexCoord1fv :: render(GemState *state) {
	glTexCoord1fv (v);
}
Example #4
0
File: api_eval.c Project: aosm/X11
static void do_EvalCoord1f(GLcontext* ctx, GLfloat u)
{

   /** Color Index **/
   if (ctx->Eval.Map1Index) 
   {
      GLfloat findex;
      struct gl_1d_map *map = &ctx->EvalMap.Map1Index;
      GLfloat uu = (u - map->u1) * map->du;
      _math_horner_bezier_curve(map->Points, &findex, uu, 1, map->Order);
      glIndexi( (GLint) findex );
   }

   /** Color **/
   if (ctx->Eval.Map1Color4) {
      GLfloat fcolor[4];
      struct gl_1d_map *map = &ctx->EvalMap.Map1Color4;
      GLfloat uu = (u - map->u1) * map->du;
      _math_horner_bezier_curve(map->Points, fcolor, uu, 4, map->Order);
      glColor4fv( fcolor );
   }

   /** Normal Vector **/
   if (ctx->Eval.Map1Normal) {
      GLfloat normal[3];
      struct gl_1d_map *map = &ctx->EvalMap.Map1Normal;
      GLfloat uu = (u - map->u1) * map->du;
      _math_horner_bezier_curve(map->Points, normal, uu, 3, map->Order);
      glNormal3fv( normal );
   }

   /** Texture Coordinates **/
   if (ctx->Eval.Map1TextureCoord4) {
      GLfloat texcoord[4];
      struct gl_1d_map *map = &ctx->EvalMap.Map1Texture4;
      GLfloat uu = (u - map->u1) * map->du;
      _math_horner_bezier_curve(map->Points, texcoord, uu, 4, map->Order);
      glTexCoord4fv( texcoord );
   }
   else if (ctx->Eval.Map1TextureCoord3) {
      GLfloat texcoord[4];
      struct gl_1d_map *map = &ctx->EvalMap.Map1Texture3;
      GLfloat uu = (u - map->u1) * map->du;
      _math_horner_bezier_curve(map->Points, texcoord, uu, 3, map->Order);
      glTexCoord3fv( texcoord );
   }
   else if (ctx->Eval.Map1TextureCoord2) {
      GLfloat texcoord[4];
      struct gl_1d_map *map = &ctx->EvalMap.Map1Texture2;
      GLfloat uu = (u - map->u1) * map->du;
      _math_horner_bezier_curve(map->Points, texcoord, uu, 2, map->Order);
      glTexCoord2fv( texcoord );
   }
   else if (ctx->Eval.Map1TextureCoord1) {
      GLfloat texcoord[4];
      struct gl_1d_map *map = &ctx->EvalMap.Map1Texture1;
      GLfloat uu = (u - map->u1) * map->du;
      _math_horner_bezier_curve(map->Points, texcoord, uu, 1, map->Order);
      glTexCoord1fv( texcoord );
   }
  
   /** Vertex **/
   if (ctx->Eval.Map1Vertex4) 
   {
      GLfloat vertex[4];
      struct gl_1d_map *map = &ctx->EvalMap.Map1Vertex4;
      GLfloat uu = (u - map->u1) * map->du;
      _math_horner_bezier_curve(map->Points, vertex, uu, 4, map->Order);
      glVertex4fv( vertex );
   }
   else if (ctx->Eval.Map1Vertex3) 
   {
      GLfloat vertex[4];
      struct gl_1d_map *map = &ctx->EvalMap.Map1Vertex3;
      GLfloat uu = (u - map->u1) * map->du;
      _math_horner_bezier_curve(map->Points, vertex, uu, 3, map->Order);
      glVertex3fv( vertex );
   }
}
Example #5
0
File: api_eval.c Project: aosm/X11
static void do_EvalCoord2f( GLcontext* ctx, GLfloat u, GLfloat v )
{   
   /** Color Index **/
   if (ctx->Eval.Map2Index) {
      GLfloat findex;
      struct gl_2d_map *map = &ctx->EvalMap.Map2Index;
      GLfloat uu = (u - map->u1) * map->du;
      GLfloat vv = (v - map->v1) * map->dv;
      _math_horner_bezier_surf(map->Points, &findex, uu, vv, 1,
                         map->Uorder, map->Vorder);
      glIndexi( (GLuint) (GLint) findex );
   }

   /** Color **/
   if (ctx->Eval.Map2Color4) {
      GLfloat fcolor[4];
      struct gl_2d_map *map = &ctx->EvalMap.Map2Color4;
      GLfloat uu = (u - map->u1) * map->du;
      GLfloat vv = (v - map->v1) * map->dv;
      _math_horner_bezier_surf(map->Points, fcolor, uu, vv, 4,
                         map->Uorder, map->Vorder);
      glColor4fv( fcolor );
   }

   /** Normal **/
   if (ctx->Eval.Map2Normal &&
       (!ctx->Eval.AutoNormal || (!ctx->Eval.Map2Vertex3 && 
				  !ctx->Eval.Map2Vertex4))) {
      GLfloat normal[3];
      struct gl_2d_map *map = &ctx->EvalMap.Map2Normal;
      GLfloat uu = (u - map->u1) * map->du;
      GLfloat vv = (v - map->v1) * map->dv;
      _math_horner_bezier_surf(map->Points, normal, uu, vv, 3,
			 map->Uorder, map->Vorder);
      glNormal3fv( normal );
   }

   /** Texture Coordinates **/
   if (ctx->Eval.Map2TextureCoord4) {
      GLfloat texcoord[4];
      struct gl_2d_map *map = &ctx->EvalMap.Map2Texture4;
      GLfloat uu = (u - map->u1) * map->du;
      GLfloat vv = (v - map->v1) * map->dv;
      _math_horner_bezier_surf(map->Points, texcoord, uu, vv, 4,
                         map->Uorder, map->Vorder);
      glTexCoord4fv( texcoord );
   }
   else if (ctx->Eval.Map2TextureCoord3) {
      GLfloat texcoord[4];
      struct gl_2d_map *map = &ctx->EvalMap.Map2Texture3;
      GLfloat uu = (u - map->u1) * map->du;
      GLfloat vv = (v - map->v1) * map->dv;
      _math_horner_bezier_surf(map->Points, texcoord, uu, vv, 3,
                         map->Uorder, map->Vorder);
      glTexCoord3fv( texcoord );
   }
   else if (ctx->Eval.Map2TextureCoord2) {
      GLfloat texcoord[4];
      struct gl_2d_map *map = &ctx->EvalMap.Map2Texture2;
      GLfloat uu = (u - map->u1) * map->du;
      GLfloat vv = (v - map->v1) * map->dv;
      _math_horner_bezier_surf(map->Points, texcoord, uu, vv, 2,
                         map->Uorder, map->Vorder);
      glTexCoord2fv( texcoord );
   }
   else if (ctx->Eval.Map2TextureCoord1) {
      GLfloat texcoord[4];
      struct gl_2d_map *map = &ctx->EvalMap.Map2Texture1;
      GLfloat uu = (u - map->u1) * map->du;
      GLfloat vv = (v - map->v1) * map->dv;
      _math_horner_bezier_surf(map->Points, texcoord, uu, vv, 1,
                         map->Uorder, map->Vorder);
      glTexCoord1fv( texcoord );
   }

   /** Vertex **/
   if(ctx->Eval.Map2Vertex4) {
      GLfloat vertex[4];
      GLfloat normal[3];
      struct gl_2d_map *map = &ctx->EvalMap.Map2Vertex4;
      GLfloat uu = (u - map->u1) * map->du;
      GLfloat vv = (v - map->v1) * map->dv;

      if (ctx->Eval.AutoNormal) {
         GLfloat du[4], dv[4];

         _math_de_casteljau_surf(map->Points, vertex, du, dv, uu, vv, 4,
				 map->Uorder, map->Vorder);

         CROSS_PROD(normal, du, dv);
         NORMALIZE_3FV(normal);
	 glNormal3fv( normal );
	 glVertex4fv( vertex );
      }
      else {
         _math_horner_bezier_surf(map->Points, vertex, uu, vv, 4,
                            map->Uorder, map->Vorder);
	 glVertex4fv( vertex );
      }
   }
   else if (ctx->Eval.Map2Vertex3) {
      GLfloat vertex[4];
      struct gl_2d_map *map = &ctx->EvalMap.Map2Vertex3;
      GLfloat uu = (u - map->u1) * map->du;
      GLfloat vv = (v - map->v1) * map->dv;
      if (ctx->Eval.AutoNormal) {
         GLfloat du[3], dv[3];
	 GLfloat normal[3];
         _math_de_casteljau_surf(map->Points, vertex, du, dv, uu, vv, 3,
				 map->Uorder, map->Vorder);
         CROSS_PROD(normal, du, dv);
         NORMALIZE_3FV(normal);
	 glNormal3fv( normal );
	 glVertex3fv( vertex );
      }
      else {
         _math_horner_bezier_surf(map->Points, vertex, uu, vv, 3,
                            map->Uorder, map->Vorder);
	 glVertex3fv( vertex );
      }
   }
}
inline void glTexCoord1v( const GLfloat * v )	{ glTexCoord1fv( v ); }
Example #7
0
M(void, glTexCoord1fv, jobject v) {
	glTexCoord1fv(BUFF(GLfloat, v));
}
Example #8
0
File: g_render.c Project: aosm/X11
void __glXDisp_TexCoord1fv(GLbyte *pc)
{
	glTexCoord1fv( 
		(GLfloat  *)(pc + 0)
	);
}