hi,
I want design program by open gl
when user set the psition by the mouse
I allowed for user enter s(he) text
I have some code for writting but not interactvie with user
#include <gl\glut.h>
#include<string.h>
void bitmap_output(int x,int y, char*string,void *font)
{int len,i;
glRasterPos2f(x,y);
len=(int)strlen(string);
for(i=0;i<len;i++)
{
glutBitmapCharacter(font,string[i]);}}
void display (void)
{
glClear(GL_COLOR_BUFFER_BIT);
bitmap_output(10,35,“First Attempt”,GLUT_BITMAP_TIMES_ROMAN_24);
bitmap_output(30,100,“Font with 9 by 15 pixels”,GLUT_BITMAP_9_BY_15);
bitmap_output(70,150,"Helvetica Font ",GLUT_BITMAP_HELVETICA_18);
glFlush();
}
void reshape (int w ,int h){
glViewport(0,0,w,h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0,w,0,h);
}
int main (void)
{glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutInitWindowSize(350,250);
glutCreateWindow(“Font Program”);
glClearColor(1,1,1,0);
glColor3f(0,0,0);
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutMainLoop();
return(0);
}
how i can design this idea
I know must use key board and mouse function but I don’t know how (when user enter character by keyboard display in the same time in work area(the view port or windows I designed)
regardes
moon girl