示例#1
0
文件: api.c 项目: joshdekock/jim-psp
void glColor4fv(GLfloat *v)
{
  GLParam p[8];

  p[0].op=OP_Color;
  p[1].f=v[0];
  p[2].f=v[1];
  p[3].f=v[2];
  p[4].f=v[3];
  /* direct convertion to integer to go faster if no shading */
  p[5].ui = (unsigned int) (sll2int(
			  	slladd(
			  		sllmul(v[0], int2sll(ZB_POINT_RED_MAX - ZB_POINT_RED_MIN)), 
                            		int2sll(ZB_POINT_RED_MIN)
				      )
				    )
		  	   );
  p[6].ui = (unsigned int) (sll2int(
			  	slladd(
					sllmul(v[1], int2sll(ZB_POINT_GREEN_MAX - ZB_POINT_GREEN_MIN)), 
                            		int2sll(ZB_POINT_GREEN_MIN)
				      )
				   )
		           );
  p[7].ui = (unsigned int) (sll2int(
			  	slladd(
					sllmul(v[2], int2sll(ZB_POINT_BLUE_MAX - ZB_POINT_BLUE_MIN)), 
                            		int2sll(ZB_POINT_BLUE_MIN)
				      )
				    )
		            );
  gl_add_op(p);
}
示例#2
0
文件: api.c 项目: joshdekock/jim-psp
void glColor4f(GLfloat r,GLfloat g,GLfloat b,GLfloat a)
{
  GLParam p[8];

  p[0].op=OP_Color;
  p[1].f=r;
  p[2].f=g;
  p[3].f=b;
  p[4].f=a;
  /* direct convertion to integer to go faster if no shading */
  p[5].ui = (unsigned int) (sll2int(
			  	slladd(
			  		sllmul(r,int2sll(ZB_POINT_RED_MAX - ZB_POINT_RED_MIN)),
                            		int2sll(ZB_POINT_RED_MIN)
				      )
			           )
		 	   );
  p[6].ui = (unsigned int) (sll2int(
			  	slladd(
					sllmul(g, int2sll(ZB_POINT_GREEN_MAX - ZB_POINT_GREEN_MIN)),
                            		int2sll(ZB_POINT_GREEN_MIN)
				      )
				   )
		            );
  p[7].ui = (unsigned int) (sll2int(
			  	slladd(
					sllmul(b, int2sll(ZB_POINT_BLUE_MAX - ZB_POINT_BLUE_MIN)), 
                            		int2sll(ZB_POINT_BLUE_MIN)
				      )
				   )
		            );
  gl_add_op(p);
}
示例#3
0
文件: arrays.c 项目: Masshat/almos
void 
glEnableClientState(GLenum array)
{
  GLParam p[2];
  p[0].op = OP_EnableClientState;
  
  switch(array) {
  case GL_VERTEX_ARRAY:
    p[1].i = VERTEX_ARRAY;
    break;  
  case GL_NORMAL_ARRAY:
    p[1].i = NORMAL_ARRAY;
    break;
  case GL_COLOR_ARRAY:
    p[1].i = COLOR_ARRAY;
    break;
  case GL_TEXTURE_COORD_ARRAY:
    p[1].i = TEXCOORD_ARRAY;
    break;
  default:
    assert(0);
    break;
  }
  gl_add_op(p);
}
示例#4
0
文件: arrays.c 项目: Masshat/almos
void
glArrayElement(GLint i)
{
  GLParam p[2];
  p[0].op = OP_ArrayElement;
  p[1].i = i;
  gl_add_op(p);
}
示例#5
0
void tglEdgeFlag(int flag) {
	TinyGL::GLParam p[2];

	p[0].op = TinyGL::OP_EdgeFlag;
	p[1].i = flag;

	gl_add_op(p);
}
示例#6
0
void tglLoadName(unsigned int name) {
	TinyGL::GLParam p[2];

	p[0].op = TinyGL::OP_LoadName;
	p[1].i = name;

	gl_add_op(p);
}
示例#7
0
文件: api.c 项目: humu2009/tinygl.js
void glInitNames(void)
{
  GLParam p[1];

  p[0].op=OP_InitNames;

  gl_add_op(p);
}
示例#8
0
文件: api.c 项目: humu2009/tinygl.js
void glPopMatrix(void)
{
  GLParam p[1];

  p[0].op=OP_PopMatrix;

  gl_add_op(p);
}
示例#9
0
文件: api.c 项目: humu2009/tinygl.js
void glEnd(void)
{
  GLParam p[1];

  p[0].op=OP_End;

  gl_add_op(p);
}
示例#10
0
文件: api.c 项目: humu2009/tinygl.js
void glLoadIdentity(void)
{
  GLParam p[1];

  p[0].op=OP_LoadIdentity;

  gl_add_op(p);
}
示例#11
0
文件: api.c 项目: humu2009/tinygl.js
void glPopName(void)
{
  GLParam p[1];

  p[0].op=OP_PopName;

  gl_add_op(p);
}
示例#12
0
文件: api.c 项目: humu2009/tinygl.js
void glEdgeFlag(int flag)
{
  GLParam p[2];

  p[0].op=OP_EdgeFlag;
  p[1].i=flag;

  gl_add_op(p);
}
示例#13
0
文件: api.c 项目: bhdminh/uGFX
void 
glPolygonOffset(GLfloat factor, GLfloat units)
{
  GLParam p[3];
  p[0].op = OP_PolygonOffset;
  p[1].f = factor;
  p[2].f = units;
  gl_add_op(p);
}
示例#14
0
文件: api.c 项目: humu2009/tinygl.js
void glMatrixMode(int mode)
{
  GLParam p[2];

  p[0].op=OP_MatrixMode;
  p[1].i=mode;

  gl_add_op(p);
}
示例#15
0
文件: api.c 项目: humu2009/tinygl.js
void glBegin(int mode)
{
  GLParam p[2];

  p[0].op=OP_Begin;
  p[1].i=mode;

  gl_add_op(p);
}
示例#16
0
文件: api.c 项目: humu2009/tinygl.js
void glClearDepth(double depth)
{
  GLParam p[2];

  p[0].op=OP_ClearDepth;
  p[1].f=depth;

  gl_add_op(p);
}
示例#17
0
文件: api.c 项目: humu2009/tinygl.js
void glClear(int mask)
{
  GLParam p[2];

  p[0].op=OP_Clear;
  p[1].i=mask;

  gl_add_op(p);
}
示例#18
0
void  glColorPointer(TGLint size, TGLenum type, TGLsizei stride, const TGLvoid *pointer) {
	GLParam p[4];
	assert(type == TGL_FLOAT);
	p[0].op = OP_ColorPointer;
	p[1].i = size;
	p[2].i = stride;
	p[3].p = const_cast<void *>(pointer);
	gl_add_op(p);
}
示例#19
0
文件: api.c 项目: humu2009/tinygl.js
void glCallList(unsigned int list)
{
  GLParam p[2];

  p[0].op=OP_CallList;
  p[1].i=list;

  gl_add_op(p);
}
示例#20
0
文件: api.c 项目: humu2009/tinygl.js
void glLoadName(unsigned int name)
{
  GLParam p[2];

  p[0].op=OP_LoadName;
  p[1].i=name;

  gl_add_op(p);
}
示例#21
0
文件: api.c 项目: humu2009/tinygl.js
void glMultMatrixf(const float *m)
{
  GLParam p[17];
  int i;

  p[0].op=OP_MultMatrix;
  for(i=0;i<16;i++) p[i+1].f=m[i];

  gl_add_op(p);
}
示例#22
0
文件: api.c 项目: humu2009/tinygl.js
void glHint(int target,int mode)
{
  GLParam p[3];

  p[0].op=OP_Hint;
  p[1].i=target;
  p[2].i=mode;

  gl_add_op(p);
}
示例#23
0
文件: api.c 项目: humu2009/tinygl.js
void glDisable(int cap)
{
  GLParam p[3];

  p[0].op=OP_EnableDisable;
  p[1].i=cap;
  p[2].i=0;

  gl_add_op(p);
}
示例#24
0
void tglScalef(float x, float y, float z) {
	TinyGL::GLParam p[4];

	p[0].op = TinyGL::OP_Scale;
	p[1].f = x;
	p[2].f = y;
	p[3].f = z;

	gl_add_op(p);
}
示例#25
0
文件: api.c 项目: humu2009/tinygl.js
void glPixelStorei(int pname,int param)
{
  GLParam p[3];

  p[0].op=OP_PixelStore;
  p[1].i=pname;
  p[2].i=param;

  gl_add_op(p);
}
示例#26
0
文件: api.c 项目: humu2009/tinygl.js
void glBindTexture(int target,int texture)
{
  GLParam p[3];

  p[0].op=OP_BindTexture;
  p[1].i=target;
  p[2].i=texture;

  gl_add_op(p);
}
示例#27
0
文件: api.c 项目: humu2009/tinygl.js
void glColorMaterial(int mode,int type)
{
  GLParam p[3];

  p[0].op=OP_ColorMaterial;
  p[1].i=mode;
  p[2].i=type;

  gl_add_op(p);
}
示例#28
0
void
glDrawArrays(GLenum mode, GLint first, GLsizei count)
{
  GLParam p[4];
  p[0].op = OP_DrawArrays;
  p[1].i = mode;
  p[2].i = first;
  p[3].i = count;
  gl_add_op(p);
}
示例#29
0
void tglClearColor(float r, float g, float b, float a) {
	TinyGL::GLParam p[5];

	p[0].op = TinyGL::OP_ClearColor;
	p[1].f = r;
	p[2].f = g;
	p[3].f = b;
	p[4].f = a;

	gl_add_op(p);
}
示例#30
0
void tglViewport(int x, int y, int width, int height) {
	TinyGL::GLParam p[5];

	p[0].op = TinyGL::OP_Viewport;
	p[1].i = x;
	p[2].i = y;
	p[3].i = width;
	p[4].i = height;

	gl_add_op(p);
}