Jump to content
  • Advertisement
Sign in to follow this  
SippyCup

GLvoid?

This topic is 4758 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just started reading through the NeHe tutorial, and of course when I finished the code, I got a ton of build errors. I figured the most important ones to solve first are the ones that say GLsizei and GLvoid are undeclared identifiers. Can someone tell me where those are defined? I have gl.h, glu.h, and glaux.h included. I just need to figure out which one is acting screwy. *EDIT* Nevermind, I just found it in gl.h, but now I wonder what the purpose is of even using GLvoid and GLsizei, since GLvoid is just void and GLsizei is just an int. What's the point?

Share this post


Link to post
Share on other sites
Advertisement
GLvoid is likely for consistency...everything else gets a typedef, why not void? GLsizei looks as though it is meant to be the equivalent of size_t. Mostly just a way of providing extra type information, even if c++ doesn't respect it. GLsizei somefunc() isn't just returning any old integer, it is returning a size of something.

CM

Share this post


Link to post
Share on other sites
For some reason, Visual Studio is very unhappy about my use of GLvoid and GLsizei.


// ogl.cpp : Defines the entry point for the application.
//

#include <windows.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include <gl\glaux.h>
#include "stdafx.h"
#include "ogl.h"
#define MAX_LOADSTRING 100

// Global Variables:
HGLRC hRC=NULL;
HDC hDC=NULL;
HWND hWnd=NULL;
HINSTANCE hInstance;
bool keys[256];
bool active = true;
bool fullscreen = true;
TCHAR szTitle[MAX_LOADSTRING];
TCHAR szWindowClass[MAX_LOADSTRING];

// Forward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);
GLvoid ReSizeGLScene(GLsizei width, GLsizei height);


The last line there where GLsizei and GLvoid are mentioned is where it freaks. I can't figure it out.

Share this post


Link to post
Share on other sites
Well, I stuck my own typedef into the code for GLvoid and it worked just fine, so apparently it isn't really including gl.h for some interesting reason.

Share this post


Link to post
Share on other sites
Quote:
Original post by SippyCup

// ogl.cpp : Defines the entry point for the application.
//

#include <windows.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include <gl\glaux.h>
#include "stdafx.h"
#include "ogl.h"

Your problem is that the preprocessor removes everything before #include "stdafx.h". #include "stdafx.h" must be before everything (except for comments).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!