منتدى مصر التقني
هل تريد التفاعل مع هذه المساهمة؟ كل ما عليك هو إنشاء حساب جديد ببضع خطوات أو تسجيل الدخول للمتابعة.

ارجوو المساعدة

اذهب الى الأسفل

ارجوو المساعدة Empty ارجوو المساعدة

مُساهمة من طرف حياة الشقا الثلاثاء أبريل 28, 2015 5:00 pm

أتمنى تساعدوني في اخراج الاوت بوت لهذه البرامج واذا امكن صورة للاوت وشكرا مقدما  


// PROGRAM TO DRAW WINDOW WITH CLEAR COMMAND
Program Name : window_with_clear.cpp
#include <GL/glut.h>
void display (void)
{
                glClearColor (0.0, 0.0, 0.0, 1.0);
                glClear (GL_COLOR_BUFFER_BIT);
                glLoadIdentity();
                gluLookAt (0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
                glFlush();
}
int main (int argc, char **argv)
{
                glutInit (&argc, argv);
                glutInitDisplayMode (GLUT_SINGLE);
                glutInitWindowSize (500,500);
                glutInitWindowPosition (100, 100);
                glutCreateWindow ("Simple Window");
                glutDisplayFunc (display);
                glutMainLoop();
                return 0;
}
 
البرنامج الثاني
 
// PROGRAM TO DRAW WINDOW WITHOUT CLEAR COMMAND
Program Name : window_without_clear.cpp
#include <GL/glut.h>
                void display (void)
{
                                glClearColor (0.0, 0.0, 0.0, 1.0);
                                //glClear (GL_COLOR_BUFFER_BIT);
                                glLoadIdentity();
                                gluLookAt (0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
                                glFlush();
}
int main (int argc, char **argv)
{
                                glutInit (&argc, argv);
                                glutInitDisplayMode (GLUT_SINGLE);
                                glutInitWindowSize (500,500);
                                glutInitWindowPosition (100, 100);
                                glutCreateWindow ("Simple Window");
                                glutDisplayFunc (display);
                                glutMainLoop();
                           
البرنامج الثالث
 
// Program name : point.cpp
 #include <windows.h>                           // use as needed for your system
#include <gl/Gl.h>
#include <gl/glut.h>
 void myInit(void)
                 {
                glClearColor(1.0,1.0,1.0,0.0);                                      // set white background color glColor3f(0.0f, 0.0f, 0.0f);                               // set the drawing color glPointSize(4.0);                                            // a ‘dot’ is 4 by 4 pixels glMatrixMode(GL_PROJECTION);
                glLoadIdentity();
                 gluOrtho2D(0.0, 640.0, 0.0, 480.0);
                }
 void myDisplay(void)
                 {
                 glClear(GL_COLOR_BUFFER_BIT);           // clear the screen
                 
   glBegin(GL_POINTS);
                glVertex2i(10,10);
                glVertex2i(100, 50);                                        // draw three points
                glVertex2i(100, 130);
                glVertex2i(150, 130);
                glEnd();
                glFlush();                                                              // send all output to display
}
void main(int argc, char** argv)
{
                glutInit(&argc, argv);                           // initialize the toolkit
                glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); // set display mode
      glutInitWindowSize(640,480);                             // set window size
     glutInitWindowPosition(100, 150);    // set window position on screen
                glutCreateWindow(“POINT DISPLAY"); // open the screen window
                glutDisplayFunc(myDisplay);                     // register redraw function
                myInit();
                glutMainLoop();                               // go into a perpetual loop
}
حياة الشقا
حياة الشقا
..
..

تاريخ التسجيل : 26/11/2012
المساهمات : 17
النقاط : 30
التقيم : 1
الدولة : السعودية
الجنس : انثى

الرجوع الى أعلى الصفحة اذهب الى الأسفل

الرجوع الى أعلى الصفحة

ََ

مواضيع ذات صلة


 
صلاحيات هذا المنتدى:
لاتستطيع الرد على المواضيع في هذا المنتدى