Home>

I tried to connect Froch now, but for some reason, abyss, nothing comes out :(

unitled22.pro

Template= App
Config += Console c++ 11
Config -= App_Bundle
Config -= Qt
SOURCES += \
        main.cpp.
Win32: LIBS += -L $$ PWD /FreeGlut /Lib /x64 /-lFreeGlut
Includepath += $$ PWD /FreeGlut /LIB /X64
Dependpath += $$ PWD /FreeGlut /LIB /X64
Win32: libs += -l $$ PWD /GLEW-2.1.0 /LIB /RELEASE /X64 /-LgleW32
INCLUDEPATH += $$ PWD /GLEW-2.1.0 /INCLUDE /GL
DependPath += $$ PWD /GLEW-2.1.0 /Include /GL
Includepath += $$ PWD /FreeGlut /include /GL /\ # add to convenience to write directly
                $$ PWD /GLEW-2.1.0 /INCLUDE /GL /

main.cpp

#include <
Cstdlib >
#Include <
CMATH >
#Include <
iostream >
#Include <
freeglut.h >
#Include <
glew.h >
#Define Pi 3.14159265358979324
Using Namespace STD;
//Globals.
STATIC FLOAT R= 40.0; //Radius of Circle.
Static Float x= 50.0; //X-Coordinate of Center Of Circle.
Static Float Y= 50.0; //Y-Coordinate of Center of Circle.
STATIC INT NUMVERTICES= 5; //Number of Vertices ON CIRCLE.
//Drawing Routine.
Void Drawscene (Void)
{
   Float T= 0; //Angle Parameter.
   int i;
   glclear (GL_COLOR_BUFFER_BIT);
   glcolor3f (0.0, 0.0, 0.0);
   //Draw A Line Loop with Vertices At Equal Angles Apart On A Circle
   //WITH CENTER AT (X, Y) AND RADIUS R, THE VERTICES ARE COLORED RANDOMLY.
   glbegin (GL_LINE_LOOP);
      for (i= 0; i <
 Numvertices; ++ I)
      {
         GLCOLOR3F ((FLOAT) RAND_MAX, (FLOAT) RAND_MAX, (FLOAT) RAND () /(FLOAT) RAND_MAX, (FLOAT) RAND () /(FLOAT) RAND_MAX);
         glvertex3f (x + r * cos (t), y + r * sin (t), 0.0);
         t += 2 * pi /numvertices;
      }
   Glend ();
   glflush ();
}
//Initialization Routine.
Void Setup (Void)
{
   glclearcolor (1.0, 1.0, 1.0, 0.0);
}
//OpenGL Window Reshape Routine.
Void Resize (int w, int h)
{
   glViewPort (0, 0, w, h);
   GlMatrixMode (GL_Projection);
   glloadidentity ();
   glortho (0.0, 100.0, 0.0, 100.0, -1.0, 1.0);
   GlMatrixMode (GL_Modelview);
   glloadidentity ();
}
//Keyboard Input Processing Routine.
Void Keyinput (Unsigned Char Key, Int X, Int Y)
{
   Switch (Key)
   {
      Case 27:
         EXIT (0);
         Break;
      Case '+':
         Numvertices ++;
         GLUTPOSTREDISPLAY ();
         Break;
      Case '-':
         IF (Numvertices >
 3) numvertices--;
         GLUTPOSTREDISPLAY ();
         Break;
      Default:
         Break;
   }
}
//Routine to Output Interaction Instructions to the c++ Window.
Void Printinteraction (Void)
{
   COUT <
≪
 "Interaction:" <
≪
 Endl;
   COUT <
≪
 "Press +/-To Increase /Decrease The Number of Vertices On The Circle." ≪
≪
 Endl;
}
//Main Routine.
INT MAIN (Int Argc, char ** argv)
{
   printinteraction ();
   Glutinit (&
argc, argv);
   glutinitcontextversion (4, 3);
   glutinitcontextprofile (glut_compatibility_profile);
   glutinitdisplaymode (glut_single | glut_rgba);
   glutinitwindowsize (500, 500);
   glutinitwindowposition (100, 100);
   glutcreatewindow ("circle.cpp");
   GLUTDISPLAYFUNC (Drawscene);
   GLUTRESHAPEFUNC (resize);
   glutkeyboardfunc (keyinput);
   GleWEXPERIMENTAL= GL_TRUE;
   glewinit ();
   setup ();
   glutmainloop ();
}

I get this result: (