Results 1 to 3 of 3

Thread: Whats wrong with this!!

  1. #1
    Junior Member Newbie
    Join Date
    May 2001
    Location
    Ann Arbor, MI
    Posts
    15

    Whats wrong with this!!

    this program complies on my msvc++ complier but when execute it ,,,,,by the way its windows console appl..... I dont get the open gl window i get the console window with a error message saying FATAL ERROR IN (UNAMED): PIXEL FORMAT WITH NECESSARY CAPABILITIES NOT FOUND d. Today I put the glut32.dlls in the win system dir and the glut.h in th include\gl and everthing else. Also i ran the first program in the opengl superbible 2nd ed. just fine..... whats wrong !!
    please help!!!

    // glrect.cpp : Defines the entry point for the console application.
    //

    #include "stdafx.h"
    #include <windows.h>
    #include <gl\glut.h>

    void RenderScene(void)
    {
    glClear(GL_COLOR_BUFFER_BIT);
    glColor3f(1.0f,0.0f,0.0f);

    glRectf(100.0f,150.0f,150.0f,100.0f);

    glFlush();

    }

    void SetupRC(void)
    {
    glClearColor(0.0f,0.0f,1.0f,1.0f);
    }

    void ChangeSize(GLsizei w, GLsizei h)
    {
    if (h==0)
    h = 1;

    glViewport(0,0,w,h);
    glMatrixMode(GL_PROJECTION);

    glLoadIdentity();

    if (w<=h)

    glOrtho(0.0f,250.0f,0.0f,250.0f*h/w,1.0,-1.0);
    else
    glOrtho(0.0f,250.0f*w/h,0.0f,250.0f,1.0,-1.0);

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    }

    void main(void)
    {
    glutInitDisplayMode(GLUT_SINGLE|GL_RGB);
    glutCreateWindow("ernie");
    glutDisplayFunc(RenderScene);
    glutReshapeFunc(ChangeSize);

    SetupRC();

    glutMainLoop();
    }


    thank you

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jul 2000
    Location
    Arlon, Belgium
    Posts
    477

    Re: Whats wrong with this!!

    Try to include "windows.h" before "stdfax.h"

    Else if doesn't work, send me your source code and I'll try to compile on my computer.

  3. #3
    Junior Member Newbie
    Join Date
    May 2001
    Location
    Ann Arbor, MI
    Posts
    15

    Re: Whats wrong with this!!

    I found the problem... it was this

    glutInitDisplayMode(GLUT_SINGLE | GL_RGB)

    I put GL instead of GLUT.... That problem cost me 6 hours ain`t programming great!!

    That would make a preacher cuss!!

    Thanks any way for the reply,

Similar Threads

  1. Not sure whats wrong
    By Discoloda in forum OpenGL: GLSL
    Replies: 0
    Last Post: 10-31-2005, 08:58 AM
  2. Whats wrong with the picking?
    By Bilyboy in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 04-08-2004, 05:25 AM
  3. Whats wrong with this ?
    By freestyler in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 08-27-2002, 05:11 AM
  4. Whats wrong with my code? :(
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-17-2001, 09:24 AM
  5. Whats wrong with this bit of code?
    By Schlogenburg in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 07-01-2000, 01:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean