Results 1 to 4 of 4

Thread: VC compiler error

  1. #1
    Guest

    VC compiler error

    error C2054: expected '(' to follow 'WINGDIAPI'

    and the line containing error is in gl.h:

    WINGDIAPI void APIENTRY glAccum (GLenum op, GLfloat value);

    which I never touched!

    Please tell me how to correct this.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: VC compiler error

    If you had done a search on the form before asking this, you would see that this is a simple newbie error. You need to #include <windows.h> BEFORE GL/gl.h.

    For future reference, if you ever see errors near things that are not simple types (int/char/float/etc.) the first thing you should check is what header has that type defined and make sure it is included before the error.
    Deiussum
    Software Engineer and OpenGL enthusiast

  3. #3
    Guest

    Re: VC compiler error

    yeah i am new in openGL.

    one more question.

    how to Clear the hidden surfaces?
    Is there any requirement as to where to put the glClear(GL_DEPTH),glEnable(GL_DEPTH),in reshape() or in display()?

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: VC compiler error

    Obviously somewhat new to C/C++ as well or you would have realized what the error was telling you.

    You usually clear the depth buffer when you clear the screen before rendering a frame. You would put glEnable(GL_DEPTH) somewhere in your initialization code and to clear the depth buffer you use glClear(GL_DEPTH_BUFFER_BIT) not glClear(GL_DEPTH).

    To clear both the color buffer and the depth buffer at the same time do glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    Deiussum
    Software Engineer and OpenGL enthusiast

Similar Threads

  1. Compiler error
    By Vincent in forum COLLADA
    Replies: 6
    Last Post: 04-22-2008, 12:22 PM
  2. Compiler error
    By Tomy in forum OpenGL: GLSL
    Replies: 2
    Last Post: 09-29-2005, 12:50 AM
  3. compiler error
    By ncc1701 in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 05-02-2005, 01:53 AM
  4. compiler error
    By nitch in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-08-2002, 03:32 AM
  5. glGenTextures compiler error
    By nuudoo in forum OpenGL: Basic Coding
    Replies: 18
    Last Post: 11-21-2000, 04:54 AM

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