Seversintabi.com Türkiye'nin En Büyük Forumu Bence Seversin Tabi
 

Go Back   Seversintabi.com Türkiye'nin En Büyük Forumu Bence Seversin Tabi > Bilgisayar Dünyası > Programlama Ve Tasarım
Yardım Topluluk Takvim Bugünki Mesajlar Arama

gaziantep escort gaziantep escort
youtube beğeni hilesi
Cevapla

 

LinkBack Seçenekler Stil
  #1  
Alt 16 November 2008, 20:06
Senior Member
 
Kayıt Tarihi: 21 September 2008
Mesajlar: 15,180
Konular:
Aldığı Beğeni: 0 xx
Beğendiği Mesajlar: 0 xx
Post Visual C++ ile OpenGl kullanarak PolyLine Çizdirme

Visual C++ ile OpenGl kullanarak PolyLine çizdirme Mouse ile hareket ettirerek PolyLine çizdirme#include <GL/glut.h>
GLsizei winWidth=400,winHeight=300;
GLint endPtCtr=0;
class scrPt{
public:
GLint x,y;
};
void init(void){
glClearColor(0.0,0.0,1.0,1.0);
glMatrixMode(GL_PROJECTION);
gluOrtho2D(0.0,200.0,0.0,150.0);
}
void displayFcn(void){
glClear(GL_COLOR_BUFFER_BIT);
}
void winReshapeFcn(GLint newWidth,GLint newHeight){
glViewport(0,0,newWidth,newHeight);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0,GLdouble (newWidth),0.0,GLdouble (newHeight));
winWidth=newWidth;
winHeight=newHeight;
}
void drawLineSegment(scrPt endPt1,scrPt endPt2){
glBegin(GL_LINES);
glVertex2i(endPt1.x,endPt1.y);
glVertex2i(endPt2.x,endPt2.y);
glEnd();
}
void polyline(GLint button,GLint action,GLint xMouse,GLint yMouse){
static scrPt endPt1,endPt2;
if(endPtCtr==0){
if(button==GLUT_LEFT_BUTTON && action==GLUT_DOWN){
endPt1.x=xMouse;
endPt1.y=winHeight-yMouse;

endPtCtr=1;
}
else
if(button==GLUT_RIGHT_BUTTON)
exit(0);
}
else
if(button==GLUT_LEFT_BUTTON && action==GLUT_DOWN){
endPt2.x=xMouse;
endPt2.y=winHeight-yMouse;
drawLineSegment(endPt1,endPt2);
endPt1=endPt2;
}
else
if(button==GLUT_RIGHT_BUTTON)
exit(0);
glutSwapBuffers();
}



int main(int argc, char ** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize(winWidth,winHeight);
glutInitWindowPosition(100, 100);
glutCreateWindow("PolyLine Çiz");
init();
glutDisplayFunc(displayFcn);
glutReshapeFunc(winReshapeFcn);
glutMouseFunc(polyline);
glutMainLoop();
return 0;
}

ALINTIDIR.
Alıntı ile Cevapla
Cevapla




Saat: 05:07


Telif Hakları vBulletin® v3.8.9 Copyright ©2000 - 2024, ve
Jelsoft Enterprises Ltd.'e Aittir.
gaziantep escort bayan gaziantep escort
antalya haber sex hikayeleri Antalya Seo tesbih aresbet giriş vegasslotguncel.com herabetguncel.com ikili opsiyon bahis vegasslotyeniadresi.com vegasslotadresi.com vegasslotcanli.com getirbett.com getirbetgir.com
ankara escort ankara escort ankara escort bayan escort ankara ankara escort çankaya escort ankara otele gelen escort eryaman escort eryaman escort eryaman escort kızılay escort çankaya escort kızılay escort ankara eskort
mecidiyeköy escort

Search Engine Friendly URLs by vBSEO 3.6.0 PL2