hi all
does this possible ?
from camera example , i want to draw a cube on viewfinder , how to do ?
plz help.
thanks.![]()
hi all
does this possible ?
from camera example , i want to draw a cube on viewfinder , how to do ?
plz help.
thanks.![]()
I try this code snip :
static const GLbyte vertices1[8*2] = { 0,100, 100,0, 0,-100,
-100,0, 0,50, 45,20, -45,20 };
static const GLbyte vertices2[7*4] = { 0,0,255,255, 0,255,0,255,
255,0,0,255, 255,255,255,255, 255,0,255,255, 255,255,0,255,
0,255,255,255 };
static const GLushort indices[9] = { 0,3,1, 1,3,2, 4,6,5 };
glEnableClientState( GL_VERTEX_ARRAY );
glColor4ub( 255, 0, 0, 255 ); //glColor4ub undeclared, how to do ?
glVertexPointer( 2, GL_BYTE, 0, vertices1 );
/* skip vertex 0, draw five triangles */
glDrawArrays( GL_TRIANGLE_STRIP, 1, 7 );
glVertexPointer( 2, GL_BYTE, 0, vertices2 );
/* draw three triangles, using the first seven vertices */
glDrawElements( GL_TRIANGLES, 9, GL_UNSIGNED_SHORT, indices );
glColor4ub is present in gl.h, so re-check if you get some other error messages too.
also try this code,
bitmap has content, but not thing happen.
how to draw ?
thanks.
/* Enable back face culling, texturing, and normalization. */
glEnable( GL_TEXTURE_2D );
/***an appropriate texture matrix has to be initialized*/
glMatrixMode( GL_TEXTURE );
glLoadIdentity();
glScalef( 1.f / 128.f, 1.f / 128.f, 1.f );
glTranslatef( 128.f, 128.f, 0.f );
glMatrixMode( GL_MODELVIEW );
glEnableClientState( GL_TEXTURE_COORD_ARRAY );
// select our current texture[/COLOR]
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, aRect.Width(), aRect.Height(),
0, GL_RGB, GL_UNSIGNED_BYTE, (GLvoid*)iBitmap->DataAddress() );
/**************Texture environment parameters are set using glTexEnvf().*/
glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE,/*GL_REPLACE */GL_DECAL);
// if wrap is true, the texture wraps over at the edges (repeat)
// ... false, the texture ends at the edges (clamp)
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,EFalse ? GL_REPEAT : GL_CLAMP_TO_EDGE );
Last edited by nokia_lin; 2009-06-11 at 04:52.