From 3e2fa3fd5cafdc641138844276c4260e028684ac Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Thu, 17 Oct 2002 19:39:31 +0000 Subject: Change for Windows only: Make demos and examples build again. Move the inclusion of windows.h from glext.h to gl.h. There are a few good reasons for this: - Including it in gl.h is more strightforward and makes it easier to troubleshoot include file problems. It was sometimes hard to find it in glext.h. - Needed to define APIENTRY correctly. APIENTRY is used in gl.h. - glut.h needs windows.h but does not include it, expecting the app to include it. Including it in gl.h if not already included by the app makes glut.h happy. This allows one to write a gl/glut app without explictly including windows.h, which may only be really important for toy apps like our samples and demos. But a "real" app can still include windows.h if it wants. --- include/GL/gl.h | 15 ++++++++++++++- include/GL/glext.h | 5 ----- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index bced617f15..44254a77ff 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.71 2002/09/21 16:47:09 brianp Exp $ */ +/* $Id: gl.h,v 1.72 2002/10/17 19:39:31 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -67,6 +67,19 @@ # define PRAGMA_EXPORT_SUPPORTED 1 #endif +/* + * WINDOWS: Include windows.h here to define APIENTRY. + * It is also useful when applications include this file by + * including only glut.h, since glut.h depends on windows.h. + * Applications needing to include windows.h with parms other + * than "WIN32_LEAN_AND_MEAN" may include windows.h before + * glut.h or gl.h. + */ +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + #if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(__CYGWIN__) #include #endif diff --git a/include/GL/glext.h b/include/GL/glext.h index 245f100c70..f88d7e79b3 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -34,11 +34,6 @@ extern "C" { ** version 1.2.1 Specification. */ -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) -#define WIN32_LEAN_AND_MEAN 1 -#include -#endif - #ifndef APIENTRY #define APIENTRY #endif -- cgit v1.2.3