資源簡介
這個資源是通過鼠標(biāo)點擊,在頁面上點擊會出現(xiàn)變色的小點,有興趣的可以看看
代碼片段和文件信息
#include?
#include?
#include?
int?x;
int?y;
int?screenheight?=?600;
int?screenwidth?=?800;
void?myMouse(int?button?int?state?int?x?int?y)?{
if(state?==?GLUT_DOWN)?
{
if(button?==?GLUT_LEFT_BUTTON)?
{
//glClearColor(0.3f?1.0f?0.7f?0.0f);?//teal
//glClear(GL_COLOR_BUFFER_BIT);
glPointSize(5.0);
glBegin(GL_POINTS);{
//glVertex2i(screenwidth?-?x?y);
//glVertex2i(x?y);
glVertex2i(x?screenheight?-?y);
}
glEnd();
glFlush();
}
else?if?(button?==?GLUT_RIGHT_BUTTON)?
{
glClearColor(1.0f?0.0f?0.0f?0.0f);?//?Red
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}
}
}
void?myDisplay()
{
glClearColor(0.0f?1.0f?0.0f?0.0f);?//green
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}
int?main(?int?argc?char?**?argv?)?{
glutInit(?&argc?argv?);
glutInitWindowPosition(?0?0?);
glutInitWindowSize(?800?600?);
//glutInitDisplayMode(?GLUT_RGB?|?GLUT_DOUBLE?);
//?create?window
glutCreateWindow(?“Draw?Dots“?);
//?set?the?view?frustum
glMatrixMode(?GL_PROJECTION?);?
glLoadIdentity();
gluOrtho2D(?0?800?0?600?);
//glMatrixMode(?GL_MODELVIEW?);
//?clear?rendering?surface
glClearColor(0.0f?0.0f?0.0f?0.0f);??//?background?is?black
glViewport(0?0?800?600);
glutMouseFunc(?myMouse?);
glutDisplayFunc(?myDisplay?);
glutMainLoop();
return(?0?);
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????820??2012-12-10?16:11??mouseDots\Debug\cl.command.1.tlog
?????文件??????12752??2012-12-10?16:11??mouseDots\Debug\CL.read.1.tlog
?????文件????????534??2012-12-10?16:11??mouseDots\Debug\CL.write.1.tlog
?????文件??????????2??2012-12-10?16:11??mouseDots\Debug\li
?????文件??????????2??2012-12-10?16:11??mouseDots\Debug\li
?????文件???????1648??2012-12-10?16:11??mouseDots\Debug\li
?????文件???????3536??2012-12-10?16:11??mouseDots\Debug\li
?????文件???????1214??2012-12-10?16:11??mouseDots\Debug\li
?????文件??????26646??2012-12-10?16:11??mouseDots\Debug\main.obj
?????文件?????433664??2012-12-10?16:11??mouseDots\Debug\mouseDots.exe
?????文件????????406??2012-12-10?16:11??mouseDots\Debug\mouseDots.exe.em
?????文件????????472??2012-12-10?16:11??mouseDots\Debug\mouseDots.exe.em
?????文件????????381??2012-12-10?16:11??mouseDots\Debug\mouseDots.exe.intermediate.manifest
?????文件????1017896??2012-12-10?16:11??mouseDots\Debug\mouseDots.ilk
?????文件????????133??2012-12-10?16:11??mouseDots\Debug\mouseDots.lastbuildstate
?????文件???????3460??2012-12-10?16:11??mouseDots\Debug\mouseDots.log
?????文件????1838080??2012-12-10?16:11??mouseDots\Debug\mouseDots.pdb
?????文件????????214??2012-12-10?16:11??mouseDots\Debug\mouseDots_manifest.rc
?????文件????????470??2012-12-10?16:11??mouseDots\Debug\mt.command.1.tlog
?????文件????????526??2012-12-10?16:11??mouseDots\Debug\mt.read.1.tlog
?????文件????????458??2012-12-10?16:11??mouseDots\Debug\mt.write.1.tlog
?????文件????????692??2012-12-10?16:11??mouseDots\Debug\rc.command.1.tlog
?????文件????????430??2012-12-10?16:11??mouseDots\Debug\rc.read.1.tlog
?????文件????????438??2012-12-10?16:11??mouseDots\Debug\rc.write.1.tlog
?????文件?????371712??2012-12-10?16:11??mouseDots\Debug\vc100.idb
?????文件?????102400??2012-12-10?16:11??mouseDots\Debug\vc100.pdb
?????文件?????140288??2007-02-06?17:56??mouseDots\Debug\vc60.idb
?????文件??????77824??2007-02-06?17:56??mouseDots\Debug\vc60.pdb
?????文件???33161216??2012-12-10?16:11??mouseDots\ipch\mousedots-855d37eb\mousedots-3a36fd99.ipch
?????文件???????1417??2007-02-06?17:56??mouseDots\main.cpp
............此處省略18個文件信息
- 上一篇:SMBMS.rar
- 下一篇:SSH網(wǎng)上商城項目實戰(zhàn)完整源碼
評論
共有 條評論