Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: getting blank screen

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2001
    Location
    san jose,ca usa
    Posts
    18

    getting blank screen

    Hi
    I am trying to run a simple program
    I have gl.h,glut.h,glu.h [compiler]\include\gl
    Opengl32.lib,glut32.lib,glu32.lib [compiler]\lib
    Opengl32.dll,glut32.dll,glu32.dll [system]

    I save my source code in C:\Program Files\Microsoft Visual Studio\MyProjects.

    It is displaying an empty window.

    The source code
    #include<GL\glut.h>

    void display()
    {

    glClear(GL_COLOR_BUFFER_BIT);
    glBegin(GL_POLYGON);
    glVertex2f(-0.5,-0.5);
    glVertex2f(-0.5,0.5);
    glVertex2f(0.5,0.5);
    glVertex2f(0.5,-0.5);

    glEnd();
    glFlush();
    }

    int main(int argc, char** argv)
    {
    glutInit(&argc,argv);
    glutCreateWindow("simple");
    glutDisplayFunc(display);
    glutMainLoop();

    }

    Please help me in solving this issue.
    Mary

  2. #2
    Junior Member Newbie
    Join Date
    Oct 2001
    Posts
    20

    Re: getting blank screen

    Your polygon is wound clockwise. Meaning that it is backfacing.

    Wind your vertices the other way and you'll see your polygon.

    SL

  3. #3
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,651

    Re: getting blank screen

    Hi !

    Have you setup the projection matrix and modelview matrix correct ?

    Mikael

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •