   Draw a Circle, nothing show!
#pragma comment(lib, "glu32.lib")#pragma comment(lib, "opengl32.lib")#include <gl/gl.h> void main(){glColor3f(0.9f,0.9f,0.9f);drawCircle(265.5f);}void drawCircle(float radius){   glBegin(GL_LINE_LOOP);    for (int i=0; i <360; i++)   { glVertex2f(cos((i*PI/180))*radius,sin((i*PI/180))*radius);   }    glEnd();}nothing happen!I use visual studio 2005 and I am programming this openGl with directXwhy nothing happen?I think use openGl will save memory than import graphic from file.I am new to openGL , please advice...   
  If that's all your code, of course it won't work. It's missing critical parts such as OpenGL Context and Window creation, and event loop, etc.Googling i found this example which looks it might give you a direction.Also, what do you mean with "I am programming this openGl with directX". That also doesn't make sense.   ;Quote:Original post by HuntsManIf that's all your code, of course it won't work. It's missing critical parts such as OpenGL Context and Window creation, and event loop, etc.Googling i found this example which looks it might give you a direction.Also, what do you mean with "I am programming this openGl with directX". That also doesn't make sense.well, I never use openGL before and after I looked at the internet,I feel I cannot use openGl with directX.I use window and event loop from DirectX soit means that I cannot combine openGl and DirectX right?   ;  DirectX is a set of technologies, DirectDraw, Direct3D, DirectWhatever. The event loop for Windows is just using the Win32 API for that, and that works perfectly with OpenGL.   ;  OpenGL and DirectX are rendering APIs. They take data you supply and send it to the graphics card for display. They are essentially the same, except that OpenGL is an open standard and DirectX is a closed, proprietary system. They are mutually exclusive. I think it may be possible to use both at once, but this would depend on the graphics card driver and I can think of no good reason to do so.Window and event handling is specific to the operating system you are using (OS X, Windows, a variant of Linux, etc.). You must give OpenGL and DirectX a window to work in otherwise there is nowhere to draw the object.You need to learn the basics of OpenGL for your OS. I'm assuming you're using Windows since you mentioned DirectX, so the same applies for DirectX.   ;  Hi, you did not use OpenGL API to draw.Open GL does not include any window events, so you need to use glut library.see the example below#include <iostream>#include <windows.h>#include <math.h>// Include the Glut Header File for Windows Events#include "glut.h"const int RADIUS = 1;  //set the radius of the circleusing namespace std; void Display(void){glClear( GL_COLOR_BUFFER_BIT);  // clear the color bit glColor3f(1.0,0.0,0.0);  // set the color for the drawingglPointSize(3.0f);  // set point sizeglLoadIdentity();  // load identity to reset all the transformationsglBegin(GL_POINTS);   //Open GL API to draw POINTS, specify all vertex heredouble  RADIAN =  3.14 / (double) 180;glVertex2f(0, 0);  // first vertex at the originfor ( int i = 0; i <= 360; i++ )glVertex2f( RADIUS * sin( RADIAN * i ), RADIUS * cos( RADIAN * i)); glEnd();glutSwapBuffers();}void Reshape(int h, int w){glLoadIdentity();glOrtho(-5.0,5.0,-5.0,5.0,-5.0,5.0);}void init(void){glClearColor(0.0,0.0,0.0,1.0);  // state variable}void main( int argc, char **argv){glutInit(&argc,argv);   // intialize the glut/*in display you can specify the BUFFERS, like. SINGLE or DOUBLE check GLUT library for more information*/glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB );  // set Window positionglutInitWindowPosition(20,20);// set Window SizeglutInitWindowSize(500,500);// below function create a window, with title given glutCreateWindow("Demo - Circle");init();  // intialize the state valueglutDisplayFunc(Display);   glutReshapeFunc(Reshape);glutMainLoop();}Regards, Aman