GLvoid?

Started by
5 comments, last by SippyCup 18 years, 6 months ago
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?
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
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.
Fruny wrote a reply to a post similiar to this here.

Something else
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.
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).
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
Ah, sweet. Thank you. I learned something. :)

This topic is closed to new replies.

Advertisement